Hi C, here’s a description of the PIC18F16K22 fuses:
' Fuse Configuration:
' Crystal 10 MHz x 4 PLL = 40 MHz, MCLR = On (External Reset)
#define CONFIG1L = 0x00 ' Configuration bits for oscillator and memory settings
#define CONFIG1H = 0x33 ' External oscillator with PLL enabled
#define CONFIG2L = 0x1E ' Brown-out reset and power-up timer enabled
#define CONFIG2H = 0x3C ' Watchdog timer settings
#define CONFIG3L = 0x00 ' Low-voltage programming disabled
#define CONFIG3H = 0xBD ' Port configuration settings
#define CONFIG4L = 0x80 ' Stack overflow/underflow reset enabled
#define CONFIG4H = 0x00 ' Reserved bits
#define CONFIG5L = 0x0F ' Code protection settings
#define CONFIG5H = 0xC0 ' Data EEPROM code protection
#define CONFIG6L = 0x0F ' Write protection settings
#define CONFIG6H = 0xE0 ' Configuration protection bits
#define CONFIG7L = 0x0F ' Boot block protection enabled
#define CONFIG7H = 0x40 ' Configuration settings for block protection
I usually stick to the default configuration, only adjusting the settings related to the oscillator (type and frequency in MHz). I ensure that options capable of generating a reset to the microcontroller are disabled, which is typically the default setting.
During project development, I find this initial configuration to be the most stable. Once the project is complete, I adjust the settings based on the environment where it will be installed. These adjustments are rarely critical because I incorporate various protections into the PCB, such as anti-parasitic suppressors, a high-quality power supply, proper component placement, ground planes, and so on.
If you ask me what CONFIGS 2L, 2H, 3L, and 3H are, I don’t usually take the time to analyze them. I just go into the fuse configuration window and enable or disable the options I’m interested in. Remember, in this window, the fuses are listed by description rather than by numbers. Also, every time you change a value in the fuse configuration window, the corresponding configuration word at the bottom updates and shows its value in hexadecimal format.
Const ST77XX_NOP = 0x00 ' No operation
Const ST77XX_SWRESET = 0x01 ' Software reset
Const ST77XX_RDDID = 0x04 ' Read display ID
Const ST77XX_RDDST = 0x09 ' Read display status
and some looks like this, so there's some confusion.
Const ILI9341_NOP = 0x00
Const ILI9341_SWRESET = 0x01
Const ILI9341_RDDID = 0x04
Const ILI9341_RDDST = 0x09
Initially, we used a TFT with the ST77xx controller, but after all the testing we’ve done, we’ve found that the configuration is almost identical to the ILI93xx. Therefore, our goal is to publish a generic library compatible with both TFT controllers. Remember that names are not important, what is important is that the value is the same.
Once the library is finished, it is more appropriate to change them to this more generic form:
Const LCD_NOP = 0x00 ' No operation
Const LCD_SWRESET = 0x01 ' Software reset
Const LCD_RDDID = 0x04 ' Read display ID
Const LCD_RDDST = 0x09 ' Read display status