How to Read MISO Data

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

How to Read MISO Data

1,209 Views
caden013
Contributor III

Hi all,

I am using an external ADC (EVAL-AD7984-PMDZ) with my NXP board (LPC55S06-EVK) via the PMOD connector (J18). I have been trying, for a while now, to use the SPI protocol to pass data from my EVAL board to the microcontroller but to no avail. 

The ADC does not have any registers on-board -- data just freely flows out (but to where?). I have initialized the master and slave settings in my code, but I am just confused as to where the ADC data goes and how to read it.

I have attached screenshots of the relevant information below:

 

caden013_0-1623789812999.png

EVAL-AD7984-PMDZ

 

caden013_6-1623790034012.png

 

 

caden013_3-1623789885870.png

 

caden013_4-1623789927569.png

 

caden013_5-1623789963561.png

LPC5SS06-EVK board

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

1,198 Views
frank_m
Senior Contributor III

SPI is a synchronous protocol, which you could basically envisage as shift registers.

The clock signal from the master shifts MOSI data out (master-out-slave-in), and MISO data in (master-in-slave-out) at the same time. The signal names apply from the master's view.

Since the ADC has no internal SPI-accessible register (and thus no real read implemented), it will probably return ADC results immediately.

But as mentioned in another thread of yours, I am not sure if the LPC55S06 supports 18 bit transfers for the SPI peripheral. On a superficial glance, this MCU does not support it directly, and you would need to find a workaround. Check chapter 35 of the user manual (UM11424).

0 Kudos

1,191 Views
caden013
Contributor III

"There are no registers internal to the PulSAR ADC's, so there is no need for a data input line, the data just streams out using the CNVST pin" (from Analog Device's website).

If this external ADC does not accept any MOSI data, where does the MISO data go. How do I read it?

 

"Since the ADC has no internal SPI-accessible register (and thus no real read implemented), it will probably return ADC results immediately."

So how do I output these values? I want to use the printf function to output these values onto the screen. 

 

"Check chapter 35 of the user manual (UM11424)."

I will look into this.

0 Kudos

1,182 Views
frank_m
Senior Contributor III

As said, SPI is synchronous and full duplex. In your case, you would need to send dummy data. Actual content would not matter.

> So how do I output these values? I want to use the printf function to output these values onto the screen. 

You would get the ADC results via a SPI transfer. Consult the SDK code for ways to access SPI on your MCU.

However, check the ADC datasheet on how to start the conversion, and the sampling/conversion times. You might need to consider this timing requirements for your solution.

For "printing onto the screen", just enable the semihosting feature of the IDE, and use printf.  But keep in mind that the semihosting output rate is limited.

And, I think the SPI transfer size of 18 bit for this ADC is still a question to solve.