pic driving shift register driving leds

Status
Not open for further replies.

Ashlume

New Member
Hi Guys...
Im realy sorry if this might be a stupid question but im realy struggling to finish a what seems to be fairly simple project. I have to design a theatre headlamp containing leds. A footswitch should then increment the amount of leds ON when pushed. I used a pic16f627 to clock a 74164 shift register with highs. It doesnt wana work though. Firstly the leds dont remain on and secondly the leds increment in a weird order. I desperately need help. Thank and God bless
Ash...
 
Not enough info.
Please post your schematic and code.
Please put code inside code tags as in
[ CODE ]
your code
[ / CODE ]
but without the spaces.
 
Hi,

Well, seems pretty simple to me. The 164 only has 8 outputs, so all you need is 8 numbers. If you wish to have a 'bargraph' type look, with each LED turning on in turn, with the LED's behind it staying on, then the 8 numbers would be (2^t-1). Eg, 1,3,7,15,31,63,127,255.

That is, if you're using a PIC simply to send bytes to the shift register. You'll also need a little serial routine generating the clock and data lines. You might not even need a PIC, its a bit overkill, but that just makes the job easier (software debugging is easier than hardware debugging). I would reset the shift register on power up, as the registers can have a random state when initially powered, and since it doesn't have a buffer, it'll be displayed on the output.

I would advise you use the 74HC595, as this has an output register, so the 8 outputs from the SR only change when you make the strobe line on it low->high. The 164 simply has the state of each register connected to its output pins, it'll still work though.

Have you rifled through the datasheet for the 164? The pin's aren't in order, they're split either side on the chip, with 4 outputs on one side and 4 on the other. Also, from memory, the outputs go QA to QF.

As the others have said, its difficult to know whats up without a schematic and code. I still say, you probably don't need a PIC, its just another thing to go wrong, try breadboarding just the shift-register and LED's, with a button for the clock.

Blueteeth
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…