I am planning to make a board game where I need to control 42 displays consisting of two 7-segment displays and one RGB-LED. I intend to use three daisy chained 74xx595 shift registers to hold the state of each LED. I am planning to use one pin on the Arduino for a common serial clock, one pin for a common register clock, and an individual pin for a serial input on each of the 42 separate displays.
Q1: I have not worked with shift registers before, is this setup feasible?
Q2: I am trying to compute how fast I can update the displays, but I am not really sure how to do this. I am hoping to have update times < 1sec. is this possible with this setup?
If you think there is a better way to control the displays I would also like to know.
@KenF
I am not going to use the decimal points, so in principle I only need to clock out 7+7+3 = 17 bits for each display.
@AWOL
I am not sure if I understand your point. I need to clock out 17*42 = 714 bits but I do not know at which frequency I can expect to do that? I assume it must be quite a bit lower than the Arduino clock frequency. And of course it will depend on the code I will end up writing.
With SPi at 8 MHz (clock divisor set at 2, twice the default speed), you can send data out at nearly a byte/microsecond.
714 bits = 90 bytes.
Even doing this will be pretty quick:
digitalWrite (ssPin, LOW); // latch to shift registers
for (x=0; x<90; x=x+1){
SPI.transfer(dataArray[x]);
}
digitalWrite (ssPin, HIGH); // outputs change on this rising edge
If you want it really fast, get rid of the for loop and do 90 lines like this:
Thank you for your efforts AWOL and CrossRoads. I am now confident that the setup can work, and I will start gathering all the components. It was a very pleasant first step into the Arduino forum!
Just curious, for what kind of a board game is such speed crucial?
Surely the limiting speed is the human ability to make sense of the data displayed, so we are talking seconds, not us.
I remember an old calculator I had. It would take almost entire second to do a square root of larger numbers. I didn't care.
@Shpaget
The plan is to make a classic risk game, each terretory will have a rgb led to indicate the owner and a display to indicate the size of the army. The board will be a clear acrylic plate with the terretories carved in, when the led's are drilled into the plate this will give a nice effect. the speed is not that crucial, but I would like to make the interactions as smooth as possible.