Go Down

Topic: Speed of Shiftin command? (Read 554 times) previous topic - next topic

pyrohaz

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,

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

pyrohaz


CrossRoads

You could also do this with SPI.transfer, will be a lot faster:
Code: [Select]

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);
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up