External ADC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

External ADC

616 Views
caden013
Contributor III

Hi all, 

I am wanting to use an external ADC (EVAL-AD7984-PMDZ) on my NXP board (LPC55S06-EVK) via PMOD header (J18). I don't even know where to begin to write code to analyze this external ADC. Is there an example project that I can use? Also, can I just change the ADC initialization settings in my code to access this external one?

Thanks in advance.

Labels (1)
Tags (1)
0 Kudos
3 Replies

590 Views
frank_m
Senior Contributor III

> Also, can I just change the ADC initialization settings in my code to access this external one?

No.

Except for the name (ADC), both are very different devices ...

> I don't even know where to begin to write code to analyze this external ADC. Is there an example project that I can use?

The AD798x is a SPI device, so you would want to start from a SPI example.

Looking at the datasheet, there is no configuration or setup to do, you just need to read the results. 

Start by selecting the operation mode you like (starting at page 17). Make sure your SPI settings like data size, clock polarity, bit order etc. match those in the datasheet, SPI is not tightly defined like e.g. CAN.

0 Kudos

582 Views
caden013
Contributor III

Which of the following SPI examples do I need to use in order to read analog values from my external ADC? Also, what exactly do I need to include in my code to print out the analog values? I believe I have my ADC board hooked up correctly (the wires), but I cannot figure out how to print out these values.

0 Kudos

572 Views
frank_m
Senior Contributor III

I don't have a LPC55S06 eval board, nor the SDK installed, so I cannot comment on which SPI example would be best.

However, one thing you need to check: the AD7984 requires 18 bit transfers. Some MCUs I know only support multiples of 8 as bit transfer sizes, so check the MCU user manual (SPI section) first.

Alternatively, you could use the AD76xx instead, which is 16 bits. Or, try bitbanging or checking out other peripherals to emulate the exact protocol. The AD7984 datasheet (page 18ff) shows you how the protocol is supposed to work.

0 Kudos