MELabs has sample programs on their website for both PBP and PB.There's one for ShiftIn/ShiftOut with PicBasic.
MELabs has sample programs on their website for both PBP and PB.There's one for ShiftIn/ShiftOut with PicBasic.
Thanks Dave and SKIMASK for your help. Things that may seem obvious once you know they are there are not easy to find without a little help.
I had already looked at shift.bas but wast not sure if shiftout was the correct method to start with.
Will there be much of an overhead using the shift.bas Shiftout function over the SHIFTOUT function in PBP?
I've never tried to compare them in this way but my guess would be that PBP is slightly more efficient. However, this is a pretty simple operation so I doubt there's a huge difference. The real question is whether it, along with your other code, fits in the memory available.
I'd be willing to bet that the compiled SHIFTOUT command looks very similar to the shift.bas program, from a functional standpoint anyways (probably won't have the same labels, jumps, etc., but the flow would be almost identical).
As far as overhead goes, yes, there's overhead. 'cause when you're doing the shiftout, that's all your doing, is shifting out. You can't do anything else (unless you've got interrupts going for you).
I've managed to get the shift.bas working with the PIC16F84A sending a binary count to a 74HC4094 Shift register.
I've had to do this with five wires: Ground, Vcc(5V), Strobe, Clock and Data. I have set the Output Enable permanetly on so I do not need it wired.
It is a shame I need so many wires but there we go, I only needed three wires to make two pics communicate.
I have placed LEDs on the Shift register's Parallel out pins along with a current limiting 680R resistor on each pin.
I am intending to create a chain of 30 or more shift registers so don't want to loose too much power over the whole chain.
I am not too hot on the electical side of this so for me this will be trial and error. I can't really say exactly what I am trying to make except to say it will have a lot of LEDs on a chain of shift registers, all spaced about an inch apart and wired together, i.e. not on the same PCB. So there is a lot of room for leakage and noise etc.
Is it a good idea to use the Resistors or should I look for a register/LED combination that draws the least power per LED?
Also it would make it easier to build if I didn't need the 210+ resistors.
Any suggestions would be appreciated.
Thanks.
Since your LEDs are individually controllable, you're probably going to need one resistor per LED, unless you find LEDs with resistors built in. If you don't, you might end up burning up '4094's over time. Maybe there's another version of the '4094' out there that can handle the current your LEDs require.
Bookmarks