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-1and Figure 3-2shows 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

Page 23
Image 23
Freescale Semiconductor S08 manual Chapter Firmware Description, Firmware Flow Main Program