Sandy Pal
Newbie level 2
Hi,
In my program, I'm using Register R2 & R3 around Timer0 (in timer mode), like shown below...
The above code rolls-over timer0 200 times (10 * 20 times by R2 & R3).
Suppose, I assign P0.1 & P0.2 (which are set high) for increasing the above delay, P0.1 for R2 & P0.2 for R3, and arrange two switches which can connect P0.1 & P0.2 to Ground when pressed, is there any way to change the values in R2 & R3 during running application?:?:
i.e. if Switch1 is pressed, increment R2, ifSwitch2 is pressed, increment R3. The values, if changed during running application, should be restored even after Power is switched Off/On.
Can someone suggest some code for this?:idea:
Thanks.
Sandy
In my program, I'm using Register R2 & R3 around Timer0 (in timer mode), like shown below...
Code:
Delay1: MOV R2, #10h ;
repeat: MOV R3, #20h ;
back: MOV TL0, #10H ;
MOV TH0, #20H ;
CLR TF0 ; clear flag
SETB TR0 ; start timer
JNB TF0, $ ; stay here till flag is raised
CLR TR0 ;
DJNZ R3, back ;
DJNZ R2, repeat ; Roll-over Timer0, till R2 & R3 =0
RET ;
The above code rolls-over timer0 200 times (10 * 20 times by R2 & R3).
Suppose, I assign P0.1 & P0.2 (which are set high) for increasing the above delay, P0.1 for R2 & P0.2 for R3, and arrange two switches which can connect P0.1 & P0.2 to Ground when pressed, is there any way to change the values in R2 & R3 during running application?:?:
i.e. if Switch1 is pressed, increment R2, ifSwitch2 is pressed, increment R3. The values, if changed during running application, should be restored even after Power is switched Off/On.
Can someone suggest some code for this?:idea:
Thanks.
Sandy