| ??? 07/14/03 11:22 Read: times |
#50654 - RE: First Step.......... Responding to: ???'s previous message |
Hi!
I connected the ckt in the following order: START ->STOP->O/L Contacts->K1 relay ......Start..Stop...O/L contact...K1 Relay ......P1.0...P1.1....P1.2.........P2.0 |-----||-----||----||----------( )----| Tried out the program, working OK,Now I like to add - NO contact of K1 for (holding On the relay), another NO contact for remote indication light and one NC contact as a interlock in Auto start. Tried to add in the subroutines the following but it did not work. MOV C,ACC.0 ORL C,p2.0 ANL C,ACC.1 Program: ORG 2000H ;Start assembly at 0000h LJMP MAIN ;Jump to the main routine ORG 001Bh ;This is where Timer 1 Interrupt Routine starts CLR TR1 ;Turn off timer 1 as we reset the value MOV TH1,#0DCH ;Set the high byte ofthe reset value MOV TL1,#0FFH ;Set the low byte of the reset value SETB TR1 ;Restart timer 1 it has been initialized JMP START RETI ;Exit the interrupt routine MAIN: MOV TH1,#0DCH ;Initialize timer high-byte MOV TL1,#0FFH ;Initialize timer low-byte MOV TMOD,#10h ;Set timer 1 to 16-bit mode SETB TR1 ;Start timer 1 running SETB EA ;Initialize interrupts SETB ET1 ;Initialize Timer 1 interrupt MOV P1,#0FFH ;P1 as input port AGAIN:JMP AGAIN ;SUB-ROUTINES START:MOV A,P1 CPL A MOV C,ACC.0 ANL C,ACC.1 ANL C,ACC.2 JNC OVER1 CLR P2.0 JMP OVER OVER1:SETB P2.0 OVER: RETI END |



