Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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...
 
Please post a diagram, then we can see whats wrong.
 
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top