Friday, June 13, 2008

The 164 isn't built for controlling LEDs

Latchless shift register
I swapped the 7JE75K shift register I was using in a previous post for a PC74HCT165P (the monome uses a 164 too, for detecting button presses). To test it out I linked it to the same set of LEDs. When one of the 'switches' was closed, the corresponding LED should light up.

Once I got this working I noticed that whenever I had any LEDs th were on, the LEDs that supposed to be off were also glowing faintly (see image). It turns out that this is a side effect of the PC74HCT164P having no latch pin. When it shifts data from one slot to the next, that data is also immediately sent to the output pins. A latch, like the one the 7JE75K has, makes it possible to shuffle the bits around in the register in 'secret' and when they're ready, they're 'revealed' to the output pins all at once. So with the 165, when one bit in the register is high, it very briefly activates each of it's output pins as that bit gets shifted. When this happens many times a second it looks like the LEDs are faintly glowing.

Of course the 164 doesn't actually control LEDs in the monome. So this isn't a problem.

No comments: