Forum Rule: Always post complete source code & details to reproduce any issue!
-
AD7124 code example at maximum speed
I'm sure people have done it, but I did not find a code example to demonstrate using the 24-bit ADC chip AD7124 in its "continuous read" mode at the maximum speed.
Normally the data is read out by first putting the 0x02 data register address into the COMMS register for each read, but in the faster mode you wait for DOUT/RDY* to drop and then just clock out the data only, as if the chip was a dumb output-only ADC.
So in case of interest, here is a Teensy 4 code example that does read out the chip in that mode.
In this case I used another pin, D8 externally connected to D12 (MISO = DOUT/RDY*) to monitor when the RDY line goes low to indicate the reading is ready, because apparently I can't separately access pin 12 with digitalRead() when I am using it for SPI (?)
I confirmed the timing with a logic analyzer to find that the readout rate is, on average, close to 19.2 kHz just as the datasheet says.
The sample-to-sample noise level is not great, but that's the trade-off you have with higher speeds.
https://github.com/jbeale1/DataAcq/b...nuous-read.ino
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules