10-11-2006 06:37 AM
10-12-2006 05:59 AM
Hi,
for 16 bit, it should be a case of writing / reading 8 bits twice so using the array of data itself..
You may need to re-order the either the bit order, or the byte order to match you device though. You can split and join two 8 bit numbers from/to a 16 bit one using the inbuilt vi's on the data manipulation palette.
For the AD7904 I believe the MSB is the first one in the stream, so you may need to re-order the data to match correctly and since the AD7904 is only actually expecting 12 bits of data, but requires 16 clocks, then you need to make sure you've pushed the data to the correct end of the two 8 bit numbers.
The timing performing this however might not match to the AD7904 if it introduces a SCLK setup time delay in between each byte (hence an array of them shouldn't generate the delay).
Have a look at the shipping Atmel AT25080A Read.vi (and the matching write one) under the example finder - search for SPI.
You should find that there's a 16 bit number split into 2 8 bits for transmission before going into a build array with the 0x3 read command on the front.
Hope that helps
Thanks
Sacha Emery
National Instruments (UK)