| ??? 05/16/03 20:16 Read: times |
#45694 - For Erik Malund Responding to: ???'s previous message |
ok,
erik malud you think that i come on forum just to do jokes ..i think you have no idea what kind of condition iam in these days ...deisgning software for pulse dialing.. 1) example No.1 LED Blinking Code: Logic Low = LED ON Logic high = LED OFF Led is connected at P1.0 with 330 Ohms Register. Using 12 Mhz Crystal , you did don't mentioned how should LED blink...so here is a rough code:- ORG OOH SJMP MAIN ORG 030H ;skipping the intreuppt vector address MAIN: CLR P1.0 ;LED GOES ON CALL DELAY SETB P1.0 CALL DELAY SJMP MAIN ; Delay works on nested loop concept, 250 x200 x 5 = 250000 micro-seconds delay On and for the same time off. DELAY: MOV R0,#5D L2: MOV R1,#200D L1: MOV R2,#250D DJNZ R2,$ DJNZ R1,L1 DJNZ R0,L2 RET END 2) Example No.2 Running Light thing which you might have seen in the famous Knight Rider Car Tv program. ; 8 leds connected from p1.0 to p1.7 with 330 ohms ; now firstly leds will run from left to right and then right to left. ; using the same delay as above of if you say i will change it. ORG 00H JMP MAIN ORG 030H MAIN: MOV A,#11111110B AGAIN: MOV P1,A RL A CALL DELAY CJNE A,#01111111B,AGAIN AGAIN2: MOV P1,A RR A CALL DELAY CJNE A,#11111110B,AGAIN2 SJMP AGAIN DELAY: MOV R0,#5D L2: MOV R1,#200D L1: MOV R2,#250D DJNZ R2,$ DJNZ R1,L1 DJNZ R0,L2 RET END 3) You were asking for one led blink...here is the program for blink 7 leds at a time:- ORG 00H JMP MAIN ORG 030H MAIN: MOV A,#00000000B ; ALL LEDS ON DATA AGAIN: MOV P1,A ; 8 LEDS GOES ON CPL A CALL DELAY SJMP AGAIN DELAY: MOV R0,#5D L2: MOV R1,#200D L1: MOV R2,#250D DJNZ R2,$ DJNZ R1,L1 DJNZ R0,L2 RET END USING INTERRUPTS BLINKING ONE LED AFTER 50N MICRO-SECONDS:- ORG 00H LJMP MAIN ORG 000BH ; TIMER 0 VECTOR ADDRESS LED: CPL P1.0 RETI ORG 030H MAIN: MOV TMOD,#02H ; TIMER 0 RELOAD MODE MOV TH0,#-50D ; 50 MICRO-SECONDS DELAY SETB TR0 MOV IE,#82H ; ENABLE TIMER 0 INTERRUPT SJMP $ END what else i have to do to prove that iam a hard working guy and this pulse dialing is really getting on my head |



