Chapter 3
Firmware Description
3.1 Introduction
The MCU firmware in this LED lighting control design is responsible for:
•Controlling timer channels for the RGB LED color PWM output
•Communicating with the host PC for receiving command and data input/output
•Operating as a standalone LED box through on board buttons
Figure 3-1 and Figure 3-2 shows the firmware flow. The LED box can operate in PC control operation mode or standalone operation mode.
Initialization
PC Control Mode
Operation?
Yes
Display control menu through
SCI
No
*Standalone demo box without PC control
Enable I/O for PCB button
detection
Valid command from PC?
No
Yes
Process commands and adjust PWM
output
No |
Any PCB button |
pressed? |
Yes |
Adjust PWM output according to button |
event |
Figure 3-1. Firmware Flow: Main Program
LED Lighting Control using the MC9S08AW60, Rev. 1
Freescale Semiconductor | 23 |