AD7606 8-Ch ADC

Post and discuss new components that you have created.
Post Reply
chipfryer27
Valued Contributor
Posts: 2104
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 469 times
Been thanked: 698 times

AD7606 8-Ch ADC

Post by chipfryer27 »

Hi

Following on from this post viewtopic.php?t=3825

I am exploring the AD7606 16-bit ADC in module form available from usual outlets. This module samples eight analogue channels simultaneously and can output the values either serially or parallel. The module out of the box is configured for serial operation, and to get familiar with it I'm keeping it that way. A worthwhile point to note when in serial mode, you can either pulse out all eight channels sequentially, or by connecting in an additional pin, pulse channels 1-4 and 5-8 simultaneously thereby halving your read time. It has a theoretical speed of 200Ks/s, but of course for optimum speed you would read parallel. There is no defined speed to clock out the data, pretty much as fast as you can pulse within capabilities.

It is also worth noting that I am using a microcontroller that the module easily outperforms so I won't get anywhere near exploring it fully. I'm using a PIC16F18877 and I have this in my BL0080 Multi-Programmer as it allows me to easily add in other Eblocks to assist in testing, and I can run ICD/Ghost if needed (I did).

The module comes with the usual "Chinglish" instructions and armed with a copy plus of course the manufacturer's datasheet I had high hopes. If this works anywhere near as I hope then it may solve a problem I've been working on.

Following the example connections and cross-referencing with proper datasheet, I held certain pins at logic levels and connected other pins to my microcontroller. In case you didn't read the post I refer to above I am using Eblocks that allow me to easily monitor pin activity using an external logic analyser.

Instructions and datasheet are a little confusing and both even appear to contradict themselves in places so having tried and trusted "tools" to explore with is one less worry.

I created a voltage ladder using some 1K resistors daisy chained across the ADC inputs, connected between +5v and 0v to allow me to check if readings were correct.

I created a chart based on what I thought I needed to do. Nothing elegant just raw actions :)

The datasheet recommends that you issue a reset pulse after powering so in my chart I first set pins to initial values before issuing the reset to ensure the module starts in a known condition. My timings were rather slow with gaps between actions and I also had port pins as "markers", changing state whenever something of interest occurred. My analyser would read these which would help me understand other pin activity.

First run did see me capture some data but I couldn't understand why, as I thought I would be "disabling" activity. However referring frequently to datasheets and changing code to suit, operation became clearer and I could understand what was happening and when/why.

Looking at the data captured on my analyser I expected roughly the same readings each time I ran (signed integers get pulsed out) but on the first few channels I could see the occasional leading "1" which would signify a negative reading. Not good.

Recompiling with ICD enabled I could read that the first four channels were indeed returning nonsense but the remaining ones were as expected. Nothing wrong with my ladder, voltages were confirmed using a multimeter so something else was causing this. Without ICD I would need to perhaps enable a UART or include a display to see values, whereas with it I can see everything as it happens.

According to the module datasheets CA and CB which correspond to CONVST-A and CONVST-B, the pins that start conversions are tied to each other, so only one jumper is required. Their diagram showed CB connected. I moved my jumper (easily coz I mounted the modules :) ) from CB to CA but nothing triggered. I got no readings and the analyser confirmed things were not as they should be.

I then jumpered from my microcontroller to the breadboard and from there to both CA and CB. Success, all eight channels were now returning readings.

As mentioned my chart is raw manipulation of pins using FC and my PIC is only running at 32MHz (plenty good enough for testing) so speed will never approach anything like I want, but that's OK for now. In my test my clock pin goes high for a predefined period and half way through I read my input. With a clock pulse of roughly 2uS I could easily and reliably pulse out the readings. Remember that I am pulsing all eight channels sequentially so I need to pulse in 128 bits (8 x 16) which is time consuming.

I took five readings and documented.

ADC Readings.png
ADC Readings.png (45.13 KiB) Viewed 1785 times

As you can see from the above when compared to the readings taken with my multimeter it seems to be reasonably accurate given my basic test set up.

Below are traces from my analyser

Traces.png
Traces.png (90.53 KiB) Viewed 1785 times

The important sequence is as roughly follows:-

Reset goes low, subsequently Convst is taken low and then high which signals to start sampling. Busy goes High at this point too. We do nothing until Busy returns low indicating sampling complete and this then takes FrstD high indicating first data channel is ready to be read. CS goes low, Convst is taken low to hold, and we pulse in data. After the first channel has been clocked in FrstD returns to low. After all channels have been read CS return to high.

Very basic, very slow and very much a fun way to spend a Sunday. I emphasise that this is very, very rough and ready, purely for me to get it working, and once I explore a bit more I will start to get rid of unnecessary delays etc.

Next test is to connect all channels to a known voltage which should (with luck) give me the same values on all channels, then to connect all channels to a sine wave. That will confirm simultaneous sampling and by increasing frequency I may be able to find limits.

A nice South African is calling so I will return to this later in the week, but I'm pleased it works, I can read it and that it looks perfect for my needs.

Regards

chipfryer27
Valued Contributor
Posts: 2104
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 469 times
Been thanked: 698 times

Re: AD7606 8-Ch ADC

Post by chipfryer27 »

Hi

Just a quick update.

Not had enough time to explore much further but I did connect in DoutB. This then allowed me to read channels 1 and 5, 2 and 6, 3 and 7 finishing with 4 and 8 at the same time thereby reducing time taken to read by approximately 50% (roughly 24mS).

Reading A&B.png
Reading A&B.png (83.82 KiB) Viewed 1740 times

Regards

medelec35
Valued Contributor
Posts: 2402
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 768 times
Been thanked: 828 times

Re: AD7606 8-Ch ADC

Post by medelec35 »

Thanks Iain,
Thanks for sharing that looks great and working well.
Martin

chipfryer27
Valued Contributor
Posts: 2104
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 469 times
Been thanked: 698 times

Re: AD7606 8-Ch ADC

Post by chipfryer27 »

Hi Martin

Hopefully tomorrow I will get a chance to modify one for parallel transfer. Eight pulses to get eight channels of data should speed things up a bit :)

Regards

chipfryer27
Valued Contributor
Posts: 2104
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 469 times
Been thanked: 698 times

Re: AD7606 8-Ch ADC

Post by chipfryer27 »

Hi

Using a PIC EB3 which is an 8-bit PIC running at 40MHz, I connected in an AD7606 set to output parallel data over pins D15..D0.

To capture the data I had a simple loop that would exit after collecting all channels (it is an eight channel simultaneous ADC). I connected D15..D8 to Port A and D7..D0 to Port B with all control etc running on Port C

In my loop I simply captured Port A and placed in an array called HighByte, and captured Port B and placed in an array called LowByte.

I did not use any delays in my loop figuring that the time it takes for each instruction to action would still be nowhere near the ADC limit. The loop simply sets the RD/SLK pin low, reads the two Ports storing the results, then sets RD/SLK pin high. I thought this would be the fastest way to capture in FC.

Once captured and I had exited the loop, I then created a signed integer by combining the two array values (HighByte<<8 + LowByte), displaying on the EB3 Screen.

To connect in, every pin on the module was utilised and it was a tight fit.....

Very pleased with the results. I started a capture when "Busy" went high which starts the sampling. When it returns to low that signifies the sampling is complete. I then pull Chip Select low and pulse out the readings, one pulse per ADC channel. The traces below show that it took 56.78uS to read all eight channels.

I do realise I need a more powerful microcontroller to realise the full potential of the module, but for my initial tests the 8-bit PICs are doing fine :)

AD7606 Parallel.png
AD7606 Parallel.png (85.47 KiB) Viewed 1631 times

Regards

PS....
Forgot to mention that although a different module to the serial mentioned earlier, results were consistent between modules. A 16 / 32 bit PIC would be significantly faster (or similar).

Post Reply