3.7 Supply Control Module Firmware Overview
The Supply Control Module application firmware starts with the initialization of the system and required peripherals of the PIC16F15244 microcontroller. After initialization, it enters Power-Down mode. The microcontroller remains in Power-Down mode until it receives an I2C command from the process computer. To an I2C interrupt, the microcontroller wakes up from Sleep and verify whether the received I2C command is valid.
On reception of a valid Sleep command, the control module waits for a period of 30 seconds using a timer peripheral before turning OFF the regulator. Once the 30 second wait period is over, the application firmware disables the I2C peripheral and turns OFF the LED (voltage regulator), then enters Low Power mode by entering sleep. This wait period can be configurable by the user per application requirement. The supply control device wakes up periodically from Sleep mode using the Watchdog Timer (WDT). After the total power-down duration is complete or if a valid switch press event is detected, the supply control module turns ON the LED. Figure 3-5 shows the firmware flow of the application.