Background
This is a software implementation of power sequencing.
Once a HIGH is detected on the EN pin, the MCU wakes up from LPM. Afterwards a timer module begins counting. The 4 GPIO’s will go HIGH according to the thresholds set by the GUI.
Operation
Two timers with two comparators each are used to generate the interrupts. Timer A capture/compare registers (TAxCCRn) is used. The power sequencing is transmitted on pins P2.0, P2.1, P2.5 and P3.2. See the wiring diagram below.
When the timer reaches the value specified in the compare register, the corresponding pin toggles HIGH.
The connections are shown below:
Code
See below for the flowchart
After initialization, the MCU enters LPM.
When P2.3 receives the enable interrupt, the MCU begins the two timers. The enable LED illuminates on the GUI. Examining the GUI below, once the timer counts to the specific value, that port toggles HIGH and its associated LED illuminates.
The power sequencing flow is saved in FRAM, making it persistent.
The GUI
The power sequencing program is adjusted via the GUI. Data is transmitted via UART. Baud rate of 9600. One stop bit. No parity.
Sliders are text boxes can be manipulated to set the desired power-up sequence.



