The firmware for the MSP-EXP432P401R LaunchPad is
implemented in Energia. While this firmware is meant to be used with the
MSP-EXP432P401R only, it can be easily modified for other TI LaunchPads. For this
reason the BOOSTXL-TECDRV BoosterPack has multiple connection options for the
BoosterPack header. By moving the jumper resistors, the signal and control lines can
be re-routed between multiple pins. This is shown in more details in the schematic
in Section 8.3.
Figure 5-1 shows the firmware flow chart.
The code starts by initializing various variables, configuring MCU and its peripherals, and configuring digital sensors. After that the main loop takes care of three main processes:
- A 100-ms timer takes care of the main control
process. Here, the temperature is read either from the analog sensor via ADC or
the digital sensor via I2C. After that, the PID controller calculates
the necessary control voltage for the TPS63810. This voltage is transmitted to
the TPS63810 via the same I2C interface used for the digital
temperature sensor, and the TEC voltage is updated. This period depends on the
thermal dynamics of the system and can be changed in the code.
- A 200-ms timer periodically sends the currently
sensed temperature and the current output voltage of the TPS63810 to the GUI.
This period can be extended in order to send less data to the GUI. When used
with the BOOSTXL-TECDRV GUI, it is not recommended to send the data more than 10
times per second, as the GUI might not be able to process all the incoming
data.
- The third process checks if there is a message
received from the GUI. These messages are sent from the GUI to the Launchpad on
user commands, such as initializing the TPS63810 or changing the control modes
and PID parameters.