A lot of you are familiar with the method of using a shift register to multiplex a matrix of LED's.
My college project this year was to make a Connect4 game consisting of a 7x6 matrix of LED's.
I had two choices for implementing the display: 1) Use two pins from the microcontroller 2) Use one pin from the microcontroller
The technique of using two pins would be something like as follows:
1) Reset the shift register to all zeroes Loop: 2) Set the data input high 3) Clock the shift register 4) Set the data input low 5) Clock the shift register 7 times goto Loop;The method of using one pin would be implemented by feeding the microcontroller pin into a 3-Bit binary counter which feeds into a 3- to-8 decoder.
I've been warned against using the one-pin method, people telling me that I could lose sync if "a bit of static" or "a bit of noise" gets in.
For my own project board, I went with the one-pin method. I left the board on overnight for three nights in a row and I never lost sync (don't ask me how many million times the display flashed). The only way it ever loses sync is if I terminate the connection to the piezo speaker while the piezo speaker is on (this has the effect of clocking the shift register).
So I've two questions:
1) Should we worry about "noise" and "static", or should we rely on the chips doing their job perfectly? Also, does interference only occur on the chip's external pins, or can it occur within the chip itself? If it can occur within the chip then it would seem that microcontrollers are a lost cause... I mean what's the point in writing a program if you can't rely on the microcontroller to execute it reliably?2) What do you think could be causing the shift register to clock when I terminate the connection to the piezo? If I turn the piezo on and off in software then I don't have the same problem, it only occurs if I physically sever the connection, and it only happens when the piezo is on. Someone suggested putting a capacitor in parallel with the piezo but I'd like to understand what this would do.