Page 1 of 1

SPI transmission at regular intervals

Posted: Tue Apr 24, 2012 10:42 pm
by kgysmits
What's the most efficient way to start an SPI transmission at regular intervals, say 10000 3x8bit transactions per second at 1Mbit? Are virtualTimers suitable for this, or are better solutions available?

Re: SPI transmission at regular intervals

Posted: Wed Apr 25, 2012 12:11 am
by Badger
How accurate do you need the timing to be? ie do they need to be perfectly evenly spread out, or is it just the average rate that matters?

At 10Khz you'd have to increase the system tick rate, in which case you would probably be better off using a GPT which uses a hardware timer. you could have a GPT triggering a callback at 10kHz which then calls spiStartSend() without much hassle.

Re: SPI transmission at regular intervals

Posted: Wed Apr 25, 2012 7:43 am
by Giovanni
I agree, the GPT driver looks like a better option in this use case.

Giovanni