28X1 / CD4511 / 4-digit 7 segment LED [Hi everybody]

chris7382

New Member
I want to build a DVM based on a 28X1, a CD4511-7 segment/decoder/deriver and a 4 digit 7 segment LED display
The W1 variable contain the future adjusted ADC result, but for now I simulate with the fixed integer '4321' value
The 'DIG' function split the decimal digit and send it to the counting system as the digit ADDR.
Here the soft :

' -B- Port use
w1 = 4321
Routine:
b4 = w1 DIG 3 ' now b4 = 4
b4 = 128 + b4 ' 128= LSD : Most Signifiant Digit
outpins = b4
b5 = w1 DIG 2 ' now b4 = 3
b5 = 64 + b5 ' 64= 2d LSD
outpins = b5
b6 = w1 DIG 1 ' now b4 = 2
b6 = 32 + b6 ' 32= 3d LSD
outpins = b6
b7 = w1 DIG 0 ' now b4 = 1
b7 = 16 + b7 ' 16= Least Signifiant Digit
outpins = b7
inc w1
goto Routine

Strangely, nothing run as I want. The display lit, but never it increment by 1
I'm really in trouble... I swear I only drink coffee !
Many thanks
 

ZOR

Senior Member
Hi Everybody will get ignored by some, as it should be a title for what your trying to do. Also when putting up code you should use tags, as in Getting Started. It then helps others in the future trying to do the same as you are when searching on a title description.

If you add any PICAXE BASIC program code to your post, please enclose it within
Code:
tags e.g.
Code:
high 1
pause 1000
low 1
Hope you get helped, regards
 

hippy

Ex-Staff (retired)
What does the display show ? The code simulates correctly so, if not working on real hardware, that suggests the chip is resetting before it increments and repeats the loop. There may be a hardware short or the power supply collapsing when some value is output.

You may have to also rewrite the code so you don't change the digit strobe out at the same time as the data in order to avoid timing issues ...

Code:
b4 = w1 DIG 3 ' now b4 = 4
outpins = b4
outpins = b4 + 128
outpins = b4
b5 = w1 DIG 2 ' now b4 = 3
outpins = b5
outpins = b5 + 64
outpins = b5
[i]etc[/i]
 
Top