PIC Lesson: Configuration Bits
Configuration Bits adalah untuk setting PIC.

Flash Program Memory Code Protection bit
| CP | Flash Program Memory Code Protection |
| 0 | All program memory code-protected |
| 1 | Code protection off |
In-Circuit Debugger Mode bit
| DEBUG | In-Circuit Debugger Mode |
| 0 | In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger |
| 1 | In-Circuit Debugger enabled, RB6 and RB7 are general purpose I/O pins |
Flash Program Memory Write Enable bits
| WRT1 | WRT0 | Flash Program Memory Write Enable (For PIC16F876A/877A) |
| 0 | 0 | 0000h to 0FFFh write-protected; 1000h to 1FFFh may be written to by EECON control |
| 0 | 1 | 0000h to 07FFh write-protected; 0800h to 1FFFh may be written to by EECON control |
| 1 | 0 | 0000h to 00FFh write-protected; 0100h to 1FFFh may be written to by EECON control |
| 1 | 1 | Write protection off; all program memory may be written to by EECON control |
| WRT1 | WRT0 | Flash Program Memory Write Enable (For PIC16F873A/874A) |
| 0 | 0 | 0000h to 07FFh write-protected; 0800h to 0FFFh may be written to by EECON control |
| 0 | 1 | 0000h to 03FFh write-protected; 0400h to 0FFFh may be written to by EECON control |
| 1 | 0 | 0000h to 00FFh write-protected; 0100h to 0FFFh may be written to by EECON control |
| 1 | 1 | Write protection off; all program memory may be written to by EECON control |
Data EEPROM Memory Code Protection bit
| CPD | Data EEPROM Memory Code Protection |
| 0 | Data EEPROM code-protected |
| 1 | Data EEPROM code protection off |
Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit
| LVP | Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable |
| 0 | RB3 is digital I/O, HV on MCLR must be used for programming |
| 1 | RB3/PGM pin has PGM function; low-voltage programming enabled |
Brown-out Reset Enable bit
| BOREN | Brown-out Reset Enable |
| 0 | BOR disabled |
| 1 | BOR enabled |
Power-up Timer Enable bit
| PWRTEN | Power-up Timer Enable |
| 0 | PWRT enabled |
| 1 | PWRT disabled |
Watchdog Timer Enable bit
| WDTEN | Watchdog Timer Enable |
| 0 | WDT disabled |
| 1 | WDT enabled |
Oscillator Selection bits
| FOSC1 | FOSC0 | Oscillator Selection |
| 0 | 0 | LP oscillator |
| 0 | 1 | XT oscillator |
| 1 | 0 | HS oscillator |
| 1 | 1 | RC oscillator |
Programming untuk configuration bits adalah seperti di bawah
| __CONFIG(0x3F3A); |
Mengikut contoh ini, menetapkan PIC sebagai
Power-up Timer disabled
Watchdog Timer disabled
HS oscillator
Post ini telah menerima 969 views sejak dikeluarkan pada 10:26 AM, Friday, 26th June 2009
Category: PIC Lesson Tags: PIC

Salam Shahrul, baru fhm kenapa contoh2 source code Shahrul ada config bit 0x3F3A. mcmn kita nak tentukan kita nak pilih logik 1 @ 0 utk bit2 tersebut? contoh jika projek menggunakan keypad, lcd dan DIP switches?
cza, untuk pilih logik 1 @ 0 bg bit2, set pd TRIS dan PORT. Lihat http://shahrulnizam.com/pic-lesson-io-ports.