Hi,
I'm trying to access an AD7176 from an AVR32 microcontroller via SPI. I can read and write registers fine, but my problem is, when I read the converted data, the channels seem to appear in random order.
For example, the DAC gave the following output in continuous conversion mode, with DATA_STAT set:
800f1b02
800f1d02
800e6401
800e4a01
800e3701
8008f800
80091f00
800f2902
8008dd00
80091000
800efb02
8008ff00
[UPDATE: If I interpret the data correctly, the most sig. three bytes represent the converted 24 bit value, and the least significant byte is the status register. This indicates a channel sequence of 2, 2, 1, 1, 1, 0, 0, 2, 0, 0, 2, 0. Which means the data is almost useless for my application.]
This example was read with CS rising between each read operation, but keeping CS low didn't make a difference. Register configuration was:
GPIOCON: 0
ADCMODE: REF_EN only (0x8000)
IFMODE: DATA_STAT | DOUT_RESET (0x0140)
CHMAP0: EN | AINPOS_AIN1 | AINNEG_AIN0 (0x8020)
CHMAP1: EN | AINPOS_AIN2 | AINNEG_AIN0 (0x8040)
CHMAP2: EN | AINPOS_AIN3 | AINNEG_AIN0 (0x8060)
CHMAP3: AINPOS_AIN1 | AINNEG_AIN0 (0x0020)
Any suggestions?
cheers
Hendrik