Advertisement
RuiViana

Blink Test PIC18F4550

Dec 29th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. // VERSION : 0.1.0 : blinking blue led
  2.  
  3. #include <18F4550.h>
  4. // https://www.ccsinfo.com/forum/viewtopic.php?t=24618
  5.  
  6. #FUSES NOWDT //No Watch Dog Timer
  7. #FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
  8. #FUSES XTPLL //Speed Osc 4mhz
  9. #FUSES NOPROTECT //Code not protected from reading
  10. #FUSES BROWNOUT_NOSL //Brownout enabled during operation,
  11. disabled during SLEEP
  12. #FUSES BROWNOUT //Reset when brownout detected
  13. #FUSES BORV20 //Brownout reset at 2.0V
  14. #FUSES PUT //Power Up Timer
  15. #FUSES NOCPD //No EE protection
  16. #FUSES STVREN //Stack full/underflow will cause reset
  17. #FUSES NODEBUG //No Debug mode for ICD
  18. #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18)
  19. used for I/O
  20. #FUSES NOWRT //Program memory not write protected
  21. #FUSES NOWRTD //Data EEPROM not write protected
  22. #FUSES IESO //Internal External Switch Over mode enabled
  23. #FUSES FCMEN //Fail-safe clock monitor enabled
  24. #FUSES PBADEN //PORTB pins are configured as analog input channels on
  25. RESET
  26. #FUSES NOWRTC //configuration not registers write protected
  27. #FUSES NOWRTB //Boot block not write protected
  28. #FUSES NOEBTR //Memory not protected from table reads
  29. #FUSES NOEBTRB //Boot block not protected from table reads
  30. #FUSES NOCPB //No Boot Block code protection
  31. #FUSES MCLR //Master Clear pin enabled
  32. #FUSES LPT1OSC //Timer1 configured for low-power operation
  33. #FUSES NOXINST //Extended set extension and Indexed Addressing
  34. mode disabled (Legacy mode)
  35. #FUSES PLL1 //No PLL PreScaler
  36.  
  37. #use delay(clock=4000000)
  38.  
  39. void main()
  40. {
  41. setup_adc_ports(NO_ANALOGS|VSS_VDD);
  42. setup_adc(ADC_OFF);
  43. setup_psp(PSP_DISABLED);
  44. setup_spi(FALSE);
  45. setup_wdt(WDT_OFF);
  46. setup_timer_0(RTCC_INTERNAL);
  47. setup_timer_1(T1_DISABLED);
  48. setup_timer_2(T2_DISABLED,0,1);
  49. setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
  50. setup_comparator(NC_NC_NC_NC);
  51. setup_vref(VREF_LOW|-2);
  52. setup_low_volt_detect(FALSE);
  53. setup_oscillator(False);
  54.  
  55. while (TRUE)
  56. {
  57. output_toggle(PIN_D0);
  58. delay_ms(2000);
  59. output_toggle(PIN_D0);
  60. delay_ms(2000);
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement