Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $NOMOD51
- $include (C8051F120.h)
- LED BIT P1.6;
- Flag BIT 00h
- CSEG AT 0;
- LJMP MAIN;
- ORG 000Bh;
- AJMP T0_ISR
- ; Peripheral specific initialization functions,
- ; Called from the Init_Device label
- Reset_Sources_Init:
- mov WDTCN, #0DEh
- mov WDTCN, #0ADh
- ret
- Timer_Init:
- mov SFRPAGE, #TIMER01_PAGE
- mov TMOD, #01h;
- ret
- Port_IO_Init:
- mov SFRPAGE, #CONFIG_PAGE
- mov P1MDOUT, #040h
- mov XBR2, #040h
- ret
- Interrupts_Init:
- mov IE, #082h;
- ret
- Init_Device:
- lcall Reset_Sources_Init
- lcall Port_IO_Init
- lcall Timer_Init
- lcall Interrupts_Init
- ret
- T0_ISR:
- CLR TF0;
- DJNZ R0, OUT;
- MOV R0, #06h;
- SETB Flag;
- OUT: RETI;
- MAIN:
- lcall Init_Device;
- CPL LED;
- MOV R0, #06h;
- CLR FLAG;
- SETB TR0;
- LOOP:
- JBC Flag, SKIP;
- SJMP LOOP;
- SKIP:
- CPL LED;
- SJMP LOOP;
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement