super_moose
New Member
I have a ds1391 rtc, a 28x2 and a serial lcd. I have a program that can read the time and show it on the lcd but I can't figure out how to set the time with some buttons. I want to have one button to advance the hours and another to advance the minutes.
Can anyone help me with this??
Here is my code it it helps
Thanks for any help.
Can anyone help me with this??
Here is my code it it helps
Code:
hspisetup spimode01, spimedium
main:
low 6 ;seconds
hspiout ($01)
hspiin (b0)
high 6
pause 5
bcdtoascii b0,b1,b2
low 6 ;mins
hspiout ($02)
hspiin (b3)
high 6
pause 5
bcdtoascii b3,b4,b5
low 6 ;hours
hspiout ($03)
hspiin (b6)
high 6
bcdtoascii b6,b7,b8
low 6 ;milliseconds
hspiout ($00)
hspiin (b9)
high 6
bcdtoascii b9,b10,b11
serout 7 ,T9600_8,($FE,$47,3,1) ;set screen to 2 blocks in
serout 7 ,T9600_8,(b7,b8)
serout 7 ,T9600_8,(":")
serout 7 ,T9600_8,(b4,b5)
serout 7 ,T9600_8,(":")
serout 7 ,T9600_8,(b1,b2)
serout 7 ,T9600_8,(":")
serout 7 ,T9600_8,(b10,b11)