phillip_bourdon234

Keyboard_Configbits.h

May 29th, 2020 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.24 KB | None | 0 0
  1. // A video demonstration of this project can be found here: https://bit.ly/2AWLzZC
  2.  
  3. #ifndef KEYBOARD_H
  4. #define KEYBOARD_H
  5.  
  6. #include <xc.h>
  7.  
  8. #define _XTAL_FREQ 8000000
  9.  
  10. // PIC18F4520 Configuration Bit Settings
  11.  
  12. // 'C' source line config statements
  13.  
  14. // CONFIG1H
  15. #pragma config OSC = INTIO67    // Oscillator Selection bits (Internal oscillator block, port function on RA6 and RA7)
  16. #pragma config FCMEN = OFF      // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
  17. #pragma config IESO = OFF       // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)
  18.  
  19. // CONFIG2L
  20. #pragma config PWRT = OFF       // Power-up Timer Enable bit (PWRT disabled)
  21. #pragma config BOREN = OFF      // Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
  22. #pragma config BORV = 3         // Brown Out Reset Voltage bits (Minimum setting)
  23.  
  24. // CONFIG2H
  25. #pragma config WDT = OFF        // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
  26. #pragma config WDTPS = 32768    // Watchdog Timer Postscale Select bits (1:32768)
  27.  
  28. // CONFIG3H
  29. #pragma config CCP2MX = PORTC   // CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
  30. #pragma config PBADEN = ON      // PORTB A/D Enable bit (PORTB<4:0> pins are configured as analog input channels on Reset)
  31. #pragma config LPT1OSC = OFF    // Low-Power Timer1 Oscillator Enable bit (Timer1 configured for higher power operation)
  32. #pragma config MCLRE = OFF       // MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
  33.  
  34. // CONFIG4L
  35. #pragma config STVREN = OFF     // Stack Full/Underflow Reset Enable bit (Stack full/underflow will not cause Reset)
  36. #pragma config LVP = ON         // Single-Supply ICSP Enable bit (Single-Supply ICSP enabled)
  37. #pragma config XINST = OFF      // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))
  38.  
  39. // CONFIG5L
  40. #pragma config CP0 = OFF        // Code Protection bit (Block 0 (000800-001FFFh) not code-protected)
  41. #pragma config CP1 = OFF        // Code Protection bit (Block 1 (002000-003FFFh) not code-protected)
  42. #pragma config CP2 = OFF        // Code Protection bit (Block 2 (004000-005FFFh) not code-protected)
  43. #pragma config CP3 = OFF        // Code Protection bit (Block 3 (006000-007FFFh) not code-protected)
  44.  
  45. // CONFIG5H
  46. #pragma config CPB = OFF        // Boot Block Code Protection bit (Boot block (000000-0007FFh) not code-protected)
  47. #pragma config CPD = OFF        // Data EEPROM Code Protection bit (Data EEPROM not code-protected)
  48.  
  49. // CONFIG6L
  50. #pragma config WRT0 = OFF       // Write Protection bit (Block 0 (000800-001FFFh) not write-protected)
  51. #pragma config WRT1 = OFF       // Write Protection bit (Block 1 (002000-003FFFh) not write-protected)
  52. #pragma config WRT2 = OFF       // Write Protection bit (Block 2 (004000-005FFFh) not write-protected)
  53. #pragma config WRT3 = OFF       // Write Protection bit (Block 3 (006000-007FFFh) not write-protected)
  54.  
  55. // CONFIG6H
  56. #pragma config WRTC = OFF       // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected)
  57. #pragma config WRTB = OFF       // Boot Block Write Protection bit (Boot block (000000-0007FFh) not write-protected)
  58. #pragma config WRTD = OFF       // Data EEPROM Write Protection bit (Data EEPROM not write-protected)
  59.  
  60. // CONFIG7L
  61. #pragma config EBTR0 = OFF      // Table Read Protection bit (Block 0 (000800-001FFFh) not protected from table reads executed in other blocks)
  62. #pragma config EBTR1 = OFF      // Table Read Protection bit (Block 1 (002000-003FFFh) not protected from table reads executed in other blocks)
  63. #pragma config EBTR2 = OFF      // Table Read Protection bit (Block 2 (004000-005FFFh) not protected from table reads executed in other blocks)
  64. #pragma config EBTR3 = OFF      // Table Read Protection bit (Block 3 (006000-007FFFh) not protected from table reads executed in other blocks)
  65.  
  66. // CONFIG7H
  67. #pragma config EBTRB = OFF      // Boot Block Table Read Protection bit (Boot block (000000-0007FFh) not protected from table reads executed in other blocks)
  68.  
  69. // #pragma config statements should precede project file includes.
  70. // Use project enums instead of #define for ON and OFF.
  71.  
  72.  
  73. #endif  /* KEYBOARD_H */
Add Comment
Please, Sign In to add comment