| ??? 03/25/03 04:42 Read: times |
#42185 - Delay with RTC |
I have a RTC running as the main loop,displaying the time in hr:mi:s in an
LCD.Now I want to use this RTC minutes for a time delayed triggering of a remote control.The delay is for a minute or so ,no need to be accurate.When P1.2 is pulled down momenterly the RC command no:1 should execute and after the minute delay Rc command no:2 should execute ,this is the purpose So in the main time loop I have added this lines for triggering the RC. JNB P1.2,SET_REM SET_REM: JNB P1.2,SET_REM LJMP IR_SEND IR_SEND: PUSH ACC SETB IR_FLG ; a flag is set for main loop for checking ACALL REM_COM1;IR command 1 MOV r0,#2Dh ; Minute store location MOV A,MINS ; MINS is the reg where the minutes are recived from the RTC INC A ; For a minute delay MOV @r0,A POP ACC AJMP COMP; Is the compare code which is added to the main loop COMP: MOV A,MINS MOV B,@r0 CJNE A,B,TIME;jmp back to time ACALL REM_COM2;IR command 2 clr IR_FLG AJMP TIME Now my problem is the IR command no: 2 is not being executed after the delay comparison,In the main time loop the line of code JNB IR_FLG,TIME is added to check the P1.2 is activated.The IR command no: is being executed The RTC (which is a DS1307)which is connected through I2C is displayed ok in the LCD and the remote commands are RC5 which is working fine when tested independently Can anyone please help me,Thanks in advance. |
| Topic | Author | Date |
| Delay with RTC | 01/01/70 00:00 | |
RE: Delay with RTC | 01/01/70 00:00 |



