boardconfig.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*-------------------------------------------------------------------------
  2. boardconfig.c - hardware setup and 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. #include "../generic26kconfig.c"
  17. /* Specific Setup() */
  18. void Setup()
  19. {
  20. Generic26kSetup();
  21. }
  22. #ifdef BOOTLOADER
  23. /* Set the PIC config words */
  24. __code char __at __CONFIG3H _conf4 = //_CCP2MX_PORTB3_3H // CCP2 input/output is multiplexed with RB3
  25. _CCP2MX_PORTC1_3H // CCP2 input/output is multiplexed with RC1
  26. //& _PBADEN_OFF_3H // PORTB<5:0> pins are configured as digital I/O on Reset
  27. & _PBADEN_ON_3H // PORTB<5:0> pins are configured as analog input channels on Reset
  28. //& _CCP3MX_PORTC6_3H // P3A/CCP3 input/output is mulitplexed with RC6
  29. & _CCP3MX_PORTB5_3H // P3A/CCP3 input/output is multiplexed with RB5
  30. //& _HFOFST_OFF_3H // HFINTOSC output and ready status are delayed by the oscillator stable status
  31. & _HFOFST_ON_3H // HFINTOSC output and ready status are not delayed by the oscillator stable status
  32. & _T3CMX_PORTB5_3H // T3CKI is on RB5
  33. //& _T3CMX_PORTC0_3H // T3CKI is on RC0
  34. //& _P2BMX_PORTC0_3H // P2B is on RC0
  35. & _P2BMX_PORTB5_3H // P2B is on RB5
  36. & _MCLRE_INTMCLR_3H; // RE3 input pin enabled; MCLR disabled
  37. //& _MCLRE_EXTMCLR_3H // MCLR pin enabled, RE3 input pin disabled
  38. #endif //BOOTLOADER