Loading...
Pages: [1]   Go Down
Author Topic: Speed of Shiftin command?  (Read 189 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys,

I was just wondering at how long it takes for shiftin to complete one cycle (as in one cycle being the command reading in one byte). I have 20 inputs, therefore needing 3 4021 chips (8*3 > 20).

Realistically, I could do with the shiftin being <10ms so that I can call a shiftin every 10ms.

Also, while shiftin is happening, is the arduino able to do other things?

Cheers,
Logged

Valencia, Spain
Online Online
Edison Member
*
Karma: 65
Posts: 2236
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys,

I was just wondering at how long it takes for shiftin to complete one cycle (as in one cycle being the command reading in one byte). I have 20 inputs, therefore needing 3 4021 chips (8*3 > 20).

Realistically, I could do with the shiftin being <10ms so that I can call a shiftin every 10ms.

No problem. It's probably hundreds of times faster than that.

Also, while shiftin is happening, is the arduino able to do other things?

No.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Perfect answers!

Thanks.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 242
Posts: 16471
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could also do this with SPI.transfer, will be a lot faster:
Code:
digitalWrite(ssPin, LOW);  // if you need CS with the part you are using.  can also direct port manipulation for more speed
incomingByte = SPI.transfer(0); // where 0 is data that will get clocked out on MOSI pin while data is clocked in on MISO pin at the same time.
digitalWrite(ssPin, HIGH);
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Pages: [1]   Go Up
Print
 
Jump to: