??? 08/28/07 10:36 Read: times |
#143692 - just formatted your code Responding to: ???'s previous message |
Henrico Hermawan said:
MOTOR_KON: CLR c MOV A,#00H MOV R0,#00H MOV R1,#00H MOV R2,#00H MOV R3,#00H MOV R4,#00H MOV R5,#00H MOV R6,#00H MOV R7,#80H MOV B,#00H SETB P3.2 mov tmod,#11h mov ie,#09h setb ea SETB IT0 mov detik,#00h MOV kal,#0B3H MOTOR_KONT1: MOV P2,KAL JMP MOTOR_KONT1 ;================================================================ ; INTERRUPT ;================================================================ SENSOR_KONT: push 01 push 07 push acc push detik push 00 push cek_angka PUSH KAL PUSH 05 CLR TR1 CLR C MOV TH1,#HIGH(-10000) MOV TL1,#LOW(-10000) SETB TR1 MOV R7,#80H MOV A,DETIK MOV R1,#59H SUBB A,@R1 JC COMPAR MOV A,kal INC A cjne a,#0e4h,lanj pop 01 pop 07 pop acc pop detik pop 00 pop cek_angka POP KAL ret lanj: MOV kal,A pop 01 pop 07 pop acc pop detik POP KAL pop 00 pop cek_angka RET COMPAR: MOV A,kal DEC A CJNE A,#081H,LANJ2 pop 01 pop 07 pop acc pop detik pop 00 pop cek_angka POP KAL RET LANJ2: MOV kal,A pop 01 pop 07 pop acc pop detik pop 00 pop cek_angka POP KAL RET EXIT: RET ;=============================================================== ; INTERRUPT TIMER ;================================================================ TIMER_KON: PUSH 07 push detik INC R7 mov DETIK,r7 CLR TR1 CLR TF1 MOV TH1,#HIGH(-10000) MOV TL1,#LOW(-10000) SETB TR1 pop detik POP 07 RET Please read http://www.8052.com/faqs.phtml?FAQ=120199 and the "noob" document referenced therein, for hints on posting formatted code. JW |
Topic | Author | Date |
Help ME!!! | 01/01/70 00:00 | |
TIMER 2 IN CAPTURE MODE | 01/01/70 00:00 | |
Elaborate | 01/01/70 00:00 | |
help me | 01/01/70 00:00 | |
toggle the timer | 01/01/70 00:00 | |
count the timing interval | 01/01/70 00:00 | |
just formatted your code | 01/01/70 00:00 | |
severe errors | 01/01/70 00:00 | |
I think it's too easy!!! | 01/01/70 00:00 | |
only if interval is >>1ms !! | 01/01/70 00:00 | |
no it's not necessary!!! | 01/01/70 00:00 | |
sorry, You are right![]() | 01/01/70 00:00 |