Краткое содержание страницы № 1
LED Lighting Control Using the
MC9S08AW60
Designer Reference Manual
S08
Microcontrollers
DRM093
Rev. 1
07/2007
freescale.com
Краткое содержание страницы № 2
Краткое содержание страницы № 3
LED Lighting Control using the MC9S08AW60 Designer Reference Manual by: Dennis Lui, Ernest Chan Freescale Semiconductor, Inc. Hong Kong To provide the most up-to-date information, the revision of our documents on the World Wide Web is the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://www.freescale.com The following revision history table summarizes changes contained in this document. For your convenience, the
Краткое содержание страницы № 4
Revision History LED Lighting Control using the MC9S08AW60, Rev. 1 4 Freescale Semiconductor
Краткое содержание страницы № 5
Table of Contents Chapter 1 Introduction 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 MC9S08AW60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Chapter 2 Hardware Description 2.1
Краткое содержание страницы № 6
Table of Contents 4.3.1 Demo 1 - Demonstration Display . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.3.2 Demo 2 - Preset Colors Display . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.3.3 Demo 3 - Auto White Balance Control . . . . . . . . . . . . . . . . . . . . . 32 4.3.4 Demo 4 - PWM Output Frequency Control . . . . . . . . . . . . . . . . . . 32 4.3.5 Demo 5 - Full Manual Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.4 Program the MCU Flash . . . .
Краткое содержание страницы № 7
Chapter 1 Introduction 1.1 Introduction This manual describes a reference design of a multi-color LED lighting control solution by using the MC9S08AW60 Microcontroller. Using a microcontroller (MCU) to control the red/green/blue (RGB) color LEDs increases system flexibility and functionality for the next generation of lighting applications, architectural/entertainment lighting or LCD backlighting, that require a smart and adaptive control methodology to ensure optimized color space renderi
Краткое содержание страницы № 8
Introduction 1.3 System Overview A block diagram of the system is shown in Figure 1-1. Power Power Su Sup pp plly y & & R Re egu gulato lator r DC/D DC/DC C Co Conve nver rte ter r AW AW6 60 0 RGB RGB PW PWM M Button Button Sw Switc itch h Red Red LE LEDs Ds KBI KBI PW PWM M De Detecti tectio on n Gre Green L en LE EDs Ds To To P PC C RS RS23 232 2 SC SCI I AD ADC C Int Inte er rffa ac ce e Blu Blue L e LE ED Ds s II//O Con O Conttrol rol GP GPI IO O P Po ort rt Figure 1-1 . System Block Diagr
Краткое содержание страницы № 9
MC9S08AW60 Table 1-2. Peripherals Available per Package Type Package Options Feature 64-Pin 48-Pin 44-Pin ADC 16-CH 8-CH 8-CH IIC Yes Yes Yes IRQ Yes Yes Yes KBI1 8 7 6 SCI1 Yes Y es Yes SCI2 Yes Y es Yes SPI1 Yes Yes Yes TPM1 6-CH 4-CH 4-CH TPM1CLK Yes No No TPM2 2-CH 2-CH 2-CH TPM2CLK Yes No No I/O Pins 54 38 34 LED Lighting Control using the MC9S08AW60, Rev. 1 Freescale Semiconductor 9
Краткое содержание страницы № 10
Introduction LED Lighting Control using the MC9S08AW60, Rev. 1 10 Freescale Semiconductor
Краткое содержание страницы № 11
Chapter 2 Hardware Description 2.1 Introduction The system consists of a MCU control board and a LED driving board. The MCU control board, DEMO9S08AW60LED, is one of the demonstration boards for the Freescale MC9S08AW60. This board allows easier developmet of code for LED control applications, architectural/entertainment lighting or LCD backlighting. The on-board serial interface allows you to control and monitor the system status via the RS232 serial port connection. The separated LED lig
Краткое содержание страницы № 12
Hardware Description 2.2 DEMO9S08AW60LED Features � MC9S08AW60 CPU – 44 pin LQFP package – 20 MHz Internal Bus Frequency – 60 Kbytes of on-chip in-circuit programmable FLASH – 2 Kbytes of on-chip RAM – 8-channel, 10-bit analog-to-digital converter – Two SCI modules – SPI module 2 –I C module – 6-pin keyboard interrupt (KBI) module – 34 general-purpose input/output (I/O) pins � External power jack for DC power supply (+12 VDC) � Four pushbutton user switches � Four LEDs connected to I/O port � M
Краткое содержание страницы № 13
Development Support 2.4 Development Support Application development and debug for the MC9S08AW60 is supported through a 6-pin BDM header (CON8). The pinout is as follows: Table 2-1. BDM Connector (CON8) Pinout BKGD 1 2 GND NC 3 4 RESET NC 5 6 V DD 2.5 Power The DEMO9S08AW60LED is powered externally through the barrel connector CON2. This connector is a 2.5 mm, center positive connector. Voltage supplied through this connector should be positive 12 volts DC. This is also the supply voltage f
Краткое содержание страницы № 14
Hardware Description 2.9 User Options The DEMO9S08AW60LED includes various input and output devices to assist in application development. These devices include four pushbutton switches, four LEDs, and an operational amplifier with RC filter connected at each ADC input channel for signal amplification and filtering. 2.9.1 Pushbutton Switches Four pushbutton switches provide momentary active low input for user applications. The table below describes the pushbutton switch connections. Table 2-
Краткое содержание страницы № 15
User Options 2.9.4 Other I/O Connectors One user assignable and eight pre-defined I/O connectors are available to help users connect the board into their target system. Table 2-5. IIC Port CON5 Signal Name Remarks Install a zero ohm resistor in the R14 footprint to Pin 1 NC connect V DD Connected to MCU PTC0/SCL1 Pin 2 SCL 10 k Ω pullup to V DD Connected to MCU PTC1/SDA1 Pin 3 SDA 10 k Ω pullup to V DD Pin 4 GND — Table 2-6. SCI Port CON6 Signal Name Remarks Install a zero ohm resistor in the
Краткое содержание страницы № 16
Hardware Description Table 2-8. PWM Port CON4 Signal Name Remarks Pin 1 PWM R Connected to MCU PTF0/TPM1CH2 Pin 2 PWM G Connected to MCU PTF1/TPM1CH3 Pin 3 PWM B Connected to MCU PTE2/TPM1CH0 Pin 4 GND — Table 2-9. LED Light Box Interface CON3 Signal Name Remarks Pin 1 & 2 12V 12V power for LED light box Pin 3 & 4 GND — Pin 5 PWM R Connected to MCU PTF0/TPM1CH2 Pin 6 PWM G Connected to MCU PTF1/TPM1CH3 Pin 7 PWM B Connected to MCU PTE2/TPM1CH0 Connected to MCU PTC3/TXD2 Pin 8 DCDC_EN Reserved pi
Краткое содержание страницы № 17
User Options Table 2-11. Sensor Interface Type H CON11 Signal Name Remarks Pin 1 3V Sensor reference voltage Pin 2 5V Sensor supply voltage Pin 3 GND — Pin 4 NC — Sensor input (Green), Connected to MCU Pin 5 SEN_IN_G PTB1/ADP1 through operational amplifier U5A Sensor input (Red), Connected to MCU Pin 6 SEN_IN_R PTB0/ADP0 through operational amplifier U5D Sensor input (Blue), Connected to MCU Pin 7 SEN_IN_B PTB2/ADP2 through operational amplifier U5B Pin 8 NC — NOTE Connectors Type A and H sha
Краткое содержание страницы № 18
Hardware Description Table 2-13. User Assignable Input (Continued) CON13 Signal Name Remarks Pin 7 DCDC_CTL1 Connected to MCU PTF4/TPM2CH0 Pin 8 DCDC_CTL2 Connected to MCU PTF5/TPM2CH1 Pin 9 DCDC_CTL3 Connected to MCU PTE3/TPM1CH1 Pin 10 GND — 2.10 LED Driving Board In general, LEDs have a nonlinear I-V behavior and current limitation is required to prevent the power dissipation to exceed a maximum limit. Therefore, the ideal source for LED driving is a constant current source. A linear type
Краткое содержание страницы № 19
LED Driver Design Procedures V Vout out = 30 = 30V V Vin Vin = = 12V 12V DC-to-D DC-to-DC C Boost Boost Conve Conver rter ter ( (M MC340 C34063) 63) R- R-Channel Channel PW PWM M Dri Driv ve er r R R G G- -Channel Channel II = 50m = 50mA A LE LED D PW PWM M Dr Driiv ver er G G V V REF REF Dri Driv ve er r B B B- B-Channel Channel PW PWM M Rs Rs Figure 2-3. DC-to-DC Boost Converter and Linear LED Driver Eight pieces of 3-in-1 RGB LED chips connected in series are used to form the multi-color lig
Краткое содержание страницы № 20
Hardware Description 2.11.2 Current Sense Resistor The value of the current sense resistor R is determined by two factors: power dissipation on R and the S S reference level V for operational amplifier non-inverting input. Smaller R reduces power dissipation, REF S but the detection of a feedback signal in operational amplifier is more difficult. The voltage V across the current sense resistor R is directly proportional to the current I through RS S LED LED. In closed-loop condition, V is e