8-bit microcontroller mb95f200 series led control ... · 8-bit microcontroller mb95f200 series led...

13
Fujitsu Microelectronics (Shanghai) Co., Ltd. Application Note MCU-AN- 500055-E-10 F²MC-8FX FAMILY 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE

Upload: vumien

Post on 20-Apr-2018

231 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

Fujitsu Microelectronics (Shanghai) Co., Ltd. Application Note

MCU-AN- 500055-E-10

F²MC-8FX FAMILY 8-BIT MICROCONTROLLER

MB95F200 SERIES

LED Control Reference Solution

APPLICATION NOTE

Page 2: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 2

Revision History

Date Author Change of Records 2009-11-4 Kevin Lin V1.0

This manual contains 13 pages.

© 2009 Fujitsu Microelectronics (Shanghai) Co., Ltd.

1. The products described in this manual and the specifications thereof may be changed without prior notice. To obtain up-to-date information and/or specifications, please contact your Fujitsu sales representative or Fujitsu authorized dealer.

2. Fujitsu will not be liable for infringement of copyright, industrial property right, or other rights of a third party caused by the use of information or drawings described in this manual.

3. The contents of this manual may not be transferred or copied without the express permission of Fujitsu.

4. The products contained in this manual are not intended for use with equipment which requires extremely high reliability such as aerospace equipment, undersea repeaters, nuclear control systems or medical equipment for life support.

5. Some of the products described in this manual may be strategic materials (or special technology) as defined by the Foreign Exchange and Foreign Trade Control Law. In such cases, the products or portions thereof must not be exported without permission as defined under the law.

Page 3: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 3

CONTENTS

Revision History ....................................................................................................... 2�

1� Outline ................................................................................................................... 4�

2� Demo Platform ..................................................................................................... 5�

3� Functions .............................................................................................................. 6�

3.1� Tune the light down ................................................................................................. 6�

3.2� Tune the light up...................................................................................................... 6�

4� Hardware ............................................................................................................... 7�

4.1� System Block .......................................................................................................... 7�

4.2� Schematic ............................................................................................................... 7�

4.3� Pin Assignment ....................................................................................................... 7�

5� Firmware ............................................................................................................... 9�5.1� Flow Chart ............................................................................................................... 9�

5.2� Files Description ...................................................................................................... 9�

5.3� Source Code ......................................................................................................... 10�

6� More Information ................................................................................................ 12�

7� Appendix ............................................................................................................. 13�

Page 4: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 4

1 Outline

LED is widely used in many fields now. In order to achieve higher efficiency or better illumination, the light is usually required to have diming function. There are two ways to dim the LED: one is reducing the drive current, and another is tuning on and off LED drive IC using the low frequency PWM signal. This demo chooses the second way.

This demo supports such features:

� Dim the LED by turn on and off the LED drive IC

� Change the PWM duty by potentiometer easily

Page 5: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 5

2 Demo Platform

This demo set is based on MB95F212K an 8 pins MCU. The MCU will generate a PWM signal to the LED drive IC to dim LED. The potentiometer decides the PWM duty. Figure 2.1 shows the demo.

Figure 2. 1 LED Diming Demo Board

Page 6: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 6

3 Functions

3.1 Tune the light up User can turn the potentiometer to tune the light up.

Figure 3. 1 LED at High Luminance

3.2 Tune the light down User can turn the potentiometer to tune the light down.

Figure 3. 2 LED at Low Luminance

Page 7: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 7

4 Hardware

4.1 System Block Figure 4.1 shows the system block of the demo.

PWM

Figure 4. 1 System Block Diagram

4.2 Schematic Figure 4.2(next page) shows the hardware of this demo. The main parts are MB95F212 and T6322A. The P04 is connected to a potentiometer which is used control the PWM duty. The P05 is PWM output pin and is connected to the EN pin of LED drive IC. When P05 outputs “H”, the IC will output maximum current to the LED module. When P05 outputs “L”, the IC will shut down, and the LED module is off.

4.3 Pin Assignment Table 4.1 shows MB95F212 pin assignment.

Number Pin Function

5 P04 Potentiometer input for PWM duty control

6 P05/TO00 Low frequency PWM

7 P06 Null

8 P12/DBG Debugger port

Table 4. 1 MCU Pin Assignment Table 4.2 shows the T6322A pin assignment.

Number Pin Function

1 LX Switch signal output

2 GND GND

3 ADJ Null

4 SENSE Current feedback input

5 EN Enable signal input

6 VIN Power input

Table 4. 2 LED Driver IC Pin Assignment

Debug

Interface

Potentiometer

MCU

LED drive IC

LED module

Page 8: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 8

Figure 4. 2 LED Diming Board

Page 9: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 9

5 Firmware

5.1 Flow Chart The main function of this firmware is sampling voltage and generating PWM signal. The flow chart is shown as Figure 5.1.

Figure 5. 1 Main Function Flow Chart

5.2 Files Description

Functions Description

MCU_ initialization() Initialize MCU

PWM_init() Initialize timer00 for PWM

io_ad_init() Initialize AD module

ad_sample() Sample voltage and update the PWM duty

Table 5. 1 File Description

Start

Initial MCU

Initial Time00 for

PWM

Initial AD

Sample voltage and update the PWM duty

Page 10: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 10

5.3 Source Code

Page 11: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 11

Page 12: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 12

6 More Information

For more information on FUJITSU MB95200 products, please visit following website:

Simplified Chinese Version http://www.fujitsu.com/cn/fmc/services/mcu/mb95200/

Page 13: 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control ... · 8-BIT MICROCONTROLLER MB95F200 SERIES LED Control Reference Solution APPLICATION NOTE . LED Driver Demo V1.0 MCU-AN- …

LED Driver Demo V1.0

MCU-AN- 500055-E-10 – Page 13

7 Appendix

Figure 2. 1 LED Diming Demo Board ..................................................................................... 5�

Figure 3. 1 LED at High Luminance ....................................................................................... 6�

Figure 3. 2 LED at Low Luminance ........................................................................................ 6�

Figure 4. 1 System Block Diagram ......................................................................................... 7�

Figure 4. 2 LED Diming Board ............................................................................................... 8�

Figure 5. 1 Main Function Flow Chart .................................................................................... 9�

Table 4. 1 MCU Pin Assignment ............................................................................................ 7�

Table 4. 2 LED Driver IC Pin Assignment ............................................................................... 7�

Table 5. 1 File Description..................................................................................................... 9�