You are here

Timed SPI Communication for Controlling Remote ADC Sampling Rate | Cypress Semiconductor

Timed SPI Communication for Controlling Remote ADC Sampling Rate

Summary: 1 Reply, Latest post by alex108 on 01 Feb 2013 05:31 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
user_134344396's picture
56 posts

I need some help determining the best way to interface the PSoC 3 with and SPI capable ADC. The timing of the ADC sampling must be controlled by the SPI Master (PSoC). That is, the rate at which the master request samples determines the ADC sampling rate. Once a convert command is received by the ADC the result is sent back two CS/SS pulses later.


What is the best way to allow the PSoC to control the ADC sampling timing via the SPI interface? Should I setup a timer to execute an ISR to request data, wait for the data, then send data to buffer? I will need the ADC to take 3000 samples at a rate between 40-60 ksps total. Thus at 60 ksps I would need to send "convert" commands every 1/60ksps = 16.6us. Will there be enough time to send the request, wait for the data, and then DMA it to a buffer?


Below is a sample of info from the datasheet. I’ve also attached part of the datasheet.

The RHD2000 ADC samples the selected analog signal on the falling edge of CS.  The CS line must be pulsed high between every 16-bit data transfer, even when the command word does not request an analog-to-digital conversion.  The RHD2000 samples MOSI on the rising edge of SCLK.  The master should sample MISO on the rising edge of SCLK.  (The master device SPI interface should be configured with SPI options CPOL=0 and CPHA=0.) 


After receiving a CONVERT(C) command from the master, the on-chip ADC samples channel “C” on the falling edge of the next CS pulse.  The analog-to-digital conversion is performed during the next 16 SCLK cycles, and the result is relayed to the master over the MISO line during the following 16 SCLK cycles (two total commands later).


The RHD2000 uses a pipelined communication protocol; each command sent over the MOSI line generates a 16-bit result that is transmitted over the MISO line two commands later.  Communication with the chip is illustrated in the following example diagram:



sryp's picture
Cypress Employee
1 post

 At PSoC (master) side, get the data using DMA. Connect DMA to interrupt output pin and in device configuration window select "Interrupt when Rx FIFO not empty".

To generate CS/SS, use ISR which should be triggerd by TRQ output pin of DMA.

In SPI command window, set the bit rate as your application demands..



Log in to post new comments.