DOC E10523 Rev.D
Interactive Circuits And Systems Ltd. 2000
40
5.19 Using Diagnostic Mode
The ICS-130 has built in digital diagnostic circuitry wich allows the user to test all
functionality of the board with the exception of the ADCs themselves. This is accomplished
by feeding the ICS-130 with simulated ADC data from an on-board 4 KWord FIFO memory.
The diagnostic mode is used by first configuring the ICS-130 registers and then setting the
DIAG ENABLE bit (CR<2>) of the Control Register. Data may then be written to the board
in the ADC Data window in blocks not exceeding 4096 words. Between each block the
board must be enabled until the Diag FIFO Empty bit (SR<4>) in the Status register is set.
The board can then be disabled and the next block written. Once all the data has been
written, the DIAG ENABLE bit can then be reset, and the data written to the board can then
be read back.
When data is written to the board in diagnostic mode, the data flows through a hardware
chain which includes a serial to parallel converter. As a result, the data read back has a
different appearance from that written. The data read back can be considered to be in
blocks of thirty-two 32-bit words, where the first word of each block is formed from the least
significant bits (bit 00) of the first thirty-two words written to the board, the second word read
back is formed from bit 01 of the first thirty-two words written, and so on.
The data read back can be converted to that of the written format using the following ‘C’
language routine (buflen must be a multiple of 16). Data obtained in the buffer rbufd should
be the same as the data that was written to the board in Diagnostic mode:
int dataconv(
int *rbuf, /* Write data buffer */
int *rbufd /* Buffer for data converted to Read format */
int buflen /* Buffer length (32-bit words) */
)
{
int i, j, k, mask, l[32];
for (i=0; i < buflen/16; i++)
{
for (j=0; j<32; j++) l[j] = 0;
for (j=0; j<16; j++)
{
mask = 1;
for (k=0; k<32; k++)
{
if (rbuf[i*16 + j] & mask)
l[k] = (l[k] << 1) | 0x1;
else
l[k] = l[k] << 1;
mask = mask << 1;
}
}
for (j=0; j<16; j++) rbufd[i*16 + j] = (l[2*j]<<16) | l[2*j +1];
}
} /* dataconv */
Содержание ICS-130
Страница 2: ...DOC E10523 Rev D...
Страница 45: ...DOC E10523 Rev D Interactive Circuits And Systems Ltd 2000 41 APPENDICES...