SPI transmission at regular intervals

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
kgysmits
Posts: 20
Joined: Tue May 03, 2011 10:16 am

SPI transmission at regular intervals

Post 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?
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: SPI transmission at regular intervals

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SPI transmission at regular intervals

Post by Giovanni »

I agree, the GPT driver looks like a better option in this use case.

Giovanni
Post Reply