Advertisement
abdullahkahraman

Pragma directive have no effect.

Jul 9th, 2012
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.78 KB | None | 0 0
  1. #include <xc.h> // Include the header file needed by the compiler
  2. // CONFIG 1
  3. #pragma config CPUDIV = NOCLKDIV    // No CPU System Clock divide
  4. #pragma config IESO = ON            // Oscillator Switchover mode enabled
  5. #pragma config PLLEN = ON           // Oscillator multiplied by 4
  6. #pragma config FOSC = HS            // HS oscillator
  7. #pragma config FCMEN = ON           // Fail-Safe Clock Monitor enabled
  8. #pragma config PCLKEN = ON          // Primary clock enabled
  9. // CONFIG 2
  10. #pragma config BOREN = ON           // Brown-out Reset enabled and controlled by software (SBOREN is enabled)
  11. #pragma config BORV = 30            // Brown-out Reset Voltage set to 3.0 V nominal
  12. #pragma config PWRTEN = ON          // Power-up Timer Enabled
  13. #pragma config WDTPS = 1            // Watchdog Timer Postscale Select bits 1:1
  14. #pragma config WDTEN = OFF          // WDT is controlled by SWDTEN bit of the WDTCON register
  15. // CONFIG 3
  16. #pragma config MCLRE = OFF          // RA3 input pin enabled; MCLR disabled
  17. #pragma config HFOFST = OFF         // The system clock is held off until the HFINTOSC is stable.
  18. // CONFIG 4
  19. #pragma config DEBUG = OFF          // Background debugger disabled, RA0 and RA1 configured as general purpose I/O pins
  20. #pragma config STVREN = ON          // Stack full/underflow will cause Reset
  21. #pragma config XINST = OFF          // Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
  22. #pragma config BBSIZ = OFF          // 1kW boot block size
  23. #pragma config LVP = OFF            // Single-Supply ICSP disabled
  24. // CONFIG 5
  25. #pragma config CP0 = ON             // Block 0 code-protected
  26. #pragma config CP1 = ON             // Block 1 code-protected
  27. #pragma config CPD = OFF            // Data EEPROM not code-protected
  28. #pragma config CPB = OFF            // Boot block not code-protected
  29. // CONFIG 6
  30. #pragma config WRT0 = OFF           // Block 0 not write-protected
  31. #pragma config WRT1 = OFF           // Block 1 not write-protected
  32. #pragma config WRTB = OFF           // Boot block not write-protected
  33. #pragma config WRTC = OFF           // Configuration registers not write-protected
  34. #pragma config WRTD = OFF           // Data EEPROM not write-protected
  35. // CONFIG 7
  36. #pragma config EBTR0 = OFF          // Block 0 not protected from table reads executed in other blocks
  37. #pragma config EBTR1 = OFF          // Block 1 not protected from table reads executed in other blocks
  38. #pragma config EBTRB = OFF          // Boot block not protected from table reads executed in other blocks
  39.  
  40. void main(void)
  41. {
  42.     TRISC = 0x20; // RC0: Out / RC1: Out / RC2: Out / RC3: Out / RC4: Out / RC5: In / RC6: Out / RC7: Out
  43.     LATC = 0; // Clear PORTC output latch.
  44.     ANSEL = 0; // All analog inputs are disabled and made digital.
  45.     ANSELH = 0;
  46.  
  47.     while (1)
  48.     {
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement