This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Which is fastest way to acquire data through SPI in AM335x ?

Other Parts Discussed in Thread: ADS1256

Hi,

I have a ADS1256 ADC which is interfaced through SPI with AM335x based custom board (running linux-3.2). Since ADS1256 has a maximum sampling rate of 30k , it means it can output 30k samples in 1 sec.  But in linux i am able to capture 30k samples in around 3 seconds using ads1256 linux driver.

So is there any faster way to capture ADC data in linux?

regards

Nitesh

 

  • Hi Nitesh,

    You can check to see if the SPI is running at the maximum possible clock rate.

  • Hi Biser,

    According to the ads1256 datasheet the maximum clock frequency is about 1.92 MHz. (t1_min = 4 * 1/fclkin)

    where fclkin = 7.68 MHz. 

    So in board file i have given as follows,

    static struct spi_board_info ads1256_spi_bus_info[] = {
     {
          .modalias = "ads1256",
          .platform_data = &ads1256_data,
          .max_speed_hz = 1920000,
          . chip_select = 0,
          .bus_num = 1,
          .irq = DRDY_GPIO,
     },

    regards

    Nitesh

  • Have you measured with a scope that this is in fact the SPI_SCK clock frequency that comes out?

  • i have' nt  measured it , but whenever i try to change the frequency more then 1.92MHz in board file , then its reading junk values. 

  • I used the SPIDEV driver and configured the clock to 10 MHz and was able to R/W without errors.  The design doesn't run it at this speed though. It was only set to 10 MHz for testing.  In normal operation, the design runs with a 1 MHz clock

  • Hi argeebee,

    i tried with spidev and set the frequency to 10 MHz,and now i am able to capture data fast enough.As you said 10 MHz was used for testing, so does this cause any problem to the device later on??

  • Our hardware doesn't have a rigid time requirement, so we put it at a conservative 1 MHz (for now).  We bumped it up to 10 MHz while debugging because we wanted to capture many SPI transactions within a 1 second window.  We tried 20 MHz and that didn't work as well.  There were errors in the SPI transactions.  The speed also depends on what the other chip is capable of, not just the AM33x.