XMC1200
Microcontroller Series
for Industrial Applications
R GB L ED Li ghti ng S hi el d wi t h
XM C 120 2 for Ar dui n o
Introduction
Board Description
Getting Started
I²C Master-Slave Communication
Programming a master Arduino board
to control the RGB LED Lighting Shield
Setting the Parameters for YOUR LED Lamp
Boa rd M a nual
V1.0 2014-11
Microcontrollers
Edition 2014-11
Published by
Infineon Technologies AG
81726 Munich, Germany
© 2014 Infineon Technologies AG
All Rights Reserved.
Legal Disclaimer
The information given in this document shall in no event be regarded as a guarantee of conditions or
characteristics. With respect to any examples or hints given herein, any typical values stated herein and/or any
information regarding the application of the device, Infineon Technologies hereby disclaims any and all
warranties and liabilities of any kind, including without limitation, warranties of non-infringement of intellectual
property rights of any third party.
Information
For further information on technology, delivery terms and conditions and prices, please contact the nearest
Infineon Technologies Office (www.infineon.com).
Warnings
Due to technical requirements, components may contain dangerous substances. For information on the types in
question, please contact the nearest Infineon Technologies Office.
Infineon Technologies components may be used in life-support devices or systems only with the express written
approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the
failure of that life-support device or system or to affect the safety or effectiveness of that device or system. Life
support devices or systems are intended to be implanted in the human body or to support and/or maintain and
sustain and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other
persons may be endangered.
RGB LED Lighting Shield with XMC1202 for Arduino
Revision History
Revision History
Page or Item
Subjects (major changes since previous revision)
V1.0, 2014-11
Trademarks of Infineon Technologies AG
AURIX™,
C166™,
CanPAK™,
CIPOS™,
CIPURSE™,
CoolMOS™,
CoolSET™,
CORECONTROL™, CROSSAVE™, DAVE™, DI-POL™, EasyPIM™, EconoBRIDGE™,
EconoDUAL™, EconoPIM™, EconoPACK™, EiceDRIVER™, eupec™, FCOS™, HITFET™,
HybridPACK™, I²RF™, ISOFACE™, IsoPACK™, MIPAQ™, ModSTACK™, my-d™, NovalithIC™,
OptiMOS™, ORIGA™, POWERCODE™; PRIMARION™, PrimePACK™, PrimeSTACK™,
PRO-SIL™, PROFET™, RASIC™, ReverSave™, SatRIC™, SIEGET™, SINDRION™, SIPMOS™,
SmartLEWIS™, SOLID FLASH™, TEMPFET™, thinQ!™, TRENCHSTOP™, TriCore™.
Other Trademarks
Advance Design System™ (ADS) of Agilent Technologies, AMBA™, ARM™, MULTI-ICE™, KEIL™,
PRIMECELL™, REALVIEW™, THUMB™, µVision™ of ARM Limited, UK. AUTOSAR™ is licensed by
AUTOSAR development partnership. Bluetooth™ of Bluetooth SIG Inc. CAT-iq™ of DECT Forum.
COLOSSUS™, FirstGPS™ of Trimble Navigation Ltd. EMV™ of EMVCo, LLC (Visa Holdings Inc.).
EPCOS™ of Epcos AG. FLEXGO™ of Microsoft Corporation. FlexRay™ is licensed by FlexRay
Consortium. HYPERTERMINAL™ of Hilgraeve Incorporated. IEC™ of Commission Electrotechnique
Internationale. IrDA™ of Infrared Data Association Corporation. ISO™ of INTERNATIONAL
ORGANIZATION FOR STANDARDIZATION. MATLAB™ of MathWorks, Inc. MAXIM™ of Maxim
Integrated Products, Inc. MICROTEC™, NUCLEUS™ of Mentor Graphics Corporation. MIPI™ of
MIPI Alliance, Inc. MIPS™ of MIPS Technologies, Inc., USA. muRata™ of MURATA
MANUFACTURING CO., MICROWAVE OFFICE™ (MWO) of Applied Wave Research Inc.,
OmniVision™ of OmniVision Technologies, Inc. Openwave™ Openwave Systems Inc. RED HAT™
Red Hat, Inc. RFMD™ RF Micro Devices, Inc. SIRIUS™ of Sirius Satellite Radio Inc. SOLARIS™ of
Sun Microsystems, Inc. SPANSION™ of Spansion LLC Ltd. Symbian™ of Symbian Software Limited.
TAIYO YUDEN™ of Taiyo Yuden Co. TEAKLITE™ of CEVA, Inc. TEKTRONIX™ of Tektronix Inc.
TOKO™ of TOKO KABUSHIKI KAISHA TA. UNIX™ of X/Open Company Limited. VERILOG™,
PALLADIUM™ of Cadence Design Systems, Inc. VLYNQ™ of Texas Instruments Incorporated.
VXWORKS™, WIND RIVER™ of WIND RIVER SYSTEMS, INC. ZETEX™ of Diodes Zetex Limited.
Last Trademarks Update 2011-11-11
RGB LED Lighting Shield with XMC1202 for Arduino
Table of Contents
Table of Contents
Revision History ....................................................................................................................................................3
Table of Contents ..................................................................................................................................................4
About this document.............................................................................................................................................5
1
1.1
1.2
1.3
Introduction ........................................................................................................................................7
Key Features ........................................................................................................................................7
Key Features of the XMC1200 MCU series .......................................................................................10
Getting started....................................................................................................................................10
2
2.1
2.2
2.3
Board Description ............................................................................................................................12
Specifications .....................................................................................................................................12
Programming Access .........................................................................................................................12
Schematics and Layout ......................................................................................................................13
3
Getting Started .................................................................................................................................16
4
4.1
2.1.1
4.2
4.2.1
4.2.2
4.2.3
4.2.4
4.2.5
4.2.6
4.2.7
4.2.8
4.2.9
4.2.10
4.2.11
I C Master-Slave Communication Protocol ...................................................................................18
2
Brief Description of I C Functions ......................................................................................................18
Command Overview Table.................................................................................................................19
Command Description........................................................................................................................20
Colour Intensity (INTENSITY_RED, INTENSITY_GREEN, INTENSITY_BLUE, INTENSITY_RGB)20
Peak Current Reference (CURRENT_RED, CURRENT_GREEN, CURRENT_BLUE)....................22
Off-Time (OFFTIME_RED, OFFTIME_GREEN, OFFTIME_BLUE) ..................................................23
Walk time (WALKTIME) .....................................................................................................................25
Dimming (DIMMINGLEVEL) ..............................................................................................................26
Fade Rate (FADERATE) ....................................................................................................................31
DMX512 Control Commands .............................................................................................................32
Changing the RGB LED Shield’s Address (CHANGEADDRESS).....................................................33
Configuring the RGB LED Shield (SAVEPARAMETERS) .................................................................34
Request for Data (I2CREAD commands) ..........................................................................................34
Directly Accessing Registers..............................................................................................................35
5
5.1
5.2
5.3
5.4
5.5
Arduino Compatibility......................................................................................................................38
Simple Test Program .........................................................................................................................38
Safe Configuration (DEFAULT)..........................................................................................................40
Configuring the RGB LED Shield .......................................................................................................41
Parameters optimized for Traxon Nano Liner XB-9 with 24V Input Voltage......................................42
Parameters optimized for Traxon Nano Liner XB-18 with 48V Input Voltage....................................46
6
Parameter Setup for YOUR LED Lamp...........................................................................................49
7
7.1
7.1.1
7.1.2
7.1.3
7.1.4
7.1.5
7.1.6
7.1.7
7.1.8
7.1.9
Appendix ...........................................................................................................................................52
2
Description of the I C Functions Provided .........................................................................................52
I2CWRITE2BYTES (ADDRESS, COMMAND, DATA).......................................................................52
I2CWRITE6BYTES (ADDRESS, COMMAND, DATA, DATA, DATA) ...............................................52
I2CWRITE12BYTES (ADDRESS, COMMAND, DATA, DATA, DATA, DATA, DATA, DATA) ..........53
I2CREAD (ADDRESS, COMMAND)..................................................................................................54
I2CREAD_DIRECTACCESS (ADDRESS, REGISTER ADDRESS) .................................................54
I2CWRITE_DIRECTACCESS (ADDRESS, COMMAND, REGISTER ADDRESS, DATA) ...............55
I2CCHANGEADDRESS (ADDRESS, NEW ADDRESS) ...................................................................56
I2CDMX (ADDRESS, DMXCOMMAND)............................................................................................56
I2CSAVEPARAM (ADDRESS) ..........................................................................................................57
2
Board Manual
4
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Table of Contents
About this document
Scope and purpose
This document describes how to use the RGB LED Shield with XMC1202 for Arduino.
Intended audience
Engineers, hobbyists and students who want to add flicker-free LED control to Arduino projects.
Related information
Table 1
Supplementary links and document references
Reference
Description
XMC Microcontrollers
32-bit Industrial Microcontroller based on ARM®
Cortex™-M from Infineon
Documents section contains reference information for
XMC1000 microcontrollers
XMC1000 Reference Manuals
XMC Development Support
XMC Development Tools
Arduino Home Page
All information on Arduino
Arduino Uno Product Page
Arduino Uno R3 description
Infineon Arduino Page
Boards offered by Infineon for Arduino
DAVE™ Development Platform
All details on DAVE™ IDE
J-Link Debug Probes Product Page
Contains information on J-Link Debug Probes
Board Manual
5
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Introduction
RGB LED Lighting Shield
Introduction
Board Manual
6
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Introduction
1
Introduction
The RGB LED Lighting Shield adds brilliant flicker-free light control to Arduino projects. The Shield
communicates with a master board via the I2C protocol as a slave. Either an Arduino Uno R3 or the
XMC1100 Boot Kit from Infineon can be used as the master.
On board the RGB LED Shield is an XMC1202 microcontroller, featuring a dimming control peripheral
for LED lighting applications, known as the Brightness and Colour Control Unit (BCCU). It contains 3
independent dimming engines and 9 independent Pulse Density Modulated (PDM) channels.
1 dimming engine and 6 channels are used in this shield.
There are 10 basic sets of I2C commands to control the shield from the master board, and so control
the connected LED Lamp with various lighting effects. There are 22 user configurable parameters
and the freedom to connect different LED Lamps.
The RGB LED Lighting Shield can be easily connected to any Arduino board or the XMC1100 boot Kit
via headers and DMX512 control is enabled as a mounting option using an interface chip.
Figure 1
RGB LED Shield photo
1.1
Key Features
The RGB LED Shield has the following features:
2
Behaves as an I C slave.
− An Arduino Uno R3, XMC1100 Boot Kit, or similar board connected to the shield can
communicate via the SDA and SCL pins as the master.
Drives and dims up to 3 LED strings with constant current.
Able to change the colour of a connected LED lamp(if the strings are of different colours; for
example red, green, blue).
High speed flicker-free modulation dimming on each string with Pulse-Density Modulation (PDM).
Very high power density due to high switching frequency, leading to a small area.
Board Manual
7
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Introduction
Up to 48VDC input.
− The RGB LED Shield is a DC-DC buck LED driver so the input voltage must be higher than the
forward voltage of the LED strings.
Configurable current amplitude.
Up to 700mA average current on each string.
Configurable current ripple.
I²C interface with configurable 10-bit slave address (with a default value of 0x15E)
to increases the range of devices that can be connected to the bus line.
Board Manual
8
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Introduction
RGB LED Shield driving an LED wall washer
Board Manual
9
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Introduction
1.2
Key Features of the XMC1200 MCU series
32-bit ARM® Cortex™-M0, 32MHz.
Hardware Interconnect Matrix.
16kB ~ 200kB Flash with ECC and 16kB RAM.
Peripherals running up to 64MHz.
Timer/PWM: CCU4, CCU8, POSIF.
Analog-mixed Signal: 12-bit ADCs, 12-bit DACs, ACMPs.
Communication: I2C, SPI, Dual-/Quad-SPI, SCI, I2S, LIN.
Application specific: LED Color Control Engine, Touch.
AES 128-bit secure loader for SW IP protection.
Operating: 1.8 ~ 5.5Volt and -40° ~ 105°C.
Free DAVE™ IDP and DAVE Apps (code library) open to 3rd party tools and the wide ARM®
ecosystem.
1.3
Getting started
The RGB LED Shield uses high frequency peak-current control with fixed off-times to generate DC
LED currents. Although this is highly efficient, low cost, and is suitable for high-speed dimming, it
results in the output current being dependent on the input and output voltage ratio. The output current
can be adjusted by configuring the peak-current reference and off-time parameters.
A virgin RGB LED Shield is pre-configured with safe peak-current reference and off-time parameters.
With the safe parameters, the LED current will not be ‘too high’ at high input voltages.
The safe parameter values have been tested with LED loads that have a forward voltage of 6V at
input voltages up to 48V. At this input, the pre-configured average LED current is measured up to
300mA.
Note: LED strings that have a forward voltage lower than 6V and current capability lower than 300mA
should not be connected without re-configuring the shield first.
The safe parameters will however result in a discontinuous current with most LED strings and input
voltages. For low-ripple continuous current, the off-time and peak-current reference parameters must
be configured by the user once the LED lamp and input voltages have been selected.
Generally, the current in any of the strings should never exceed 1A, the peak-current reference
parameters should be kept below 0x80, and off-time parameters should be kept above 0x10.
Attention: Improper configuration may result in permanent damage.
Board Manual
10
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Introduction
RGB LED Lighting Shield
Board Description
Board Manual
11
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Board Description
2
Board Description
The RGB LED Shield can be controlled by programming a master Arduino board, such as the Arduino
Uno R3 or the XMC1100 Boot Kit.
Figure 2
RGB LED Shield Interfaces
2.1
Specifications
Dimensions
Input voltage
Output Current per string
Order Number
2.2
2.7 x 2.1 inches (standard Arduino footprint)
up to 48V
up to 1A peak and 700mA average
KIT_LED_XMC1202_AS_01
Programming Access
The on-board XMC1202 microcontroller can be programmed over SWD via the debug interfaces
using a J-Link debug probe from Segger that supports ARM® Cortex™-M0 (Figure 3).
Flash content can be updated over SWD using the TASKING debugger integrated in DAVE™.
Figure 3
Segger J-Link debug probe connected to the RGB LED Shield
Board Manual
12
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Board Description
2.3
Schematics and Layout
Figure 4
RGB LED Shield – Schematics
Figure 5
RGB LED Shield – Top and Bottom Layers
Board Manual
13
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Board Description
Figure 6
RGB LED Shield – Components
Figure 7
RGB LED Shield – BOM
Board Manual
14
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Board Description
Getting Started
Board Manual
15
V1.0, 2014-11
RGB LED Lighting Shield with XMC1202 for Arduino
Getting Started
3
Getting Started
You can bring YOUR LED lamp to life in seven simple steps.
STEP 1.
Choose a high-power light engine
a. Maximum three channels (e.g. RGB)
b. Minimum 300mA LED current rating
NOTE: If the current rating is