As part of my steep (but fun!) learning curve into electronics, I've tried to implement Westies 3x7 segment LED tutorial using a 4-digit 7-segment LED, but it's not working. The LEDS are flashing 3-digits at once and sometimes 4. The characters being flashed are mostly not numbers, just C's, P's & E's and other odd characters, sometimes just the decimal point. The hardware and code is as verbatim as I can make it. On the hardware side, I have added a 5v regulator to bring my incoming 2 x 3.6v Li-ion supply down to 5v. I'm using an 18m2 chip and a 4-digit common cathode LED from Sparkfun (datasheet here). I've tried all the segments using a battery and resistor and they all check out as per the pin diagram in the datasheet.
On the software side I'm using the code "Three 74HC595 driver code2 - suit 08M.bas" as is (noting the reserved "Shiftout" syntax), but with port B.1 for Latch, B.2 for Sclk and B.3 for SerIn. I can see the code works in debug mode.
There are also a few things about the code that baffle me, despite the well-commented lines (thank you , please keep us newbies in mind!). For example, the values in the lookup table - are they hex? When I Google hex to ASCII they don't come up as numbers at all. Also, how does the command "digout=digout OR $80" turn the decimal point on? (in my mind I'm reading "digout=itself or some hex number..." Same with the mask command "mask=digout & $80" - how does this mask out the leading zero (I presume?)?. Any help to get past my brick wall would be greatly appreciated! Thanks, RayB
PS Thanks to all who have given generously of their time on this forum. I can't begin to tell you how much I've learnt and greatly appreciate it!
On the software side I'm using the code "Three 74HC595 driver code2 - suit 08M.bas" as is (noting the reserved "Shiftout" syntax), but with port B.1 for Latch, B.2 for Sclk and B.3 for SerIn. I can see the code works in debug mode.
There are also a few things about the code that baffle me, despite the well-commented lines (thank you , please keep us newbies in mind!). For example, the values in the lookup table - are they hex? When I Google hex to ASCII they don't come up as numbers at all. Also, how does the command "digout=digout OR $80" turn the decimal point on? (in my mind I'm reading "digout=itself or some hex number..." Same with the mask command "mask=digout & $80" - how does this mask out the leading zero (I presume?)?. Any help to get past my brick wall would be greatly appreciated! Thanks, RayB
PS Thanks to all who have given generously of their time on this forum. I can't begin to tell you how much I've learnt and greatly appreciate it!
Attachments
-
89.9 KB Views: 43
-
75.9 KB Views: 35