;----------------------------------------------------------------------------------------; ; THIS PROGRAM GENERATES TWO FREQUENCIES SIMULTANEOUSLY ; ; P1.0 = 50 HZ , P1.1 = 25 HZ ; ;----------------------------------------------------------------------------------------; ;This code is written by Mubashar Yasin(Islamabad,Pakistan).It is freely distributable ; ;however please distribute it with my name and if you add this code to your website or ; ;some other publication then mention about me along with this code.I have tested this ; ;code to work properly even then there is no guarantee or warranty and i cannot be held ; ;responsible for any damage or loss due to this code.If you have any querries about this ; ;code please contact me at: ; ; ; ; kool_projects@yahoo.com ; ; mubasharpk09@hotmail.com ; ; ; ;or visit my website: ; ; ; ; http://www.geocities.com/kool_projects ; ;----------------------------------------------------------------------------------------; COUNT EQU -200 ORG 0000H LJMP MAIN ORG 000BH LJMP TMR0_ISR ;;;;;;;;;;;;;;;;; TMR0_ISR: ;;;;;;;;;;;;;;;;; CLR TF0 CPL P1.2 INC R0 INC R1 CJNE R0,#50,NEXT ;50 HZ AT P1.0 MOV R0,#0H CPL P1.0 ;TOGGLE P1.0 ;;;;;;;;;; NEXT: CJNE R1,#100,EXIT ;25 HZ AT P1.1 MOV R1,#0H CPL P1.1 ;TOGGLE P1.1 ;;;;;;;;;; EXIT: RETI ;;;;;;;;;;;;;;;;; TMR0_INIT: ;;;;;;;;;;;;;;;;; CLR TR0 MOV TMOD,#02H ;MODE2 8-BIT AUTO RELOAD MOV TH0,#COUNT SETB TR0 ;START TIMER RET ;;;;;;;;;;;;;;;;; MAIN: ;;;;;;;;;;;;;;;;; SETB EA ;GLOBAL INTR ENABLE SETB ET0 ;TIMER0 INTR ENABLE MOV R0,#0H MOV R1,#0H LCALL TMR0_INIT SJMP $ END