Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SPI Speed with ADC

SPI ADC

  • Please log in to reply
1 reply to this topic

#1 lb7000

lb7000

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 May 2013 - 08:04 PM

I'm interfacing with an external ADC chip (mcp3002) over SPI and I'm getting about 2000 reads per second with a tight loop.  The ADC chip's sampling rate ranges from 75 ksps to 200 ksps but I can't seem to get anywhere close to that just calling WriteRead in a loop.  Are there any options out there for speeding this up?  

 

Since the chip only does a read every time CS is brought low one thing I was thinking about trying is hooking up a PWM pin to the CS on the chip at a given frequency and then just give WriteRead large buffers to use to send/capture the data.  I'm guessing this probably wouldn't be too reliable assuming the PWM freq isn't exactly in sync with the SPI calls.

 

Any help would be appreciated.



#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 28 May 2013 - 10:12 AM

yes you could speed it up, but not in netmf. you would have to add that to the firmware, in c/c++.

netmf is interpreted and therefore not as fast as c/c++ code.

 

 

that with the pwm is a bad idea, it wount work, and even if, i wouldnt increase any speed.

 

calling the spi write/read often is just not very efficient, it has some overhead.

not even that doesent help you, but ill have to add: writing bigger junks is very fast compared to writing a lot of small ones.







Also tagged with one or more of these keywords: SPI, ADC

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.