Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "C8051F340.h"
- void main(void){
- P2MDOUT = 0x0C; // pullup for LEDs
- P0SKIP = 0xFF; // skip P0
- P1SKIP = 0xFF; // skip P1
- XBR1 = 0x70; //
- OSCICN = 0x83; // Internal H-F clock: SYSCLK=12MHz
- PCA0MD &= 0xBF; //watchdog configure
- PCA0MD = 0x00; //watchdog disable
- // TMOD = 0x10; //TIMER 0, 8bits with auto-reload
- TF2 = 0; //clear flag
- TMR2L = 0x18;
- TMR2H = 0xFC;
- TMR2RLH = 0xFC;
- TMR2RLL = 0x18;
- T2SPLIT = 0;
- TR2 = 1;
- while(1){
- if(TF2){
- TF2 = 0;
- P2_2 =! P2_2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement