Bootloader operation mode is displayed on LED:
- LED is on under programming mode – microcontroller pin is configured as digital output with output value equal to 0;
- LED is blinking while bootloader updates user mode application;
- LED is off under user mode – microcontroller pin remains configured as digital input.
LED usage is configured in io_cfg.inc file by USE_LED macro. To use LED, macros value must be set to 1.
#define USE_LED 1
If LED is not used, macros value must be set to 0.
#define USE_LED 0
By default microcontroller pin E.0 is reserved for LED functionality. To use another pin, change the following macros:
- in LED macros specify LAT register address;
- in LED_TRIS macros specify TRIS register address;
- in LED_PIN macros specify the pin number.
These macros are defined in io_cfg.inc file as shown below:
#define LED LATE #define LED_TRIS TRISE #define LED_PIN 0