AT91SAM7S64 SPI question

Hi, I'm trying to read data from a Maxim MAX1231 ADC (slave) with the AT91SAM7S64 (master).

Problem: The Maxim chip buffers the data from it's acquisition in a FIFO. It sends the data out Dout (MISO) a byte at a time triggered on (I believe) the chip selects (NPS0 is the particular SPI chip select I'm using).

I don't know how to do this since the AT91SAM7S64 SPI expects to receive data in on MISO during it's transmission on MOSI. I'm using the conversion command to trigger the acquistion on the ADC, i.e. "clock mode 10".

So, I need to use PDC right? That is, AT91F_SPI_ReceiveFrame()? Can AT91F_SPI_ReceiveFrame() be used without using AT91F_SPI_SendFrame()? I would think so. Does the PDC process use the configured chip select to receive data (AT91SAM7S64 SPI is configured for 8-bits packets) on MISO?

Thanks for any help, I'm a newbie feeling like I'm in over my head. Next I've got to tackle USB to offload the data from my board (CDC class mode to a Linux board).

Regards, Victor

Reply to
to.vic.man
Loading thread data ...

Hello Victor,

Read that Maxim data sheet carefully, then read it again.

The SPI master will provide the SCK, even if the MAX1231 is using internal ADC timing. The master will clock out data on MOSI as it clocks it in on MISO. The MAX 1231 command is word won't do anyhting if its all zeros (data sheet pages 13 and 14).

So if you set your data out to all zeros when you just want to read the MAX1231 set up won't change.

(I've never used this chip so take care - maybe read that data sheet again.)

Good luck - but don't ask me about the USB :-)

Michael Kellett

formatting link

Reply to
MK

Reply to
to.vic.man

Hi, Just a follow-up to say sending the 'do-nothing' command from the uC to the ADC allowed me to pull the data out a byte at a time. I had some intermittant wire-wrap issues that caused me fits, and that's why it didn't work at first. I doubted my code and kept changing it. Thanks again for the help, Vic

Reply to
to.vic.man

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.