- #MPLAB XC8 CONFIGURATION BITS SOFTWARE#
- #MPLAB XC8 CONFIGURATION BITS CODE#
- #MPLAB XC8 CONFIGURATION BITS SERIES#
If you’re willing to purposely use the WDT, you can turn this bit ON.
#MPLAB XC8 CONFIGURATION BITS CODE#
That will obviously block out your main code that will never complete its execution because of the infinite WDT time-out restarts.
#MPLAB XC8 CONFIGURATION BITS SERIES#
If left ON, this will result in an undetectable insane series of time-out restarts. It controls the activation/deactivation of the watchdog timer module. This bit is the most tricky one obviously. It’s not as frustrating as it seems to be. In most cases, you will be using the HS or XT crystal oscillator option. Higher capacitance increases the stability of oscillator but also increases the start-up time, so please be careful. They are used for stabilization purposes.
However, for these tutorials, we won’t add these capacitors at all.
The table shown below indicates the frequency ranges and could be used as a guidance for capacitors selection. Which means it’s preferred to choose this option for crystals that below 400KHz IV-You can choose to connect a low-power crystal oscillator by writing 0, 0 to bit-1, bit-0 respectively. it’s preferred to choose this option for crystals that are less than or equal to <= 4MHz III-You can choose to connect a crystal oscillator/ceramic resonator by writing 0, 1 to bit-1, bit-0 respectively. Which means it’s preferred to choose this option for crystals that are greater than or equal to >= 4MHz II-You can choose to connect a crystal oscillator by writing 1, 0 to bit-1, bit-0 respectively. But resistors and capacitors always have a pretty high tolerance and their values aren’t exact. I’m sure you’ll calculate the R & C values that will generate the desired frequency correctly. Please, be advised that this method has a low accuracy for the oscillation frequency. Just in case you’re using an RC network to generate oscillating charging/discharging signal as a clock input for your MCU. I- You can choose the first option RC oscillator by writing 1, 1 to bit-1, bit-0 respectively. F OSC1 : F OSC0 Oscillator Type 1 1 RC Oscillator 1 0 HS Oscillator 0 1 XT Oscillator 0 0 LP Oscillator Consequently, there are 4 options for the oscillator to select from. There are basically 4 combinations of those couple of bits. The combination of these two bits determines which clock source will be used to feed the MCU clock input. Let’s start at the LSB (0) all the way up to the MSB (13).īit-0, Bit-1: The oscillator selection bits Down below, I will show you what are the features being controlled by these bits. Writing 1 or 0 in each bit of this register will result in the activation/deactivation of a specific feature. You can easily find the description of this register in the datasheet at section 14.1 (page144). This 14-Bit register is located in the ROM (program) the address 2007h. This means it’s part of the code itself which may not be changed while the application is running, But it’s only accessible/changeable during the programming (flashing) process. The configuration register is typically resident in the ROM of a microcontroller.
All in all, these names stand for the same thing. Some books in the embedded literature call these bits as “Fuses”. These configurations are controlled via a dedicated specific register in the ROM, In our MCU it’s called “CONFIG_WORD”.Įvery single bit in this register controls a specific feature, combined together in this register to control all the settings (configurations), Hence they are often called the “Configuration Bits”. Such as the type of oscillator internal/external, whether you’ll use a watchdog timer or not, whether there’ll be a reset pin or not, and so.
#MPLAB XC8 CONFIGURATION BITS SOFTWARE#
Similarly, in embedded software design, there are also some configurations for each MCU used in the whole project. These settings are said to be “The configurations” of the project which will not be changed till the end ideally. There are some settings that are being tuned at the beginning of the design project such as dimensions, dpi, background, colors, etc.