Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // VERSION : 0.1.0 : blinking blue led
- #include <18F4550.h>
- // https://www.ccsinfo.com/forum/viewtopic.php?t=24618
- #FUSES NOWDT //No Watch Dog Timer
- #FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
- #FUSES XTPLL //Speed Osc 4mhz
- #FUSES NOPROTECT //Code not protected from reading
- #FUSES BROWNOUT_NOSL //Brownout enabled during operation,
- disabled during SLEEP
- #FUSES BROWNOUT //Reset when brownout detected
- #FUSES BORV20 //Brownout reset at 2.0V
- #FUSES PUT //Power Up Timer
- #FUSES NOCPD //No EE protection
- #FUSES STVREN //Stack full/underflow will cause reset
- #FUSES NODEBUG //No Debug mode for ICD
- #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18)
- used for I/O
- #FUSES NOWRT //Program memory not write protected
- #FUSES NOWRTD //Data EEPROM not write protected
- #FUSES IESO //Internal External Switch Over mode enabled
- #FUSES FCMEN //Fail-safe clock monitor enabled
- #FUSES PBADEN //PORTB pins are configured as analog input channels on
- RESET
- #FUSES NOWRTC //configuration not registers write protected
- #FUSES NOWRTB //Boot block not write protected
- #FUSES NOEBTR //Memory not protected from table reads
- #FUSES NOEBTRB //Boot block not protected from table reads
- #FUSES NOCPB //No Boot Block code protection
- #FUSES MCLR //Master Clear pin enabled
- #FUSES LPT1OSC //Timer1 configured for low-power operation
- #FUSES NOXINST //Extended set extension and Indexed Addressing
- mode disabled (Legacy mode)
- #FUSES PLL1 //No PLL PreScaler
- #use delay(clock=4000000)
- void main()
- {
- setup_adc_ports(NO_ANALOGS|VSS_VDD);
- setup_adc(ADC_OFF);
- setup_psp(PSP_DISABLED);
- setup_spi(FALSE);
- setup_wdt(WDT_OFF);
- setup_timer_0(RTCC_INTERNAL);
- setup_timer_1(T1_DISABLED);
- setup_timer_2(T2_DISABLED,0,1);
- setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
- setup_comparator(NC_NC_NC_NC);
- setup_vref(VREF_LOW|-2);
- setup_low_volt_detect(FALSE);
- setup_oscillator(False);
- while (TRUE)
- {
- output_toggle(PIN_D0);
- delay_ms(2000);
- output_toggle(PIN_D0);
- delay_ms(2000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement