Performing counter increment

Thread Starter

RG23

Joined Dec 6, 2010
304
main:

movlw 0x00
movwf count1

/////1 second routine

incf count1
movf count1,0
call bcd
return


bcd:////////////////bcd to ASCII conversion routine
movwf TMP5
swapf TMP5,0
andlw 0x0F
addlw 0x06
btfss STATUS,DC
goto lessnine3
addlw 0x31
goto digit3

lessnine3:
addlw 0x2A

digit3:
movwf PORTD
call SND_DTA
movf TMP5,0
andlw 0x0F
addlw 0x06
btfss STATUS,DC
goto lessnine4
addlw 0x31
goto digit4

lessnine4:
addlw 0x2A
digit4:
movwf PORTD
call SND_DTA
return
 

Thread Starter

RG23

Joined Dec 6, 2010
304
Above is part of code I am working on

I need to increment count1 every second and display on lcd

It gets incremented from 0 to 9 properly but after 9 I get A,B,C..........

I want 10 after 9

If anyone has an idea please let me know
 
Top