boardconfig.c 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*-------------------------------------------------------------------------
  2. config.c - PIC configuration words
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  14. -------------------------------------------------------------------------*/
  15. #include <pic18fregs.h>
  16. #ifdef BOOTLOADER
  17. /* Set the PIC config words */
  18. __code char __at __CONFIG1L _conf0 = _USBPLL_CLOCK_SRC_FROM_96MHZ_PLL_2_1L &
  19. _CPUDIV__OSC1_OSC2_SRC___1__96MHZ_PLL_SRC___2__1L &
  20. //_PLLDIV_DIVIDE_BY_5__20MHZ_INPUT__1L;
  21. _PLLDIV_NO_DIVIDE__4MHZ_INPUT__1L;
  22. __code char __at __CONFIG1H _conf1 = _IESO_OFF_1H &
  23. _FCMEN_OFF_1H &
  24. _OSC_HS__HS_PLL__USB_HS_1H;
  25. __code char __at __CONFIG2L _conf2 = _VREGEN_OFF_2L &
  26. _BODENV_2_0V_2L &
  27. /*_BODEN_OFF_2L*/ _BODEN_CONTROLLED_WITH_SBOREN_BIT_2L &
  28. _PUT_ON_2L;
  29. __code char __at __CONFIG2H _conf3 = _WDTPS_1_1_2H &
  30. _WDT_DISABLED_CONTROLLED_2H;
  31. __code char __at __CONFIG3H _conf4 = _MCLRE_MCLR_OFF_RE3_ON_3H &
  32. _LPT1OSC_ON_3H &
  33. _PBADEN_PORTB_4_0__CONFIGURED_AS_DIGITAL_I_O_ON_RESET_3H &
  34. _CCP2MUX_RC1_3H;
  35. __code char __at __CONFIG4L _conf5 = _BACKBUG_OFF_4L &
  36. _ENHCPU_OFF_4L &
  37. _ENICPORT_OFF_4L &
  38. _LVP_OFF_4L &
  39. _STVR_OFF_4L;
  40. __code char __at __CONFIG5L _conf6 = _CP_0_OFF_5L &
  41. _CP_1_OFF_5L &
  42. _CP_2_OFF_5L;// &
  43. // 4550 specific _CP_3_OFF_5L;
  44. __code char __at __CONFIG5H _conf7 = _CPB_OFF_5H &
  45. _CPD_OFF_5H;
  46. __code char __at __CONFIG6L _conf8 = _WRT_0_OFF_6L &
  47. _WRT_1_OFF_6L &
  48. _WRT_2_OFF_6L;// &
  49. // 4550 specific _WRT_3_OFF_6L;
  50. __code char __at __CONFIG6H _conf9 = _WRTB_OFF_6H &
  51. _WRTC_OFF_6H &
  52. _WRTD_OFF_6H;
  53. __code char __at __CONFIG7L _conf10 = _EBTR_0_OFF_7L &
  54. _EBTR_1_OFF_7L &
  55. _EBTR_2_OFF_7L;// &
  56. // 4550 specific _EBTR_3_OFF_7L;
  57. __code char __at __CONFIG7H _conf11 = _EBTRB_OFF_7H;
  58. #endif //BOOTLOADER