im runing this code pic16f628a this is the code for lcd 7 segment with 74hc164,and when i add things like clock or other code it cuz delay and troubles to the lcd routine plz help i want to add my code here conter and clock and some thing else but i want to put them out o0f the lcd 7segment loop or label and dont cuz troubles or delay for lcd routines ...
Code:
@ DEVICE WDT_ON, PWRT_ON,MCLR_ON,CPD_OFF, BOD_OFF, PROTECT_OFF,INTRC_OSC_NOCLKOUT
Include "modedefs.bas"
DEFINE OSC 4
intcon = 0
vrcon = 0
CMCON = 7 '
Hundredths VAR BYTE
Seconds VAR BYTE
Minutes VAR BYTE
Hours VAR BYTE
SDO Var PortB.4
SCLK Var PortB.5
BTM Var PortB.6
BTN VAR PORTB.7
SEG var byte
Digit var byte[4]
index var byte
B0 var word
D0 var byte
PORTA = %00001
PORTB = %11000000
TRISA = %00001
TRISB = %11000000
' im trying to add my code here loop: goto loop, and want the main: label stays workin its for the 7 segment
'and i want to add here clock to ???????and other problem my code has delays of pause 1000 and 2000,..
B0 = 0
loop:
b0 = b0 + 1
if b0 = 9999 then b0 = 0 ' here i will put delays in my code so it willl cuz 'problems to the main code .. delays digit blinkin very slow
GOSUB MAIN
MAIN:
D0 = B0 DIG 0
READ D0,DIGIT[0]
D0 = B0 DIG 1
READ D0,DIGIT[1]
D0 = B0 DIG 2
READ D0,DIGIT[2]
D0 = B0 DIG 3
READ D0,DIGIT[3]
for index = 0 to 3
seg = digit [index]
SHIFTOUT SDO,SCLK,0,[SEG\8]
PORTB.0[index] = 1
PAUSEUS 999
PORTB=0
NEXT INDEX
return
END
data @0,3,159,37,13,153,73,65,31,1,9
Bookmarks