Hello jasm700,
You want to look at the manual sect 4.17.7 it explains how to use the DIG command to get your digit.
Hello jasm700,
You want to look at the manual sect 4.17.7 it explains how to use the DIG command to get your digit.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
ok thanks all my friend i will try your suggetions
This is what i use to drive my 8 digit dual display
Hope it helps.
By adjusting f & f2 you can adjust the brightness...
'REV 071408 * #disdrive9.01 DISPLAY LED DRIVER
DEFINE OSC 20
DEFINE SER2_BITS 8
A VAR BYTE
B VAR BYTE
C VAR BYTE
F VAR BYTE
F2 VAR BYTE
DCP VAR BYTE
AMP VAR WORD
TIME VAR WORD
COUNTA VAR WORD
COUNTB VAR WORD
COUNTC VAR WORD
SNO1 VAR WORD
SNO2 VAR WORD
FLOW7 VAR PORTA.0
DAT7 VAR PORTA.1
SPF10 VAR PORTA.2
BURN VAR PORTA.3
SPF02 VAR PORTA.4
SPF03 VAR PORTA.5
SEGMENT VAR PORTB
DIGIT VAR PORTC
TRISA = %11111111
TRISB = %00000000
TRISC = %00000000
ADCON0 = %00000000
ADCON1 = %00000111
A = 0
C = 0
B = 0
F = 100
F2 = 3
DCP = 0
PAUSE 20
TIME = 1234
AMP = 5678
EEPROM 0,[129,243,73,97,51,37,5,241,1,49,254,253,251,247,239 ,223,191,253]
GOSUB BSEQ
LOOP: ' AND NOW THE MAIN EVENT
IF FLOW7 = 1 THEN
SerIN2 PORTA.1,84,[TIME.highbyte,TIME.lowbyte,AMP.highbyte,AMP.lowbyt e,DCP]
ENDIF
IF DCP = 9 THEN
GOSUB BSEQ
ENDIF
FOR C = 0 TO 4
READ TIME DIG C,SEGMENT
LOOKUP C,[$BF,$7F,$DF,$EF],DIGIT
IF C = 4 THEN
PORTB = %11111110
IF DCP = 1 THEN DIGIT = $EF
IF DCP = 2 THEN DIGIT = $DF
IF DCP = 3 THEN DIGIT = $7F
IF DCP = 4 THEN DIGIT = $BF
ENDIF
PAUSEUS f
PORTB = $FF
PORTC = $FF
PAUSEUS F2
NEXT C
FOR B = 0 TO 4
READ AMP DIG B,SEGMENT
LOOKUP B,[$FE,$FD,$FB,$F7],DIGIT
IF B = 4 THEN
PORTB = %11111110
IF DCP = 5 THEN DIGIT = $FE
IF DCP = 6 THEN DIGIT = $FD
IF DCP = 7 THEN DIGIT = $FB
IF DCP = 8 THEN DIGIT = $F7
ENDIF
PAUSEUS f
PORTB = $FF
PORTC = $FF
PAUSEUS F2
NEXT B
GOTO LOOP
BSEQ: FOR A=0 TO 3
FOR C = 0 TO 6
READ C+11,SEGMENT
LOOKUP A,[$EF,$DF,$7F,$BF],DIGIT
PAUSEUS 1000
PORTB = $FF
PORTC = $FF
PAUSE 10
NEXT C
PAUSE 2
NEXT A
FOR A=0 TO 3
FOR B = 6 TO 0 STEP -1
READ B+11,SEGMENT
LOOKUP A,[$FE,$FD,$FB,$F7],DIGIT
PAUSEUS 1000
PORTB = $FF
PORTC = $FF
PAUSE 10
NEXT B
PAUSE 2
NEXT A
DCP = 1
RETURN
Thanks !
SOMRU
TWE/TFP/EE
Bookmarks