Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

What would be faster? SHIFTOUT or Soft SPI ?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
acjacques

Bascom Member



Joined: 24 Feb 2019
Posts: 10
Location: Rio de Janeiro

brazil.gif
PostPosted: Sun Jun 16, 2019 1:34 am    Post subject: What would be faster? SHIFTOUT or Soft SPI ? Reply with quote

What would be faster? SHIFTOUT/SHIFTIN or Software SPI ?

Processor is AtMega 328P @ 16Mhz

(BASCOM-AVR version : 2.0.8.1 )
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1111
Location: SYDNEY

australia.gif
PostPosted: Sun Jun 16, 2019 7:09 am    Post subject: Reply with quote

What do you want to drive with this?
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 1690

blank.gif
PostPosted: Sun Jun 16, 2019 8:23 am    Post subject: Reply with quote

Hard-SPI with its SCK of fOsc/2 is faster, likely there won't be a difference between the Soft-versions.
Overall speed is a function of serial IO and code to fetch or store corresponding data, while the latter can take up multiple times of the transfer. SPI still has advantages, as the integrated SPI unit does rx/tx on its own, while user code can do other stuff in the meantime.
At fastest pace with Hard-SPI one byte takes 16 cpu clocks, If storing of data takes for example 100 cpu cycles, overall speed is rather slow.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum