APPLICATION NOTE
R01AN1115EJ0201 Rev.2.01 Page 1 of 66
Mar. 26, 2013
RL78/I1A
Lighting Communications Using RL78/I1A
Purpose
The purpose of this application note is to describe how to implement different communication interfaces for
lighting control within lighting systems such as DALI, DMX512 and IR remote control using the RL78/I1A
features.
Readers
This document is intended for lighting system engineers who design and develop lighting systems with
communication capabilities.
The target products are as follows:
20-pin: R5F1076C
30-pin: R5F107AE, R5F107AC
38-pin: R5F107DE
R01AN1115EJ0201
Rev.2.01
Mar. 26, 2013
<R>
RL78/I1A Lighting Communications Using RL78/I1A
R01AN1115EJ0201 Rev.2.01 Page 2 of 66
Mar. 26, 2013
Table of Contents
1.
Introduction.......................................................................................................................................... 4
2. DALI Communication .......................................................................................................................... 5
2.1 Overview .................................................................................................................................... 5
2.1.1 What is DALI?................................................................................................................ 5
2.1.2 Features of DALI communication .................................................................................. 5
2.1.3 Overview of DALI communication ................................................................................. 5
2.1.3.1 Data structure and frame structure ............................................................... 5
2.1.3.2 Timing of transmitting and receiving ............................................................. 7
2.1.3.3 Commands.................................................................................................... 7
2.2 Realizing DALI Communication with RL78/I1A.......................................................................... 9
2.2.1 RL78/I1A features used for DALI communication: DALI/UART4 interface ................... 9
2.2.1.1 Communication circuit................................................................................... 9
2.2.1.2 Data communication timing chart................................................................ 10
2.2.2 Saving DALI communication parameters .................................................................... 12
2.2.3 Overview of operations................................................................................................ 13
2.3 Organization of DALI Communication Lighting Control Software ............................................ 15
2.3.1 Operation and software flowchart................................................................................ 16
2.4 DALI Commands...................................................................................................................... 28
2.5 Functions for Applilet EZ for HCD DALI Communication (EZ-0012) ....................................... 34
2.5.1 r_dali.c ......................................................................................................................... 35
2.5.1.1 DALI_init...................................................................................................... 35
2.5.1.2 DALI_getValue ............................................................................................ 35
2.5.1.3 DALI_ActualLevelChangeCheck................................................................. 35
2.5.1.4 DALI_RevceiveCommand........................................................................... 35
2.5.1.5 DALI_Fading ............................................................................................... 36
2.5.1.6 DALI_UpdateVariables................................................................................ 36
2.5.1.7 DALI_SetSystemFailure.............................................................................. 36
2.5.1.8 DALI_ResetValue........................................................................................ 36
2.5.1.9 DALI_CheckReset....................................................................................... 36
2.5.1.10 DALI_ProhibitReception.............................................................................. 37
2.5.2 DALI_analyze.c ........................................................................................................... 37
2.5.2.1 DALI_CheckConfigCommand..................................................................... 37
2.5.2.2 DALI_Check2ndCommand ......................................................................... 37
2.5.2.3 DALI_AnalyzeCommand............................................................................. 37
2.5.2.4 DALI_CheckAddress................................................................................... 38
2.5.3 DALI_command.c ........................................................................................................ 38
2.5.3.1 DALI_LightingCommand ............................................................................. 38
2.5.3.2 DALI_QueryCommand................................................................................ 38
2.5.3.3 DALI_ConfigCommand ............................................................................... 38
2.5.3.4 DALI_Fade200ms ....................................................................................... 38
2.5.3.5 DALI_SetArcPowerWithFade...................................................................... 39
2.5.3.6 DALI_SpecialCommand.............................................................................. 39
2.5.4 DALI_memorybank.c................................................................................................... 39
2.5.4.1 DALI_InitMemorybank................................................................................. 39
2.5.4.2 DALI_WriteMemorybank ............................................................................. 39
2.5.4.3 DALI_ReadMemorybank............................................................................. 40
2.5.4.4 DALI_UpdateChecksum.............................................................................. 40
2.5.5 DALI_timer.c................................................................................................................ 40
2.5.5.1 DALI_InitTimer ............................................................................................ 40
2.5.5.2 DALI_Interval .............................................................................................. 40
2.5.5.3 DALI_StartTimer ......................................................................................... 40
2.5.5.4 DALI_StopTimer.......................................................................................... 41
2.5.5.5 DALI_IsTimerRunning................................................................................. 41
2.5.5.6 DALI_StartFadeTimer ................................................................................. 41
2.5.5.7 DALI_StopFadeTimer ................................................................................. 41