Steve2381
Senior Member
Hi all
Yes... Captain dodgy code is in the room again. Trying to use an 18m2 as a slave driver for some common anode , 4 digit led displays I found in the workshop... and its just not running fast enough.
Ignore the lack of serial input coding yet (although, that is going to slow it even further!)....
It isn't multiplexing fast enough (if that is the right word). The commons of the display are controlled by 4x BC557 transistors via a 1k resistor to base (which may be the problem).
Any advice gratefully received.
Oh, and why doesn't "Let digit1 = RXfig DIG 0" work ? I get an error. Does the 'DIG' statement not work on an 18m2?
Yes... Captain dodgy code is in the room again. Trying to use an 18m2 as a slave driver for some common anode , 4 digit led displays I found in the workshop... and its just not running fast enough.
Ignore the lack of serial input coding yet (although, that is going to slow it even further!)....
Code:
'Common Anode 4x 7 segment display driver. Decoded from serial input - 18m2
setfreq m16
' -- -- -- -- -- -- -- --
'B.0-A | | | | | | | |
'B.1-B
'B.2-C | | | | | | | |
'B.3-D -- -- -- -- -- -- -- --
'B.4-E | | | | | | | |
'B.5-F
'B.6-G | | | | | | | |
' -- -- -- -- -- -- -- --
'C.5 - Colon
'C.1 - Digit 1 +
'C.0 - Digit 2 +
'C.7 - Digit 3 +
'C.6 - Digit 4 +.
Dirsb=%11111111 ;Set pins. 1=Output 0=Input
Dirsc=%11111011
symbol digit1 = b0 'The received number for digit 1 via serial on c.2
symbol digit2 = b1 'The received number for digit 2 via serial on c.2
symbol digit3 = b2 'The received number for digit 3 via serial on c.2
symbol digit4 = b3 'The received number for digit 4 via serial on c.2
symbol serialin = c.2 'Serial input pin
symbol digit1com = c.1 : high digit1com 'Set digit 1 common high (off)
symbol digit2com = c.0 : high digit2com 'Set digit 2 common high (off)
symbol digit3com = c.7 : high digit3com 'Set digit 3 common high (off)
symbol digit4com = c.6 : high digit4com 'Set digit 4 common high (off)
EEPROM 0, (64,121,36,48,25,18,2,120,128,16,127,70,63,14,9,33,71,35,28,55,8,12)
'Character ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ,blank, C , - , F , H , d , L , o, degrees ,=,A,P )
'test number to display
digit1=2
digit2=3
digit3=4
digit4=5
Main:
do
low digit1com
read digit1,pinsb
high digit1com:low digit2com
read digit2,pinsb
high digit2com:low digit3com
read digit3,pinsb
high digit3com:low digit4com
read digit4,pinsb
high digit4com
loop
Any advice gratefully received.
Oh, and why doesn't "Let digit1 = RXfig DIG 0" work ? I get an error. Does the 'DIG' statement not work on an 18m2?