It all depends on how the hardware is configured. Is the design optimized for minimal code? With out a schematic it's hard to say...
It all depends on how the hardware is configured. Is the design optimized for minimal code? With out a schematic it's hard to say...
Dave Purola,
N8NTA
EN82fn
Well, there is no hardware yetI plan to use PIC16F887. The modules itself have A-B-C-D inputs of CD4543BE connected in paralel, and latch pins are also available on connector.
If you mean hooking up A to PORTC.0, B to PORTC.1, C to PORTC.2 and D to PORTC.3, to be able to directly address them, then yes, I can do that.
Schematic...... Not some wild a** guess... Definitive schematic Please...
Dave Purola,
N8NTA
EN82fn
Schematic of what?
Here is simple counter code I've made. It just counts from 0 to 99. But it is far from perfection.
Code:marcato: tato=0 FOR KAKO=0 TO 99 XAXO=KAKO DIG 0 high latch 'enable write ones low latch2 'disable write tens gosub decoder 'display ones if xaxo=0 and kako dig 1<>0 then 'if count is above 10 low latch 'disable ones high latch2 'enable tens 'tato=tato+1 xaxo=kako dig 1 gosub decoder xaxo=0 endif if xaxo=0 and kako dig 1=0 then 'reset leading 0 low latch high latch2 xaxo=0 gosub decoder endif PAUSE 300 NEXT goto marcato END decoder: IF XAXO=0 THEN GOSUB ZERO IF XAXO=1 THEN GOSUB ONE IF XAXO=2 THEN GOSUB TWO IF XAXO=3 THEN GOSUB THREE IF XAXO=4 THEN GOSUB FOUR IF XAXO=5 THEN GOSUB FIVE IF XAXO=6 THEN GOSUB SIX IF XAXO=7 THEN GOSUB SEVEN IF XAXO=8 THEN GOSUB EIGHT IF XAXO=9 THEN GOSUB NINE return ZERO: LOW A: LOW B: LOW C: LOW D RETURN ONE: HIGH A: LOW B: LOW C: LOW D RETURN TWO: LOW A: HIGH B: LOW C: LOW D RETURN THREE: HIGH A: HIGH B: LOW C: LOW D RETURN FOUR: HIGH C: LOW A: LOW B: LOW D RETURN FIVE: HIGH C: HIGH A: LOW B: LOW D RETURN SIX: HIGH C: HIGH B: LOW A: LOW D RETURN SEVEN: HIGH A: HIGH B: HIGH C: LOW D RETURN EIGHT: HIGH D: LOW A: LOW B: LOW C RETURN NINE: HIGH D: HIGH A: LOW B: LOW C RETURN
Choose a port (A,B, or C). Connect the low 4 pins of the port to carry the number you want to display and connect those to the data pins of the CD4543BE. Then connect the 4 pins of the high byte to the latches. to write "2" to the first digit, send "12" to the port. to write 9 to the second digit send "29" to the port. Write 6 to the 3rd port with "46" and so on.
Bookmarks