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 Performance issues


Best Answer Chris Walker , 16 July 2015 - 02:37 AM

Hi Sukasa,

What speed is the processor on your board? The SPI clock speed is a "/2, /4, /8, /16, /32" (i.e. /(2^x)) clock speed...so unless you're running at 80MHz or 160MHz you'll get a lower speed than 10mbps. [somewhere between 5mbps and 10mbps).

Each transaction should happen at the speed specified by that device's SPI Config.

Do you have a logic analyzer that you can use to see the wire traffic?

Chris Go to the full post


  • Please log in to reply
3 replies to this topic

#1 Sukasa

Sukasa

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationNanaimo, BC

Posted 16 July 2015 - 02:34 AM

I'm working with a project and trying to write data to an LCD.  It's rated up to 10Mhz speed and I've tried to set this in my code, however I'm getting far, far slower data transfer rates than I should.  Being as the code is rather complex, I'll link the project github page instead of trying to give you a useless look at it.

 

My question is, what could I look at as a way to improve my SPI transfer performance into the LCD?  I use lower-frequency devices on the bus (rated up to 1Mhz), as well as reading from the SD card at several points during the transfer.  Could any of this prevent the 10Mhz transfers from running at 10Mhz?

 

The project code is available at https://github.com/S...Oven-Controller for reference if needed



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 July 2015 - 02:37 AM   Best Answer

Hi Sukasa,

What speed is the processor on your board? The SPI clock speed is a "/2, /4, /8, /16, /32" (i.e. /(2^x)) clock speed...so unless you're running at 80MHz or 160MHz you'll get a lower speed than 10mbps. [somewhere between 5mbps and 10mbps).

Each transaction should happen at the speed specified by that device's SPI Config.

Do you have a logic analyzer that you can use to see the wire traffic?

Chris
  • Sukasa likes this

#3 Sukasa

Sukasa

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationNanaimo, BC

Posted 16 July 2015 - 03:02 AM

I'm on a stock N+2, so 168Mhz if I recall



#4 Sukasa

Sukasa

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationNanaimo, BC

Posted 16 July 2015 - 03:41 AM

Taking what you said into mind I went back and tried using 10600Khz instead of 10000 just for fun.

 

It worked beautifully. Doubled the transfer speed and now my project is far, far more responsive.  Thanks!






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.