Samsung | S3F84A5 | Samsung Confidential

APPLICATION NOTE
S3F84A5
An LED Lighting System
January 2010
Revision 0.00
Confidential Proprietary of Samsung Electronics Co., Ltd
Copyright © 2010 Samsung Electronics, Inc. All Rights Reserved
Important Notice
The information in this publication has been carefully
checked and is believed to be entirely accurate at the
time of publication. Samsung assumes no
responsibility, however, for possible errors or
omissions, or for any consequences resulting from the
use of the information contained herein.
Samsung reserves the right to make changes in its
products or product specifications with the intent to
improve function or design at any time and without
notice and is not required to update this
documentation to reflect such changes.
This publication does not convey to a purchaser of
semiconductor devices described herein any license
under the patent rights of Samsung or others.
Samsung makes no warranty, representation, or
guarantee regarding the suitability of its products for
any particular purpose, nor does Samsung assume
any liability arising out of the application or use of any
product or circuit and specifically disclaims any and all
liability, including without limitation any consequential
or incidental damages.
"Typical" parameters can and do vary in different
applications. All operating parameters, including
"Typicals" must be validated for each customer
application by the customer's technical experts.
Samsung products are not designed, intended, or
authorized for use as components in systems intended
for surgical implant into the body, for other
applications intended to support or sustain life, or for
any other application in which the failure of the
Samsung product could create a situation where
personal injury or death may occur.
Should the Buyer purchase or use a Samsung product
for any such unintended or unauthorized application,
the Buyer shall indemnify and hold Samsung and its
officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs,
damages, expenses, and reasonable attorney fees
arising out of, either directly or indirectly, any claim of
personal injury or death that may be associated with
such unintended or unauthorized use, even if such
claim alleges that Samsung was negligent regarding
the design or manufacture of said product.
S3F84A5 An LED Lighting System
Application Note, Revision 0.00
Copyright  2010 Samsung Electronics Co., Ltd.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in
any form or by any means, electric or mechanical, by photocopying, recording, or otherwise, without the prior
written consent of Samsung Electronics.
Samsung Electronics Co., Ltd.
San #24 Nongseo-Dong, Giheung-Gu
Yongin-City, Gyeonggi-Do, Korea 446-711
TEL :
FAX :
(82)-(031)-209-4356
(82)-(031)-209-3262
Home Page: http://www.samsungsemi.com
Printed in the Republic of Korea
Revision History
Revision No.
Date
0
Jan. 20, 2010
Description
- Initial draft
Author(s)
Wei Ningning
Table of Contents
1
Overview of HPLED Lighting Control System ............................................7
1.1 Pin Assignment in S3F84P4 ........................................................................................................................7
1.2 Key Features of S3F84P4............................................................................................................................8
1.3 System Principle ..........................................................................................................................................8
1.3.1 Buck Circuit...........................................................................................................................................9
1.3.2 Summary ..............................................................................................................................................9
1.3.3 Constant Current Control....................................................................................................................10
2
Hardware Implementation ..........................................................................11
2.1 System Diagram and Circuit ......................................................................................................................11
2.2 Components Selection...............................................................................................................................12
2.2.1 Select the Inductance (L1) for the Requirement of Current Ripple ....................................................12
2.2.2 Select the Capacitance (C2) for the Requirement of Voltage Ripple .................................................12
3
Software Implementation............................................................................13
4
System Validation .......................................................................................15
5
Appendix ......................................................................................................17
5.1 BOM List of Key Circuit..............................................................................................................................17
5.2 Appendix 2: Source Code ..........................................................................................................................17
List of Figures
Figure
Number
Title
Page
Number
Figure 1-1
Figure 1-2
Figure 1-3
Figure 1-4
S3F84P4 Pin Assignment.....................................................................................................................7
Simplified Buck Circuit ..........................................................................................................................9
Current on load .....................................................................................................................................9
HKP-D1W1 Forward Voltage, Forward Current, and Relative Luminous Flux...................................10
Figure 2-1
Control Circuit .....................................................................................................................................11
Figure 3-1
Figure 3-2
Software Implementation Diagram .....................................................................................................13
Way to change PWM duty cycle .........................................................................................................14
Figure 4-1
Waveform for HPLED forward voltage and current ............................................................................15
List of Tables
Table
Number
Title
Page
Number
Table 4-1
System validation of efficiency.............................................................................................................16
Table 5-1
BOM list of Key Circuit .........................................................................................................................17
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
1
1 OVERVIEW OF HPLED LIGHTING CONTROL SYSTEM
OVERVIEW OF HPLED LIGHTING CONTROL
SYSTEM
A light-emitting diode (LED) is a semiconductor light source that presents several advantages over traditional light
(like incandescent) sources such as lower energy consumption, longer lifetime, improved robustness, smaller size,
faster switching, and greater durability and reliance. It renders “green” light and does not contribute towards
material pollution or radiations. Usually, an LED can also be referred to as HPLED (high power LED) if the NRP
(normal rated power) is greater than 1W. It can be driven at currents that vary from hundreds of mA to more than
an ampere. LEDs can produce hundreds of lumens, and find extensive usage in lighting systems.
This document presents a simple HPLED lighting control system implemented with Samsung’s 8-bit MCU
S3F84P4.
1.1 PIN ASSIGNMENT IN S3F84P4
Figure 1-1 shows the pin assignment in S3F84P4.
Figure 1-1
S3F84P4 Pin Assignment
Samsung Confidential
7
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
1 OVERVIEW OF HPLED LIGHTING CONTROL SYSTEM
1.2 KEY FEATURES OF S3F84P4
The key features in S3F84P4 include:

4 kbyte Flash ROM or 208 Byte SRAM

6+6 PWM x 1

10-bit ADC x 4

8-bit Basic Timer (can be used as watchdog timer)

16-bit Timer0 (can be used as Timer A or B, the two 8-bit Timers )

EXINT X 2

Supports Configurable LVR (2.2/ 3.0/ 3.9V)

Supports Configurable RC (1M/ 8MHz @5V)

Supports six IOs (maximum) when using internal LVR and internal RC
1.3 SYSTEM PRINCIPLE
The two considerations for HPLED are:
1. Forward voltage
2. Constant control current
Different LED applications have different characteristics. For instance, LEDs come in different colors. In some
cases, manufacturers of the LED applications might also differ. Even if the LED applications come from the same
manufacturer, it can lead to differences in forward voltage. In such cases, constant voltage power cannot work.
Different LED applications should select different power suppliers according to its characteristics. For instance, by
considering efficiency, switch module power supplier (SMPS) can be chosen for different LED applications. SMPS
consists of Buck, Boost, or Buck-Boost circuits.
D
VO
VI . It is only used when the power supply is higher than the forward
D
VO  VI
VO . It is only used when the forward voltage is higher than the power
The duty cycle of Buck circuit is
voltage, that is,
VO  VI
.
The duty cycle of Boost circuit is
supply, that is,
VO  VI
.
D
The duty cycle of Buck-Boost circuit is
supply and forward voltage.
VO
VO  VI . It can be used without considering the relationship of power
In this application, buck circuit is chosen to power a HKP-D1W1 white LED (forward voltage 3.5V) with a DC
power source of 5V.
Samsung Confidential
8
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
1 OVERVIEW OF HPLED LIGHTING CONTROL SYSTEM
1.3.1 BUCK CIRCUIT
Figure 1-2
Simplified Buck Circuit
Buck circuit works when a switch signal turns on the transistor (Q). The DC power then starts to charge the coil
(L). When the current reaches a predefined level, change the transistor state from On to Off using the switch
signal. At this time, since the coil will have inertia to keep the current direction, the load still can be powered with a
freewheeling diode until the switch signal turns on the transistor again. The resulting current is continuous but
alternating (see Figure 1-3 for more details).
Figure 1-3
Current on load
1.3.2 SUMMARY

The average current over load is determined by the duty cycle of switch signal.

SMPS can lead to current ripple. But it could be alleviated by increasing the PWM frequency or coil
inductance value, or by adding extra filtering circuits.
Samsung Confidential
9
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
1 OVERVIEW OF HPLED LIGHTING CONTROL SYSTEM
1.3.3 CONSTANT CURRENT CONTROL
Refer to the HKP-D1W1 datasheet to see the relationship of forward voltage, forward current, and relative
luminous flux.
Figure 1-4
HKP-D1W1 Forward Voltage, Forward Current, and Relative Luminous Flux
As shown in Figure 1-4, describing the luminous flux as a function of current is better than describing it as a
function of voltage. Even a slight change of voltage might lead to significant current shift. Therefore, constant
current control is used in HPLED applications.
Samsung Confidential
10
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
2
2 HARDWARE IMPLEMENTATION
HARDWARE IMPLEMENTATION
2.1 SYSTEM DIAGRAM AND CIRCUIT
Figure 2-1
Control Circuit
As shown in Figure 2-1, the Buck Circuit comprise of Q1, L1, D1, and C2. The output of PWM turns on/off the
transistor (Q1). The current over HPLED is sensed by a 1ohm power resistor. It then goes into S3F84P4’s ADC
module after passing through a filter composed of R4 and C3.
Brightness can be obtained by changing the PWM duty cycle after comparing the actual sensing value and target
forward current. This application uses two external interrupts (“ENINT” and “GPIO” as shown in Figure 2-1) as
keys to control the turn-on/off and brightness. A normal LED indicates the current brightness as full or half
brightness.
Samsung Confidential
11
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
2 HARDWARE IMPLEMENTATION
2.2 COMPONENTS SELECTION
Assume the following two conditions:
VO  (VFW  I FW 1ohm)  3.5  0.35  3.85V
VI  5V
If non-divided system clock is selected as the clock source of the 6+6 PWM, its base frequency
f OSC
 125 KHz
6
is 2
.
2.2.1 SELECT THE INDUCTANCE (L1) FOR THE REQUIREMENT OF CURRENT RIPPLE
L1 
V

I
T
(VI  VO ) 
D
f PWM
I ripple
L1  I ripple  (5  3.85) 
3.85
 7.084 
5  125K
Therefore, 20% current ripple means
L1  100uH .
2.2.2 SELECT THE CAPACITANCE (C2) FOR THE REQUIREMENT OF VOLTAGE RIPPLE
To reduce the voltage ripple and power loss, a capacitor with small ESR like Tantalum Capacitor should be
chosen as C2. When ESL and ESR are negligible, then,
I
C2 
f PWM
Vripple
C2  Vripple 
0.35*0.2
 0.56 
125K
Therefore, 1% voltage ripple means
C2  47uF .
The freewheeling diode should be a Schottky diode, as the system requires low turn-on voltage and fast switching.
Samsung Confidential
12
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
3
3 SOFTWARE IMPLEMENTATION
SOFTWARE IMPLEMENTATION
Figure 3-1 shows the software implementation.
Initialization
ADC sampling
Value > max?
Decrease PWM
duty cycle
Vale < min?
Increase PWM
duty cycle
Figure 3-1
Software Implementation Diagram
Since the PWM in S3F84P4 is 6+6 type, it affects the software in two ways.

Way to change the PWM duty cycle: The duty cycle is the result of both the register values of PWMDATA and
PWMEX. Therefore, any increase or decrease in register from PWMDATA will not change the duty cycle. For
more details on register PWMEX, refer to the S3F84P4 User’s Manual. Figure 3-2 shows the right way to
change the PWM duty cycle.
Samsung Confidential
13
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
3 SOFTWARE IMPLEMENTATION
Start
Start
Y
PWMEX>=
11111100B?
PWMEX>=100B?
N
PWMEX = 0xFF
PWMDATA - =1
N
PWMEX - =1
End
PWMEX + = 1
PWMEX = 0
PWMDATA + =1
End
Decrease PWM duty cycle
Increase PWM duty cycle
Figure 3-2

Y
Way to change PWM duty cycle
Change rate of PWM duty cycle: If PWM in S3F84P4 is 6+6 type, the PWM basic frequency is 6-bit, that
f PWM 8MHz

 125KHz
6
f
 8MHz . The overall cycle is still 12-bit to make the 12-bit
64
when PWM
is, 2
212
4096

 0.512ms
f
8
MHz
PWM
resolution fully valid, that is,
. So Therefore, every change of the duty cycle will
take effect after 0.512ms. Considering the AD conversion duration is 25us, duty cycle can be updated every
21 times of AD conversion.
Samsung Confidential
14
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
4
4 SYSTEM VALIDATION
SYSTEM VALIDATION
Figure 4-1 shows the current ripple and voltage ripple test waveform. Red and blue colors specify the current and
voltage, respectively.
Figure 4-1
Vs
Rs
efficiency 
( I ps  I MCU )  V ps
Waveform for HPLED forward voltage and current
(V fd  Vs ) 
and
V ps  5V
Based on the above formulas, Table 1 shows the values of Ips, Imcu, Vfd, Vs, and efficiency (%).
Samsung Confidential
15
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
Table 4-1
4 SYSTEM VALIDATION
System validation of efficiency
#1
#2
#3
#4
#5
BD1
BD2
BD1
BD2
BD1
BD2
BD1
BD2
BD1
BD2
Ips (power supply) (mA)
300
288
306
285
300
288
309
290
308
304
Imcu (mA)
(MCU供电LED)
18
19
18
19
18
19
18
19
18
19
Vfd V)
3.82
3.6
3.85
3.60
3.86
3.6
3.90
3.59
3.90
3.65
Vs mV)
357
340
359
340
351
340
359
341
358
360
87.68
81.6
87.03
82.5
87.35
81.6
87.37
80.95
87.45
81.11
Efficiency(%)
NOTE: BD1 and BD2 represent two boards, where the basic difference lies in the value of sensing resistance,
RS ( BD1)  1.0 ; RS ( BD 2)  1.1 . Due to the same reason, the efficiency of BD2 is always better than that
of BD1. The nominal tolerance of VISHAY WSR2 is 1%.
Samsung Confidential
16
S3F84P4_AN_REV0.00 (PRELIMINARY SPEC)
5
5 APPENDIX
APPENDIX
5.1 BOM LIST OF KEY CIRCUIT
Table 5-1 shows the BOM list of key circuit.
Table 5-1
Reference
BOM list of Key Circuit
Description
Manufacturer
R1
1K ohms
R2
10 ohms
Rs
Current sensing Resistor
C1
104
C2
47uF Tantalum Capacitor
C3
2nF
C4
100uF
R4
33K ohms
Q1
HEXFET Power MOSFET
D1
Schottky Diode
L1
100 uH inductance
TDK
HPLED
1W1 HPLED
HangKe
Part number
VISHAY
WSR21R000FEA
IR
IRF9540
IN5819
VLF12060-101M1R0
5.2 APPENDIX 2: SOURCE CODE
For more information, refer to Source_Code_LED_S3F84P4_V10.
Samsung Confidential
17
Download PDF