Hi,
I am using the ADS8330 ADC connected to an AVR microcontroller via SPI bus. (Bus Clock so far 2 MHz, to be increased maybe later).
I have set the ADC to interal clock, manual trigger, and manual channel select, Pin 10 has INT function and is active low. Tag mode is disabled.
The following sequence is used to read out the ADC values:
1. ADC_Init() -> perform ADC reset (via CFR), set CFR to default, configure CFR as described above
2. Reading out ADC Value by:
a) first writing the command to select which channel to read (CH0 or CH1)
b) then i set the CONVST pin low
c) then i wait until INT pin is pulled low by the ADC or a timeout (of 10 milliseconds) occured
d) afterwards i set CONVST pin high
e) and read out the ADC value by simply sending 0x0D00 (read data command) over the SPI and in the same time reading the 16bit received from the ADC
(of course CS is pulled low every time SPI data is transferred)
The problem is: for every second readout the INT pin of the ADC isn't pulled low, which means to me that there hasn't been any conversion and my routine fails with a timeout. (The only thing happening to the ADC between every second readout is therefore only the channel select command and the CONVST pin which is pulled low for about 1 ms. I've also tried it without the channel select command, with the same result).
For now i have implemented a dummy read such that i can easily interface the ADC, but that can't be the solution and furthermore it steals me time.
What could be wrong?
In manual mode: do I have to select the input channel every time before performing a sample or is this only necessary once and for the rest of the time the mux is switched to this channel and all the following samples origin from the lastly selected channel?
Is this the same for the auto trigger mode? Once at the beginning you select/switch the channel and then all the samples are from the same channel?
Furthermore I do have a question regarding the auto mode (auto trigger):
Unfortunately my microcontroller is a bit too slow to be able to read out a sample with a rate of around 1MHz.
What happens if data is available and it takes me too long to read it out such that the ADC would've sampled already the next sample. Is the sample being overwritten or does the ADC halt the conversion until the last sampled value is transferred over SPI?
Thank you very much for your help in advance!
Best regards,
Fabian
PS: If there could be some useful (example) code for the ADS8330 around I would be grateful if you could provide me with this...