Controlling High Brightness LED by using 78K0/Ix2 AN

To our customers,
Old Company Name in Catalogs and Other Documents
On April 1st, 2010, NEC Electronics Corporation merged with Renesas Technology
Corporation, and Renesas Electronics Corporation took over all the business of both
companies. Therefore, although the old company name remains in this document, it is a valid
Renesas Electronics document. We appreciate your understanding.
Renesas Electronics website: http://www.renesas.com
April 1st, 2010
Renesas Electronics Corporation
Issued by: Renesas Electronics Corporation (http://www.renesas.com)
Send any inquiries to http://www.renesas.com/inquiry.
Notice
1.
2.
3.
4.
5.
6.
7.
All information included in this document is current as of the date this document is issued. Such information, however, is
subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please
confirm the latest product information with a Renesas Electronics sales office. Also, please pay regular and careful attention to
additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website.
Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights
of third parties by or arising from the use of Renesas Electronics products or technical information described in this document.
No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights
of Renesas Electronics or others.
You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part.
Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of
semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software,
and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by
you or third parties arising from the use of these circuits, software, or information.
When exporting the products or technology described in this document, you should comply with the applicable export control
laws and regulations and follow the procedures required by such laws and regulations. You should not use Renesas
Electronics products or the technology described in this document for any purpose relating to military applications or use by
the military, including but not limited to the development of weapons of mass destruction. Renesas Electronics products and
technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited
under any applicable domestic or foreign laws or regulations.
Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics
does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages
incurred by you resulting from errors in or omissions from the information included herein.
Renesas Electronics products are classified according to the following three quality grades: “Standard”, “High Quality”, and
“Specific”. The recommended applications for each Renesas Electronics product depends on the product’s quality grade, as
indicated below. You must check the quality grade of each Renesas Electronics product before using it in a particular
application. You may not use any Renesas Electronics product for any application categorized as “Specific” without the prior
written consent of Renesas Electronics. Further, you may not use any Renesas Electronics product for any application for
which it is not intended without the prior written consent of Renesas Electronics. Renesas Electronics shall not be in any way
liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an
application categorized as “Specific” or for which the product is not intended where you have failed to obtain the prior written
consent of Renesas Electronics. The quality grade of each Renesas Electronics product is “Standard” unless otherwise
expressly specified in a Renesas Electronics data sheets or data books, etc.
“Standard”:
8.
9.
10.
11.
12.
Computers; office equipment; communications equipment; test and measurement equipment; audio and visual
equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots.
“High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anticrime systems; safety equipment; and medical equipment not specifically designed for life support.
“Specific”:
Aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or
systems for life support (e.g. artificial life support devices or systems), surgical implantations, or healthcare
intervention (e.g. excision, etc.), and any other applications or purposes that pose a direct threat to human life.
You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics,
especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation
characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or
damages arising out of the use of Renesas Electronics products beyond such specified ranges.
Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have
specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further,
Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to
guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a
Renesas Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire
control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because
the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system
manufactured by you.
Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental
compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable
laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS
Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with
applicable laws and regulations.
This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written consent of Renesas
Electronics.
Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this
document or Renesas Electronics products, or if you have any other inquiries.
(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majorityowned subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
Application Note
Controlling High Brightness LED by using
78K0/Ix2
This document describes a reference design for controlling a high brightness LED by using various
functions mounted onto the 78K0/Ix2 microcontroller. Specifically, the document describes methods for
driving a constant current and dimming LED by using the PWM output and internal analog peripherals
(comparator and A/D converter) of 78K0/Ix2 microcontroller.
Target devices
78K0/IY2 microcontroller
78K0/IA2 microcontroller
78K0/IB2 microcontroller
Document No. U19666EJ1V0AN00 (1st edition)
Date Published March 2009 NS
2009
Printed in Japan
CONTENTS
CHAPTER 1 INTRODUCTION............................................................................ 3
1.1 78K0/Ix2 Features for High Brightness LED Control ............................ 3
1.2 System Overview ..................................................................................... 4
CHAPTER 2 CONTROL THEORY...................................................................... 5
2.1 Buck Converter Basics............................................................................ 5
2.2 Constant Current Control Method .......................................................... 7
2.2.1 Internal comparator feedback ....................................................... 8
2.2.2 Internal A/D converter feedback ................................................. 11
2.3 Dimming Control .................................................................................... 14
2.3.1 DC dimming ................................................................................ 14
2.3.2 PWM dimming ............................................................................ 16
2.4 User Interface ......................................................................................... 17
2.4.1 Internal A/D converter control interface ...................................... 17
2.4.2 DMX512 protocol communication control interface .................... 21
2.4.3 DALI protocol communication control interface .......................... 25
APPENDIX A REFERENCE CIRCUIT DIAGRAM (EZ-0005) ........................... 27
APPENDIX B REFERENCE PARTS TABLE (EZ-0005) ................................. 29
APPENDIX C EXAMPLE INTERNAL REFERENCE VOLTAGES AND PWM
OUTPUT DUTY PARAMETERS (FOR INTERNAL
COMPARATOR FEEDBACK) ................................................... 31
APPENDIX D EXAMPLE A/D CONVERTER EXPECTED VALUES AND
PWM OUTPUT DUTY PARAMETERS (FOR INTERNAL A/D
CONVERTER FEEDBACK) ....................................................... 32
• The information in this document is current as of March, 2009. The information is subject to change
without notice. For actual design-in, refer to the latest publications of NEC Electronics data sheets or
data books, etc., for the most up-to-date specifications of NEC Electronics products. Not all
products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
• No part of this document may be copied or reproduced in any form or by any means without the prior
written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may
appear in this document.
• NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document
or any other liability arising from the use of such products. No license, express, implied or otherwise, is
granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
• Descriptions of circuits, software and other related information in this document are provided for illustrative
purposes in semiconductor product operation and application examples. The incorporation of these
circuits, software and information in the design of a customer's equipment shall be done under the full
responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by
customers or third parties arising from the use of these circuits, software and information.
• While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC
Electronics products, customers must incorporate sufficient safety measures in their design, such as
redundancy, fire-containment and anti-failure features.
• NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
"Standard": Computers, office equipment, communications equipment, test and measurement equipment, audio
and visual equipment, home electronic appliances, machine tools, personal electronic equipment
and industrial robots.
"Special": Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed
for life support).
"Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
M8E 02. 11-1
2
Application Note U19666EJ1V0AN
CHAPTER 1 INTRODUCTION
This document describes a reference design for a high brightness LED control application using the 78K0/Ix2
microcontroller.
1.1
78K0/Ix2 Features for High Brightness LED Control
High brightness LED control using the 78K0/Ix2 microcontroller has the following features:
• The LED constant current drive can be controlled by using a PWM timer (TMXn: n = 0, 1) and analog
peripheral (comparator or A/D converter) mounted onto the 78K0/Ix2. This will help you to remove the LED
driver IC.
Two constant current feedback methods can be used for the 78K0/Ix2:
- Comparator feedback
- 10-bit A/D converter feedback
• Dimming can be controlled by using a comparator or PWM timer mounted onto the 78K0/Ix2.
Two LED dimming methods can be used for the 78K0/Ix2:
- DC dimming by changing the internal programmable reference voltage for the comparator
- PWM dimming by using the PWM timer (TMH1)
• The high brightness LED be controlled by using the A/D converter or communication functions mounted onto
the 78K0/Ix2.
Three control methods can be used for the 78K0/Ix2:
- Volume control by using the 10-bit A/D converter
- DMX512 protocol communication control by using UART (78K0/IA2 and 78K0/IB2 only)
- DALI protocol communication control by using UART (in DALI mode) (78K0/IA2 and 78K0/IB2 only)
Remark
The control method introduced in this application note can be evaluated using the 78K0/IB2 HBLED
evaluation board (EZ-0005) offered by NEC Electronics. Please visit to the following website for details
about the evaluation board:
• URL: http://www.necel.com/micro/en/solution/lighting/index.html
Application Note U19666EJ1V0AN
3
CHAPTER 1 INTRODUCTION
1.2
System Overview
Figures 1-1 and 1-2 show block diagrams for three-channel LED control by using the 78K0/Ix2 microcontroller.
Figure 1-1. Block Diagram of 3-Channel LED Control Using 78K0/Ix2 Microcontroller
(Feedback by Comparators)
DALI
DMX512
16-bit
TMX0,1
8-bit
OSC
TMH1
20 MHz
Comparator
CPU
UART
(DALI)
Cnt.
40 MHz
10-bit
ADC
CH-1
CH-2
CMP0+
Vref
Volume
CH-0
PWM
CMP1+
Vref
CMP2+
Vref
78K0/Ix2 Microcontroller
Figure 1-2. Block Diagram of 3-Channel LED Control Using 78K0/Ix2 Microcontroller
(Feedback by10-bit A/D Converter)
DALI
DMX512
UART
(DALI)
OSC
20 MHz
16-bit
TMX0,1
8-bit
TMH1
CPU
10-bit
ADC
Cnt.
40 MHz
PWM
CH-1
CH-2
ANIx
ANIx
ANIx
Volume
78K0/Ix2 Microcontroller
4
CH-0
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
2.1 Buck Converter Basics
By using the timer and either the comparators or A/D converter integrated into 78K0/Ix2 microcontroller, constant
current control is possible.
This enables high brightness LED control without using a separate LED-dedicated constant current driver IC.
Figure 2-1 shows the basic of buck converter configuration.
Figure 2-1. Buck Converter Basics
IL
Vf
Vi
VD
Vo
Vs
A buck converter operates using an inductor (L), a switch (SW), and a diode (D). Figure 2-2 shows an example of
constant current control using a buck converter while PWM output controls the switch (SW).
Application Note U19666EJ1V0AN
5
CHAPTER 2 CONTROL THEORY
Figure 2-2. Constant Current Control
tON
tOFF
tON
tOFF
tON
PWM
output
0
charge
discharge
charge
discharge
charge
IL
0
When the switch (SW) is on, the voltage bias on the inductor becomes (Vi – Vo), and the current increases
according to following equation:
| IL(ON) | = [ (Vi – Vo) × tON ] / L
While the switch (SW) is off, the current through the inductor (L) decreases according to the following equation
during the off period (tOFF):
| IL(OFF) | = [ (Vo – VD) × tOFF ] / L
Assuming the converter operates in a steady state, the current is constant and can be calculated the following
equation:
| IL(ON) | = | IL(OFF) |
These two periods repeat. The converter is regulated by varying the duty cycle of the power switch according to the
load conditions. To achieve this, the power switch requires electronic control for proper operation. It is possible to
determine the duty cycle as follows:
Duty = tON / t (switching cycle (t): tON + tOFF)
Duty = Vo / Vi
An example of selecting an inductor (L) and a sense resistor (RS) is shown here.
When using a constant current to control LEDs, the forward current must be kept constant. When detecting the
forward current using a sense resistor, the sense voltage (Vs) is as follows:
VS = IL × RS
To drive LEDs at a better power efficiency, the sense voltage (Vs) must be minimized. In contrast, to achieve higher
dimming resolution, higher sense voltage (Vs) is required. In addition, to reduce the error margin for the sense voltage,
accurate sense resistors must be selected.
Suppose the typical forward current of a selected LED is 300 mA. Select the sense voltage (VS) as 1.4 V during full
output. The sense resistor (RS) should be 4.7 Ω (1 W).
1.4 (V) = 0.3 (A) × RS
RS = 1.4 (V) / 0.3 (A) ≈ 4.7 Ω
6
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
The inductor value can be decided by the following equations:
VL = L × di / dt
L = (Vi – VO) × Duty × t / Iripple
Duty = Vo / Vi
Iripple (target) < IL × 1.5 [%]
To realize 8-bit resolution for switching duty when using PWM output, the 78K0/Ix2 microcontroller can output a
8
156.25 kHz PWM signal (40 MHz/2 ) from 16-bit timers X0 and X1 by using a 40 MHz clock source.
So, t =1 / f =1 / 156.25 kHz
For an input voltage (Vi) of 5 V, the LED forward voltage (Vf) of 3.5 V, and a sense voltage (VS) of 1.4 V, an inductor
(L) larger than 140 μH is suitable for this feedback circuit.
L > (Vi – VO) × Duty × t / Iripple
L > (5.0 – 4.9) × (4.9/5) × (1/156250) × (1/0.3 × 1.5 % or 0.015)
L > 139.38 [μ H]
2.2 Constant Current Control Method
As shown in Figure 2-2, to perform control at a constant current, it is necessary to keep the sense voltage (Vs)
through the sense resistor (Rs) the same as the target reference voltage. If the sense voltage (VS) is higher than the
reference voltage, the PWM output duty must be reduced to reduce a mount of time that the MOSFET switch is on
and the current (sense voltage). In contrast, if the sense voltage (VS) is lower than the reference voltage, the PWM
output duty must be increased to increase the mount of time that the MOSFET switch is on and the current (sense
voltage).
To compare the sense voltage and reference voltage adjusted by controlling PWM output, a method that uses the
78K0/Ix2 comparators and one that uses the 78K0/Ix2 A/D converter are available. The features of these methods are
as follows:
• Comparator feedback:
Because the CPU is not accessed before comparator interrupts occur, the software load can be reduced.
• A/D converter feedback:
Because converted values are immediately compared, the ripple of current is smaller and the dimming resolution
can be higher. However, the CPU is used to perform all channel switching and comparison for A/D converter.
PWM output for MOSFET switching is performed using the 16-bit timers X0 and X1. A 156.25 kHz switching
frequency is available because these timers use a 40 MHz clock as a counting source with a resolution of 8 bits (40
8
MHz/2 ).
Application Note U19666EJ1V0AN
7
CHAPTER 2 CONTROL THEORY
2.2.1 Internal comparator feedback
The 78K0Ix2 microcontroller has three internal comparators with programmable internal voltage references, so that
three channels of LEDs can be driven independently using a comparator feedback method.
Specify the valid edge of the comparator interrupt to be both edges. The comparator interrupt occurs while the
sense voltage (Vs) is higher or lower than the reference voltage. When this interrupt occurs, execute constant current
feedback control by adjusting the PWM duty cycle.
When a comparator interrupt occurs, use the CMPnF flag to compare the comparator output level with expected
value to avoid misjudgment caused by noise. Set the expected level of comparator output to the high level when
increasing the duty. Set the expected level to the low level when reducing the duty.
By comparing the comparator output level with the expected value, changes in the duty due to unexpected noise
can be avoided.
Figure 2-3. Example of Internal Comparator feedback
Turn to higher
duty
Turn to lower
duty
Turn to higher
duty
Turn to lower
duty
PWM output
(TMXxx)
Internal comparator output
(CMPnF flag)
Sense voltage (Vs) input
Vref
Change duty
Change duty
Change duty
Change duty
Figure 2-4. Example of Avoiding Misjudgment Caused by Noise
A
B
(High)
Expected level of
internal comparator output
B
(High)
(Low)
(High)
Internal comparator output
(CMPnF flag)
(Low)
(Low)
Sense voltage (Vs) input
Vref
Noise
A: CMPnF does not match the expected level. Adjust the wave as noise.
B: CMPnF matches the expected level. Feedback processing is required.
The higher duty and lower duty parameters are stored beforehand. For the higher duty, a sense voltage over the
target level is output. A lower duty causes a sense voltage under the target level. It is possible to determine these two
parameters by experimenting.
An example of data table based on the evaluation board (EZ-0005) is provided in Appendix C.
8
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
Figure 2-5. Flowchart of Comparator Feedback (1/2)
(Main processing)
Reset start
Initialization,
start the timer X,
start the comparator
CH0 feedback processing
CH1 feedback processing
CH2 feedback processing
Interface control
processing
(Comparator n interrupt processing: n = 0 to 2)
INTCMPn interrupt processing
CMPn output = expected level
of comparator output?
No
Yes
Set the CMPn interrupt mask flag,
reverse expected level of comparator output,
set the CHn feedback flag
INTCMPn interrupt
processing end
Caution
Feedback processing is executed according to the results of comparator interrupt processing.
Remark
The CHn feedback flag is used to indicate whether the PWM output changing processing is enabled or
disabled.
Application Note U19666EJ1V0AN
9
CHAPTER 2 CONTROL THEORY
Figure 2-5. Flowchart of Comparator Feedback (2/2)
(Comparator n feedback processing: n = 0 to 2)
CHn feedback processing
No
CHn feedback flag on?
Yes
No
Expected level of
comparator = ”low”?
Yes
Set duty to lower level
Set duty to higher level
Clear the CHn feedback flag,
clear the CMPn interrupt request flag,
clear the CMPn interrupt mask flag
CHn feedback processing end
Caution
Feedback processing is executed according to the results of comparator interrupt processing.
Remark
The CHn feedback flag is used to indicate whether the PWM output changing processing is enabled or
disabled.
Figure 2-6 shows the data measured using the comparator feedback.
Figure 2-6. Measure Data of Sense Voltage (VS) (Comparator Feedback)
Remark
The circuit constants are below.
• Inductor (L): 150 μH
• Sense resistor (RS): 4.7 Ω
• LED forward current: 300 mA
10
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
2.2.2 Internal A/D converter feedback
The 78K0Ix2 microcontroller has an A/D converter that consists of up to 9 channels with a resolution of 10 bits, so
that several LEDs can be driven independently using an A/D converter feedback method.
If the A/D converter is set up to operate at the shortest conversion time which is 3.3 μs, feedback processing for
each channel can be executed every 20 μs.
The maximum and minimum target values of the A/D conversion results (the reference value for the sense voltage
(Vs)) can be decided based on the detection accuracy of the target current. If the input voltage (Vi) = VDD = 5 V, the
sense voltage (Vs) = 1.4 V, and the ratio to define is 2%, the target range of A/D conversion result is supposed to
approximately equal to the target level ±5LSB.
When the A/D conversion result is over the maximum while increasing compared with the last result, step down the
duty. When the A/D conversion result becomes smaller than the minimum while decreasing compared with the last
result, step up the duty.
To speed up the startup period of LEDs, set the duty of PWM output to the target duty related to the target A/D
converter level before starting the timer X and the A/D converter.
While the A/D conversion result is almost 0, directly set the duty to the target value corresponding to the target A/D
converter level.
The target duty related to each target level can be determined by experimenting.
An example of data table based on the evaluation board (EZ-0005) is provided in Appendix D.
Figure 2-7. Example of Internal A/D Converter Feedback
Set to target duty
Turn to lower Turn to higher
duty
duty
Turn to lower
duty
Turn to higher
duty
Change duty
Judge by A/D conversion result
PWM output
(TMXxx)
Not change duty
Maximum
Target level
(reference level of sense voltage (VS ))
Target range
Sense voltage input
(ANIx)
Minimum
0
Application Note U19666EJ1V0AN
11
CHAPTER 2 CONTROL THEORY
Figure 2-8. Flowchart of A/D Converter Feedback (1/2)
(Main processing)
Reset start
Initialization,
start the timer X,
start the A/D converter
Interface control
processing
(A/D Converter interrupt processing)
INTAD interrupt
processing
Read out the A/D conversion result,
set the A/D interrupt mask flag
Measured CH0?
Yes
CH0 feedback
processing
No
Measured CH1?
No
Yes
CH1 feedback
processing
INTAD interrupt
processing end
12
Application Note U19666EJ1V0AN
Measured CH2?
Yes
CH2 feedback
processing
No
CHAPTER 2 CONTROL THEORY
Figure 2-8. Flowchart of A/D Converter Feedback (2/2)
(CHn feedback processing )
CHn feedback processing
Turn to the next A/D conversion
channel,
clear the A/D interrupt mask flag
A/D conversion result
≈0? (to avoid noise
and A/D conversion
errors)
No
A/D conversion result >
last result?
(current increasing?)
Yes
Set TMXn to output the
target duty
No
Yes
No
A/D conversion result >
Maximum value?
(over the target range?)
A/D conversion result <
Minimum value?
(under the target range?)
No
Yes
Yes
Is it out of the range if setting
the duty to lower level?
No
Set to the duty
to lower level
Yes
Is it out of the range if
setting the duty to higher
level?
Yes
No
Set to the duty
to higher level
Store the A/D conversion
result as the latest one
CHn feedback processing end
Figure 2-9 shows the data measured using A/D converter feedback.
Figure 2-9. Measure Data of Sense Voltage (VS) (A/D Converter Feedback)
Remark
The circuit constants are below.
• Inductor (L): 150 μH
• Sense resistor (RS): 4.7 Ω
• LED forward current: 300 mA
Application Note U19666EJ1V0AN
13
CHAPTER 2 CONTROL THEORY
2.3 Dimming Control
Dimming means change the brightness of LED. Dimming can be controlled by changing the LED forward current.
Here, two dimming methods for the 78K0/Ix2 microcontroller are introduced: DC dimming and PWM dimming.
2.3.1 DC dimming
(1) Dimming by changing the internal reference voltage
The 78K0/Ix2 microcontroller can generate 3 internal reference voltages independently for each internal
comparator, which can be divided into 32 steps.
As expressed in 2.2, the 78K0/Ix2 microcontroller monitors the sense voltage (VS) and compares it to a stable
reference to keep the current constant. Changing the reference voltage helps the circuit constantly keep the
current as a different level. Dimming requirements depend on communication and user setting.
For the comparator feedback, change the internal reference voltage of each comparator. Also change higher
duty and lower duty parameters.
The internal reference voltage can be changed in 32 steps in the range from 0.05 V (typ.) to 1.6 V (typ.). To
increase the dimming resolution, set the sense voltage (Vs) when driving current at the maximum brightness to
as high a value as possible in the range of the internal reference voltage.
Figure 2-10. Flowchart of Dimming for Changing Internal Reference Voltage
There is a dimming requirement of
CHn
Stop CMPn,
change the internal reference voltage,
change the PWM output duty for the constant
current control,
set the initial PWM output duty to 100%,
start CMPn
CHn dimming processing end
14
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
(2) Dimming by changing the target level for the A/D conversion result
The 78K0Ix2 microcontroller has an A/D converter with a resolution of 10 bits.
For the A/D converter feedback, change the parameter target level. Also change the target duty.
The Reference voltage for the maximum brightness is selected by considering the hardware design and the
limit of the A/D converter reference voltage. The dimming step number is decided by using maximum reference
voltage and error margin for the target level.
To increase the dimming resolution, set the sense voltage (Vs) when driving current at the maximum
brightness to as high a value as possible within the range of voltages for which A/D conversion is possible
(AVREF or less).
Figure 2-11. Flowchart of DC Dimming by Changing Target Level for A/D conversion Result
There is a dimming requirement of CHn
Set the A/D interrupt mask flag,
change the reference level of A/D conversion result ,
change the PWM output duty for the constant
current control,
clear the last A/D conversion result,
set the initial PWM output duty,
clear the A/D interrupt request flag,
clear the A/D interrupt mask flag
Set the A/D conversion channel to one of the
feedback channels
During feedback with A/D converter
CHn dimming processing end
Application Note U19666EJ1V0AN
15
CHAPTER 2 CONTROL THEORY
2.3.2 PWM dimming
78K0/Ix2 microcontroller includes a function that performs gate control for the signals output by the 16-bit timers X0
and X1 by using the output of the 8-bit timer H1.
Keeping the reference voltage at the maximum level, LEDs can be dimmed in 255 steps by using the TMXn output
gate function via the TMH1 output. A square PWM wave output by the 8-bit timer H1 can be set to control all 4 TMXn
outputs. If TOH1 is combined with the outputs of 16-bit timers X0 and X1, the TMXn output is only enabled when the
TOH1 output is at high level or low level.
While using PWM dimming via TMH1, all TMX outputs will start or stop at the same time. Therefore, this method
can be used to dim the LEDs of all channels at the same time.
Figure 2-12. Example Timing Chart of TMX0 and TMX1 Output Gate Function via TMH1 Output
TOH1 output
(internal output)
TMXxx output
(internal output)
TOXxx pin output
Considering the startup speed of each channel, it seems the TMH1 output frequency should be selected to be as
low as possible. However, the limitations of the human eye also affect this decision. A 100 Hz frequency is usually
assumed to be sufficient for avoiding flicker, which means the frequency should be higher than 100Hz.
Figure 2-13. Sense Voltage and TOXxx Output Measurement Data (PWM Dimming via TMH1 Output)
TOXxx pin output
Sense voltage (Vs)
16
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
2.4 User Interface
The user can assign dimming requirements by using the user interface mounted onto the 78K0/Ix2 microcontroller.
Three interfaces are introduced here:
A/D converter control interface, DMX512 control interface, and DALI (Digital Addressable Lighting Interface)
control interface
2.4.1 Internal A/D converter control interface
The 78K0Ix2 microcontroller has an A/D converter that consists of up to 9 channels. Volume switches, sensors or
some other analog inputs can be connected to these analog input pins as the dimming requirement trigger.
Except the ones used for the feedback input, all A/D converter input pins are available. While using the A/D
converter feedback, the feedback channels and the user interface channels use the same the A/D converter interrupt.
This results in different flowcharts for the A/D converter interface with the comparator feedback as opposed to the A/D
converter feedback.
Figure 2-14. Flowchart of A/D Converter Control Interface (Comparator Feedback) (1/2)
(Main processing)
Reset start
Initialization,
start the timer X,
start the comparator,
start the A/D converter,
start the timer 51
CH0 feedback processing Note
CH1 feedback processing No te
CH2 feedback processing No te
Dimming processing by
switching volume
Note For the comparator feedback, see 2.2.1 Internal comparator feedback.
Caution
A/D conversion starts when the interrupt of 8-bit timer 51 occurs. LEDs are dimmed using the
volume switches according to the result of A/D converter interrupt servicing.
Application Note U19666EJ1V0AN
17
CHAPTER 2 CONTROL THEORY
Figure 2-14. Flowchart of A/D Converter Control Interface (Comparator Feedback) (2/2)
(Interrupt processing: A/D converter, 8-bit timer 51)
INTAD interrupt processing
INTTM51 interrupt processing
Read out the A/D conversion result,
set the dimming data detection status flag,
stop A/D conversion
Reset the A/D conversion channel,
start A/D conversion
INTTM51 interrupt processing end
INTAD interrupt processing end
(Dimming processing by switching volume)
A/D interface dimming processing
New dimming
data received?
No
Yes
A/D conversion result
for LED CH0 control?
No
A/D conversion result
for LED CH1 control?
No
A/D conversion result
for LED CH2 control?
Yes
Yes
Yes
CH1 control parameter set
processing
CH0 control parameter set
processing
No
CH2 control parameter set
processing
Clear the dimming data
detection status flag
A/D interface dimming processing end
(CHn control parameter set processing)
CHn control parameter set
processing
AD conversion result
= 0?
Yes
Stop the timer X output
No
Based on the A/D conversion result:
• Change the comparator reference voltage
• Change the PWM output duty of the timer X
(start the timer X)
CHn control parameter set
processing end
Caution
A/D conversion starts when the interrupt of 8-bit timer 51 occurs. LEDs are dimmed using the
volume switches according to the result of A/D converter interrupt servicing.
Remark
The dimming data detection status flag is used to indicate whether the dimming processing by switching
volume is enable or disable.
18
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
Figure 2-15. Flowchart of A/D Converter Control Interface (A/D Converter Feedback) (1/2)
(Main processing)
Reset start
Initialization,
start the timer X,
start the A/D conversion,
start the timer 51
Main loop
(Interrupt processing: 8-bit timer 51)
INTTM51 interrupt processing
Is the last I/F channel
the I/F CH2?
No
Yes
Turn to I/F CH0
Turn to I/F CHn+1
Clear the A/D interrupt request flag,
clear the A/D interrupt mask flag
INTTM51 interrupt processing end
Remark
I/F CHn: A/D conversion channels for LED CHn control interface
Application Note U19666EJ1V0AN
19
CHAPTER 2 CONTROL THEORY
Figure 2-15. Flowchart of A/D Converter Control Interface (A/D Converter Feedback) (2/2)
(Interrupt processing: A/D converter)
INTAD interrupt processing
Read out the A/D conversion result,
set the A/D interrupt mask flag
A/D
conversion by
using F/B
CH0?
No
Yes
A/D
conversion
by using F/B
CH1?
Yes
CH0 feedback
processing Note
A/D
conversion
by using F/B
CH2?
No
No
Yes
CH2 feedback
processing Note
CH1 feedback
processing Note
A/D
conversion
by using I/F
CH0?
A/D
conversion
by using I/F
CH1?
No
Yes
Yes
CH0 dimming
processing
No
A/D
conversion
by using I/F
CH2?
No
Yes
CH1 dimming
processing
CH2 dimming
processing
INTAD interrupt processing end
(CHn dimming processing)
CHn dimming processing
AD conversion
result = 0?
Yes
Stop the timer X
output
No
Set the A/D interrupt mask flag,
based on A/D conversion result:
• Change the reference level of the A/D conversion result
• Change the PWM output duty for the constant current control
clear the last A/D conversion result,
set the initial PWM output duty,
clear the A/D interrupt request flag,
clear the A/D interrupt mask flag
Set the A/D conversion channel to one of
the feedback channels
CHn dimming processing
end
Note For the CHn feedback processing, see 2.2.2 Internal A/D converter feedback.
Remark
F/B CHn: A/D conversion channels for LED CHn feedback processing
I/F CHn:
20
A/D conversion channels for LED CHn control interface
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
2.4.2 DMX512 protocol communication control interface
The DMX data stream clocks out at a rate of 250 kHz, which means each bit is measured in 4 microseconds. The
DMX512 signal is transmitted via RS485, which is the industry standard interface.
The RS485 standard uses two or three wires to transmit digital HIs and LOs:
• The +signal wire (+s)
• The −signal wire (−s)
• The 0 wire or ground wire (0 V)
Figure 2-16 shows the DMX receiver hardware interface.
Figure 2-16. DMX512 Receiver Hardware Interface
DMX512 input signal
+S
RS485 Receiver
78K0/Ix2
microcontroller
+
Connect to RxD6 pin
(UART6)
−S
−
0V
Application Note U19666EJ1V0AN
21
CHAPTER 2 CONTROL THEORY
Figure 2-17 shows the DMX timing chart.
Figure 2-17. DMX512 Timing Chart
MTBP
IDLE
Stop bits
Start bit
MAB
8-data bits
512 flames in all
MTBF
Break
•••
DATA=0
Frame Width
Start Code
Break
Remark
Frame Width
Channel 1
Frame Width
Channel n
MIN.
TYP.
MAX.
Unit
88
88
1,000,000
μs
MAB
8
μs
Frame Width
44
μs
Start/Data/Stop bits
4
μs
MTBF
0
NS
1,000,000
μs
MTBP
0
NS
1,000,000
μs
NS: not specified
The meanings of addresses and data freely are defined by users. For example, while the DMX512 protocol is used
to control stage lighting, one lamp has several addresses and data can be defined as the brightness, position, and so
on.
The first byte after the start code (SC) is automatically taken as the data value for address 1, the next data value is
for address 2, and so on. The slave counts the data and uses that which belongs to its address to start dimming
processing.
Figure 2-18 shows the flowchart of the dimming control by the DMX512 protocol communication interface. In this
example, the 3 LED channels are controlled using independent address.
22
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
Figure 2-18. Flowchart of Dimming Control by DMX512 Protocol Communication Interface (1/2)
(Main processing)
Reset start
Initialization,
start the timer X,
start the comparator
(for feedback),Note
start the timer 51
(for time out),
start UART6 reception
(for DMX512 reception)
CH0 feedback processing
CH1 feedback processing
Note
CH2 feedback processing
DMX512 dimming
processing
(Interrupt processing: serial interface UART6 (no error during reception, error during reception), 8-bit timer 51)
INTSRE6 interrupt processing
Set the break detection status flag,
read out the error status,
read out the receive buffer
INTSRE6 interrupt
processing end
INTSR6 interrupt processing
Save the receive data,
count up the number of the receive data (up to
513)
INTSR6 interrupt
processing end
INTTM51 interrupt processing
Count up the timer out counter
INTTM51 interrupt
processing end
Note Using the comparator feedback processing only.
For the comparator feedback processing, see 2.2.1 Internal comparator feedback.
For the A/D converter feedback processing, see 2.2.2 Internal A/D converter feedback.
Caution
Dimming processing controlled by DMX512 interface starts when the serial interface UART6
receives an error interrupt.
Remark
The break detection status flag is used to show that the break time of the DMX512 signal has been
detected.
Application Note U19666EJ1V0AN
23
CHAPTER 2 CONTROL THEORY
Figure 2-18. Example Flowchart of Dimming Control by DMX512 Protocol Communication Interface (2/2)
(DMX 512 dimming processing)
DMX512 dimming processing
No
Communication idle?
Yes
Break detection
status flag on?
No
Yes
Start time out counting,
set the during reception state flag
No
During reception state flag on?
Yes
All 513 data items
received?
No
No
Time out?
Yes
Yes
Stop time out counting,
clear the number of the reception data,
set the reception completion state flag
Stop time out counting,
clear the number of the reception data,
set the error state flag
Reception completion
state flag on?
No
Yes
Target channel dimming
Set the dimming completion state flag
“dimming completion”
or “error occurred”?
dimming completion
error occurred
Communication line
returned to Idle?
No
Yes
Set the communication idle state flag
DMX512 dimming
processing end
Caution
Dimming processing controlled by DMX512 interface starts when the serial interface UART6
receives an error interrupt.
Remark
24
The status flag is used to show that the communication status has been detected during reception.
Application Note U19666EJ1V0AN
CHAPTER 2 CONTROL THEORY
2.4.3 DALI protocol communication control interface
The serial interface UART6 of the 78K0/Ix2 microcontroller supports a special mode for performing transmission
and reception as a DALI slave.
DALI stands for Digital Addressable Lighting Interface and is a royalty-free, non-proprietary, two-way, open,
interoperable digital protocol. It is a standard in the United States and Europe. This protocol is used to dim multi
ballasts or LEDs in a system. One system contains a maximum of 64 individual addressable slaves. The DALI protocol
communicates at a rate of 1,200 Hz±10 %. The master dims and brightens slaves in 256 steps. Each step of
brightness can be stored as a scene.
Figure 2-19 shows the example of the DALI slave circuit by using the 78K0/Ix2 microcontroller.
Figure 2-19. Example of DALI Slave Circuit by Using 78K0/Ix2 Microcontroller
DALI
communication line
TxD6
5V
5V
11 k
PS2561AL-1
PS2561AL-1
RxD6
22 m
4.7
1.2 k
330
10 k
78K0/Ix2
RD2.7S
3.3 k
Remarks 1. PS2561AL-1 is a photocoupler made by NEC Electronics.
2. RD2.7S is a Zener diode made by NEC Electronics.
The definitions of forward and backward message frames in the DALI communication protocol are as follows:
A forward message frame that consists of 19 bits is sent from the master:
− 1 start bit
− 1 address byte: 1 individual or group address bit, 6 address bits, 1 selection bit
− 1 data byte: 8 data bits
− 2 stop bits
A backward message frame that consists of 11 bits is sent from the slave:
− 1 start bit
− 1 data byte: 8 data bits
− 2 stop bits
Application Note U19666EJ1V0AN
25
CHAPTER 2 CONTROL THEORY
Figure 2-20. Example of DALI Receiving Timing Chart by Using 78K0/Ix2 Microcontroller
Fixed to high level
Transmission pin
(TxD6 pin)
Start bit
(1)
(0)
(0)
Address byte
(8 bits)
(0) (0) (0)
(0)
(0)
(1)
(0)
(0)
(0)
Data byte
(8 bits)
(0) (0) (1)
(0)
(1)
Stop bits
(2 bits)
Reception pin
(RxD6 pin)
Received data
Higher 8 bits: 00000001B
Lower 8 bits: 00000101B
Reception buffer
(RXBDL register)
Reception
completion interrupt
(INTSR6 signal)
Figure 2-20. Example of DALI Transmitting Timing Chart by Using 78K0/Ix2 Microcontroller
Transmission buffer
(TXB6 register)
8-bit data: 11111111B
Data byte
(8 bits)
Start bit
(1)
(1)
(1)
(1)
(1)
(1)
Stop bits
(2 bits)
(1)
(1)
(1)
Transmission pin
(TxD6 pin)
Reception pin
(RxD6 pin)
Transmission
completion
interrupt
(INTST6 signal)
For details about the DALI interface control by using 78K0/Ix2 microcontroller, see the following document.
• Controlling Fluorescent Lamp Ballasts by Using 78K0/Ix2 Application Note (Document No.: U19665)
26
Application Note U19666EJ1V0AN
APPENDIX A REFERENCE CIRCUIT DIAGRAM (EZ-0005)
Caution
Note that the evaluation board and its schematic are designed for evaluating high brightness
control using the 78K0/Ix2 microcontroller and are not intended for use in the final product.
Application Note U19666EJ1V0AN
27
APPENDIX A REFERENCE CIRCUIT DIAGRAM (EZ-0005)
28
Application Note U19666EJ1V0AN
APPENDIX B REFERENCE PARTS TABLE (EZ-0005)
Table B-1. Reference Parts Table (EX-0005) (1/2)
Item No.
C101
C103
C104
C110
C111
C201
C203
C204
C210
C211
C212
C213
C301
C303
C304
C401
C508
C510
C601
CN4
CN7
CN8
CN9
D101
D102
D103
D104
D201
D202
D203
D204
D301
D302
D303
D304
D601
D602
L101
L201
L301
Q101
Q102
Q103
Q201
Q202
Q203
Q301
Q302
Q303
Maker
MURATA
TAIYO YUDEN
MURATA
MURATA
TAIYO YUDEN
MURATA
TAIYO YUDEN
MURATA
MURATA
TAIYO YUDEN
MURATA
TAIYO YUDEN
MURATA
TAIYO YUDEN
MURATA
MURATA
MURATA
MURATA
TAIYO YUDEN
HONDA
SATO_Parts
SATO_Parts
SwitchCraft
NICHIA
ROHM
NEC Electronics
ROHM
NICHIA
ROHM
NEC Electronics
ROHM
NICHIA
ROHM
NEC Electronics
ROHM
ROHM
NEC Electronics
TDK
TDK
TDK
NEC Electronics
ROHM
NEC Electronics
NEC Electronics
ROHM
NEC Electronics
NEC Electronics
ROHM
NEC Electronics
Part No.
GRM31CR60J107M
UMK325BJ106KH-J
GRM188B11H102KA01D
GRM188B31H104KA92D
UMK325BJ106KH-J
GRM31CR60J107M
UMK325BJ106KH-J
GRM188B11H102KA01D
GRM188B31H104KA92D
UMK325BJ106KH-J
GRM188B31H104KA92D
UMK325BJ106KH-J
GRM31CR60J107M
UMK325BJ106KH-J
GRM188B11H102KA01D
GRM188B31H104KA92D
GRM188B31E105K
GRM188B31E105K
UMK325BJ106KH-J
FFC-20BMEP1
ML-800S1V-3P
ML-800S1V-2P
RAPC722
NS6R083
RB055LA-40
RD4.3FM
RB055LA-40
NS6G083
RB055LA-40
RD4.3FM
RB055LA-40
NS6B083
RB055LA-40
RD4.3FM
RB055LA-40
RB055LA-40
RD4.3FM
SLF7045T-151MR40-PF
SLF7045T-151MR40-PF
SLF7045T-151MR40-PF
μPA679TB
DTC123JM
2SJ355
μPA679TB
DTC123JM
2SJ355
μPA679TB
DTC123JM
2SJ355
Application Note U19666EJ1V0AN
Spec
100 μF/10 V
10 μF /50 V
1000 pF/50 V
0.1 μF/50 V
10 μF/50 V
100 μF/10 V
10 μF/50 V
1000 pF/50 V
0.1 μF/50 V
10 μF/50 V
0.1 μF/50 V
10 μF/50 V
100 μF/10 V
10 μF/50 V
1000 pF/50 V
0.1 μF/50 V
1 μF/25 V
1 μF/25 V
10 μF/50 V
MUSEN_YOU
ML-800S1V X3
ML-800S1V X2
RAPC722X
LED_RED
RB055L-40
RD4.3FM
RB055L-40
LED_GREEN
RB055L-40
RD4.3FM
RB055L-40
LED_BLUE
RB055L-40
RD4.3FM
RB055L-40
RB055L-40
RD4.3FM
150 μH/400 mA
150 μH/400 mA
150 μH/400 mA
μPA679TB
DTC123JM
2SJ355-AZ
μPA679TB
DTC123JM
2SJ355-AZ
μPA679TB
DTC123JM
2SJ355-AZ
29
APPENDIX B REFERENCE PARTS TABLE (EZ-0005)
Table B-1. Reference Parts Table (EX-0005) (2/2)
Item No.
Q601
Q602
Q603
Q604
Q605
R103
R104
R105
R106
R107
R108
R109
R110
R203
R204
R205
R206
R207
R208
R209
R210
R303
R304
R305
R306
R307
R308
R309
R310
R505
R513
R514
R520
R601
R602
R603
R604
R606
R607
R609
R611
R612
R613
R614
R615
R616
SW401
SW501
SW502
U401
VR601
VR602
VR603
30
Maker
NEC Electronics
NEC Electronics
Philipps
VISHAY
TI
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
KOA
COPAL
COPAL
COPAL
NEC Electronics
ALPS
ALPS
ALPS
Part No.
PS2561AL-1
PS2561AL-1
BC817-25
MB2S
SN75176BD
RK73B1JTTD202J
RK73B2ATTD151J
RK73B1JTTD103J
RK73B2ATTD151J
RK73B1JTTD333J
RK73BW3ATTD4R7J
SR732ETTDR33F
RK73B1JTTD470J
RK73B1JTTD202J
RK73B2ATTD151J
RK73B1JTTD103J
RK73B2ATTD151J
RK73B1JTTD333J
RK73BW3ATTD4R7J
SR732ETTDR33F
RK73B1JTTD470J
RK73B1JTTD202J
RK73B2ATTD151J
RK73B1JTTD103J
RK73B2ATTD151J
RK73B1JTTD333J
RK73BW3ATTD4R7J
SR732ETTDR33F
RK73B1JTTD470J
RK73B1ETTD103J
RK73B1ETTD104J
RK73B1ETTD104J
RK73B1ETTD102J
RK73B1ETTD103J
RK73H1JTTD1211F
RK73H1JTTD3320F
RK73H1JTTD3161F
RK73B2ATTD113J
RK73BW3ATTD4R7J
RK73B1ETTD121J
RK73B1ETTD103J
RK73B1ETTD102J
RK73B1ETTD152J
RK73B1ETTD222J
RK73B1ETTD472J
RK73B1ETTD102J
CAS-220TB1
B3S-1000
CVS-08B
μPD78F0756
RS15111A900B
RS15111A900B
RS15111A900B
Application Note U19666EJ1V0AN
Spec
PS2561AL-1
PS2561AL-1
BC817-25
MB2S
SN75176BD
2k
150,1/4 W
10 k
150,1/4 W
33 k
4.7/1 W
0.33/0.25 W
47
2k
150,1/4 W
10 k
150,1/4 W
33 k
4.7/1 W
0.33/0.25 W
47
2k
150,1/4 W
10 k
150,1/4 W
33 k
4.7/1 W
0.33/0.25 W
47
10 k
100 k
100 k
1k
10 k
1.21 k
332
3.16 k
11 k
4.7/1 W
120
10 k
1k
1.5 k
2.2 k
4.7 k
1k
CAS-220TB1
B3S-1000
CVS-08B
μPD78F0756
RS15111A900B
RS15111A900B
RS15111A900B
APPENDIX C EXAMPLE INTERNAL REFERENCE VOLTAGES AND PWM OUTPUT DUTY
PARAMETERS (FOR INTERNAL COMPARATOR FEEDBACK)
Table C-1. Example Internal Reference Voltages and PWM Output Duty Parameters
(For Internal Comparator Feedback)
ILED
required(mA)
Vref
required
300
287
277
266
255
245
234
223
213
202
191
181
170
160
149
138
128
117
106
96
85
74
64
53
43
32
21
11
1.4
1.35
1.3
1.25
1.2
1.15
1.1
1.05
1
0.95
0.9
0.85
0.8
0.75
0.7
0.65
0.6
0.55
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
Caution
Channel 1(GREEN)
Channel 2(BLUE)
Channel 0(RED)
DUTY_max0[28]
DUTY_min0[28]
DUTY_max1[28]
DUTY_min1[28]
DUTY_max2[28] DUTY_min2[28]
TX0CR1 value for TX0CR1 value for TX0CR2 value for TX0CR2 value for TX1CR1 value for TX1CR1 value for
CH0(RED)
CH0(RED)
CH1(GREEN)
CH1(GREEN)
CH2(BLUE)
CH2(BLUE)
129
121
2
80
188
170
125
117
68
85
176
167
123
115
72
89
172
163
119
111
78
91
168
160
115
107
80
95
164
156
113
105
84
99
162
153
109
101
88
102
156
148
105
97
90
106
152
144
101
95
96
110
148
140
97
90
104
115
146
136
95
86
108
119
140
133
91
85
112
123
135
128
87
81
116
128
132
124
83
77
118
132
128
122
79
73
122
138
124
118
77
70
130
143
120
114
73
67
132
147
116
110
71
63
138
152
112
106
67
60
142
157
108
100
65
57
146
161
104
96
63
55
154
167
100
92
61
51
158
174
98
89
57
48
164
178
92
83
55
45
168
182
88
80
53
35
174
196
82
74
47
31
180
202
76
68
35
7
190
238
66
36
23
1
216
250
40
6
The above parameters are not guaranteed because they were calculated using experimented
results.
Application Note U19666EJ1V0AN
31
APPENDIX D EXAMPLE A/D CONVERTER EXPECTED VALUES AND PWM OUTPUT DUTY
PARAMETERS (FOR INTERNAL A/D CONVERTER FEEDBACK)
Table D-1. Example A/D Converter Expected Values and PWM Output Duty Parameters
(For Internal A/D Converter Feedback)
ILED
required(mA)
Vref
required
Adref[28]
Target ADC value
300
287
277
266
255
245
234
223
213
202
191
181
170
160
149
138
128
117
106
96
85
74
64
53
43
32
21
11
1.4
1.35
1.3
1.25
1.2
1.15
1.1
1.05
1
0.95
0.9
0.85
0.8
0.75
0.7
0.65
0.6
0.55
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
287
276
266
256
246
236
225
215
205
195
184
174
164
154
143
133
123
113
102
92
82
72
61
51
41
31
20
10
Caution
DUTYref0[28]
TX0CR1 value for
CH0(RED)
123
119
116
112
109
106
100
98
94
91
87
84
80
78
74
71
68
64
61
59
56
53
49
46
43
40
22
10
DUTYref2[28]
TX1CR1 value for
CH2(BLUE)
171
168
164
161
157
154
149
145
141
138
134
130
126
123
119
115
111
107
101
98
94
90
85
81
76
71
39
17
The above parameters are not guaranteed because they were calculated using experimented
results.
32
DUTYref1[28]
TX0CR2 value for
CH1(GREEN)
1
84
88
90
94
98
101
105
109
114
118
122
127
131
137
142
146
151
156
160
166
170
176
181
186
192
224
245
Application Note U19666EJ1V0AN
For further information,
please contact:
NEC Electronics Corporation
1753, Shimonumabe, Nakahara-ku,
Kawasaki, Kanagawa 211-8668,
Japan
Tel: 044-435-5111
http://www.necel.com/
[America]
[Europe]
[Asia & Oceania]
NEC Electronics America, Inc.
2880 Scott Blvd.
Santa Clara, CA 95050-2554, U.S.A.
Tel: 408-588-6000
800-366-9782
http://www.am.necel.com/
NEC Electronics (Europe) GmbH
Arcadiastrasse 10
40472 Düsseldorf, Germany
Tel: 0211-65030
http://www.eu.necel.com/
NEC Electronics (China) Co., Ltd
7th Floor, Quantum Plaza, No. 27 ZhiChunLu Haidian
District, Beijing 100083, P.R.China
Tel: 010-8235-1155
http://www.cn.necel.com/
Hanover Office
Podbielskistrasse 166 B
30177 Hannover
Tel: 0 511 33 40 2-0
Munich Office
Werner-Eckert-Strasse 9
81829 München
Tel: 0 89 92 10 03-0
Stuttgart Office
Industriestrasse 3
70565 Stuttgart
Tel: 0 711 99 01 0-0
United Kingdom Branch
Cygnus House, Sunrise Parkway
Linford Wood, Milton Keynes
MK14 6NP, U.K.
Tel: 01908-691-133
Succursale Française
9, rue Paul Dautier, B.P. 52
78142 Velizy-Villacoublay Cédex
France
Tel: 01-3067-5800
Sucursal en España
Juan Esplandiu, 15
28007 Madrid, Spain
Tel: 091-504-2787
Tyskland Filial
Täby Centrum
Entrance S (7th floor)
18322 Täby, Sweden
Tel: 08 638 72 00
Filiale Italiana
Via Fabio Filzi, 25/A
20124 Milano, Italy
Tel: 02-667541
Shanghai Branch
Room 2509-2510, Bank of China Tower,
200 Yincheng Road Central,
Pudong New Area, Shanghai, P.R.China P.C:200120
Tel:021-5888-5400
http://www.cn.necel.com/
Shenzhen Branch
Unit 01, 39/F, Excellence Times Square Building,
No. 4068 Yi Tian Road, Futian District, Shenzhen,
P.R.China P.C:518048
Tel:0755-8282-9800
http://www.cn.necel.com/
NEC Electronics Hong Kong Ltd.
Unit 1601-1613, 16/F., Tower 2, Grand Century Place,
193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong
Tel: 2886-9318
http://www.hk.necel.com/
NEC Electronics Taiwan Ltd.
7F, No. 363 Fu Shing North Road
Taipei, Taiwan, R. O. C.
Tel: 02-8175-9600
http://www.tw.necel.com/
NEC Electronics Singapore Pte. Ltd.
238A Thomson Road,
#12-08 Novena Square,
Singapore 307684
Tel: 6253-8311
http://www.sg.necel.com/
NEC Electronics Korea Ltd.
11F., Samik Lavied’or Bldg., 720-2,
Yeoksam-Dong, Kangnam-Ku,
Seoul, 135-080, Korea
Tel: 02-558-3737
http://www.kr.necel.com/
Branch The Netherlands
Steijgerweg 6
5616 HS Eindhoven
The Netherlands
Tel: 040 265 40 10
G0706