You are on page 1of 14

KNX Association

Microcontrollers

KNX TUTOR SEMINAR

Table of Contents
1 Microcontroller ........................................................................................................... 3 1.1 1.2 1.3 1.4 1.5 2 3 Introduction ......................................................................................................... 3 Bus coupling units (BCUs) / Bus access units (BAUs) ....................................... 3 Principle of Operation of a Microprocessor ......................................................... 4 Differences between a Microprocessor and a Microcontroller ............................. 4 The Main Memory (ROM, Flash ROM, RAM, EEPROM) .................................... 6

The different KNX System Models ............................................................................. 7 Mask Versions of Bus Coupling Units ........................................................................ 8 3.1.1 3.1.2 3.1.3 BIM M 111 / BA1 (TP).................................................................................. 8 BIM M 13x ................................................................................................... 8 Chipset NEC 78K0/KE2 ............................................................................... 8

4 5

Low-cost KNX TP Access: TP-UART ......................................................................... 9 Device Information in ETS ........................................................................................11

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
2/14

KNX TUTOR SEMINAR

1 Microcontroller
1.1 Introduction
The subscribers to a network that is based on the OSI reference model are obliged to adhere to certain protocols. This means that they exchange their protocol data units according to agreed procedures. Seen from a technical point of view, such procedures can be executed very well by program-controlled electronic switching circuits. For many years now, microprocessors - and among those, especially the micro-controllers - have proved to be powerful, reliable and budget-priced components for use in exactly such network controlling applications.

1.2 Bus coupling units (BCUs) / Bus access units (BAUs)


There is a microcontroller at the heart of the KNX bus coupling unit or BAU which in turn is the basic component of each KNX bus device. The following microcontrollers are used: the Motorola 68HC05B6 microcontroller mounted in: the standard BCU in flush-mounted, built-in and DIN rail mounted housing the BIM M111 (Bus Interface Module, a small board without shift register, programming button and LED). This module can simply be attached to or soldered onto another board.

further types of bus coupling units have been developed recently since standardised electronic components (chip sets) are now available which can be used to achieve communication between the bus and a controller in a very simple way. More information below! A bus coupling unit without a LED or pushbutton which is connected directly on the board is called a BAU. The types named above all have an 8 bit arithmetic logic. In order to understand the functioning of a bus device, it is essential to study the principle of operation of microcontrollers in general, and that of the MC68HC05B6 in particular, since all so far developed BCUs are based on that controllers system stack.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
3/14

KNX TUTOR SEMINAR

1.3 Principle of Operation of a Microprocessor


Each microprocessor (just like all data processing equipment) executes a series of instructions in a given sequence. Arranged in a particular order, these instructions constitute a program. Each program has the following principal structure: 1st instruction 2nd instruction 3rd instruction . . . final instruction: return to the 1st instruction and begin again The microprocessor can only execute the individual instructions of the program if it can read them. The program is therefore always stored in memory blocks which can then be directly read by the microprocessor without using any additional or auxiliary procedures or tools. These memory blocks are called main memory or working memory. The main memory not only stores the program itself but it also keeps the data which the microprocessor requires to execute the program or the data which is produced as a result of program execution. The main memory is divided into memory sections of identical size. With microprocessors, these sections are usually large enough to hold 8 bits. One such section is called a byte. The bytes are numbered consecutively for clear identification. The byte number is the address of the byte.

1.4 Differences between a Microprocessor and a Microcontroller


Microprocessors require not only a main memory to keep program and data; they also need interfaces which enable them to talk to the outside world. The microprocessor at the heart of the KNX bus device must be in a position to exchange data with the application module. The information about the state of a pushbutton sensor (open or closed) for instance must be made readily available to the microprocessor. In the other direction of information flow, the microprocessor must be capable of controlling the relay of a switching actuator. With microprocessors, the interfaces through which the information passes are mounted on the integrated circuit (IC) but are installed somewhere externally and must be explicitly connected to the microprocessor. This is usually done by means of appropriate components which are fitted on a printed circuit board. Microcontrollers however do contain all the necessary interfaces and often even some other components, such as timers, on their integrated circuit. Progressive micro-miniaturisation and cost reduction on the one hand and considerable increase in reliability on the other are the obvious advantages of this component integration. It is for this reason that the bus coupling units of the KNX bus devices are equipped with microcontrollers rather than with microprocessors.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
4/14

KNX TUTOR SEMINAR The following block diagram illustrates the principal components and flow of information on the MC68HC05B06 microcontroller.

Figure 1: Block diagram of controller MC68HC05B6

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
5/14

KNX TUTOR SEMINAR

1.5 The Main Memory (ROM, Flash ROM, RAM, EEPROM)


The microcontrollers of bus coupling units contain three types of main memory: Read Only Memory (ROM) The content of this memory is programmed by a mask pattern during the final steps of manufacture of the integrated circuit and is therefore not alterable by instructions. The ROM of the KNX bus coupling units microcontroller contains the protocol software (operating system) and a number of auxiliary programs as well as program constants and vectors for RESET and interrupts. A modified version of these programs is only obtained if a new mask pattern is produced and the chips are reprogrammed with this new mask. In this case we talk about a new mask version of the microcontroller or the bus coupling unit ( see Mask Versions of Bus Coupling Units). Random Access Memory (RAM) The contents of this memory are lost when the supply voltage is switched off (volatile memory). Therefore the RAM only stores those values that are computed during program execution (variable values). The RAM of the KNX bus coupling unit, for instance, keeps the values of the group objects and their RAM flags. Electrically Erasable Programmable Read-Only Memory (EEPROM) This is a programmable read-only memory that can be electrically erased and written into. It is a non-volatile memory like a ROM but the contents of the EEPROM can be overwritten by the microcontroller itself, without being removed from the circuit. Under normal circumstances, the EEPROM of a microcontroller is accessed only with read procedures. The EEPROM of the KNX bus coupling units microcontroller always stores the physical address of the bus coupling unit, the group addresses and usually also the application program together with its parameters. This information is written into the EEPROM during commissioning using the ETS commissioning program. The write procedure of an EEPROM byte lasts approx. 1000 times longer than that of a RAM byte (RAM approx. 1 s, EEPROM approx. 1 ms). Moreover the EEPROM cell ages with every write procedure, so that the number of successful write procedures is specified by the manufacturer (generally >10000). FLASH ROM In modern microcontrollers a different type of memory is used, which combines the properties of RAM and EEPROM. It can be accessed faster than EEPROM, but is also non volatile like EEPROM. Parts of it are loaded with the operating system (like ROM in the older controllers) and basically not changed anymore during the operating period of the device. But in contrary to the older ROM, a FLASH ROM still can be overwritten in case e.g. bugs in the OS have to be fixed. This is the advantage of this type of memory: A device can always be completely updated if necessary. Other parts of the FLASH ROM contain the data which can be changed by the user as described before: the addresses, parameters, flags and the application program itself, which is downloaded from ETS. So this resembles the EEPROM.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
6/14

KNX TUTOR SEMINAR

2 The different KNX System Models


The KNX specification describes several system models. The system model of a certain device can be checked by reading out the so-called device descriptor type 0 (also called mask version before). The main features of these mask versions are listed below.

System 1 Device Descriptor Max. Number of group objects Serial Number Access Control Interface-Objects no no no e.g. 0012 16

System 2 e.g. 0021, 0025 254*

System 7 e.g. 0701, 0705 254*

System B e.g. 07B0 >254*

yes yes yes

yes yes yes

yes yes yes

* The actual possible number of group objects depends on the capabilities of the individual microcontroller.

Below the system features shown in the table are described more detailed: Access Control: If access control is activated and you wish to access devices from the memory of BCU 2 (write and/or read), the tool must be authorised for this using a 4 byte key. Four access levels are supported (0=highest priority). Level 0: System access (reserved for manufacturers), Level 1: Loading of application programs (managed via ETS), Level 2: Tables and parameters (via ETS), Level 3: reserved (currently without function). A manufacturer can define up to 16 keys for a BCU 2 product: some of these are however reserved for system-related memory (e.g. access to the highest level 0) and for this reason are not revealed. These access control mechanisms can be used for the above device types from ETS2 V1.1 onwards. Access control does not refer to normal communication via group addresses: access is always enabled in this case. The exact handling of the access control is described in detail in the course chapter Application Program. Serial number KNX devices with mask version 2 or higher support a serial number: a different number is supplied with each BCU which makes it possible for example to program or read the physical address of a device without pressing the programming button. This number takes the form of a 6 byte code, divided into a block ID (2 bytes) and consecutive number (4 bytes).

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
7/14

KNX TUTOR SEMINAR Interface-Objects They enable access to the parameters and other properties of a device without direct memory access via memory read / write. The communication with interface objects is carried out via physically addressed telegrams. So one can open a window called property editor in the ETS add on tool Device editor, and read the interface objects of a bus device. You can find more about that in the chapter application program.

3 Mask Versions of Bus Coupling Units


3.1.1 BIM M 111 / BA1 (TP) The so-called Bus Interface Module M 111 or the Standard Bus Coupling Unit, which are both based on the Motorola controller MC68HC05B6, has previously been available in 3 mask versions. The current version is called 0012. It has 6 Kbytes of ROM, 256 bytes of EEPROM and 180 bytes of RAM. There are 3 further variants derived from this controller: 3.1.2 BIM M 13x

The Bus Interface Modules M 13x are based on the NEC microcontroller family 78K0/KE2. The BIM M13x-family has the following memory space:

Flash-Memory for Application program BIM M 130 / M 135 BIM M 131 BIM M132 8 Kbyte 16 Kbyte 48 Kbyte

RAM for Application and Objects 200 Byte 1,2 Kbyte 5,2 Kbyte

These controllers are programmed in C and fully support debugging in the program design phase. This enhances a speedy development. The operating system resembles the KNX profile 2.5. A BIM is integrated by the manufacturer in a KNX device. So this manufacturer only needs to develop the application specific hard- and software, not the operation system. A big advantage of the new BIM M13x family is that all these modules are pin compatible to each other and to the old series of the BIM M 111 / 113. So a manufacturer simply can replace the M 111 / 113 by a member of the new generation BIMs. He only needs to adopt the application software; the hardware will work as before. 3.1.3 Chipset NEC 78K0/KE2

A KNX chipset comprises all essential components of a BIM required for a time saving device development. It is better priced than a BIM and moreover allows the manufacturer to design his own style of printed circuit boards. The chipset NEC 78K0/KE2 resembles the microcontroller used on the BIM M13x and is already preconfigured with a certified KNX operating system in the on-chip internal FLASH memory. It is used together with a transceiver IC, also part of the chipset. So the responsibilities of the KNX manufacturer are reduced to the design of the application specific hardware and software.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
8/14

KNX TUTOR SEMINAR

4 Low-cost KNX TP Access: TP-UART


The TP-UART is an IC which contains parts of the previously mentioned bus nodes but is not a controller. As the abbreviation suggests, it is a Twisted Pair transceiver with integrated UART (Universal Asynchronous Receiver and Transmitter) functionality. While the standard transceiver IC in the bus coupling unit knows analogue functions (amplifying, detecting signals via comparators etc.), the TP-UART has the complete digital component of the link layer. All others processors and controllers which have not been developed specifically for KNX and have a UART interface can thus have bus capability.

Figure 2: TP-UART: Block Diagram

This solution accommodates all the manufacturers who have already developed their own controller programs which they only need to adapt to the new protocol. The development is more cost-effective and KNX therefore becomes an attractive option in other fields of building technology such as in the HVAC sector. Boiler and pump manufacturers have previously refused to use the relatively expensive KNX bus coupling unit in their relatively cost effective components. With the TP-UART, they have a solution which represents good value and is already used by many manufacturers, also in the KNX easy mode segment. Whether a bus device contains a standard bus coupling unit or a TP-UART plus a controller is not determined in most cases as one of the three BCU types previously described is emulated by the controller e.g. it identifies itself as bus coupling unit mask 2.1 if it is analysed with ETS.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
9/14

KNX TUTOR SEMINAR

Figure 3: TP-UART: Interaction with the host controller in the OSI model

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
10/14

KNX TUTOR SEMINAR

5 Device Information in ETS


What does the user or installer see of the previously mentioned information when working with ETS? This can best be clarified using screenshots from ETS: You retrieve the device information about a device:

and also choose to display the group communication!

Figure 4: Results of device info of a BCU1

The information displayed is largely self-explanatory. You can see that the hardware and software PEI type must match so that the application program can run. Information about the manufacturer, program version and the objects plus group objects complete the device info! But: The test of the PEI type comes more and more out of fashion, since a compact device doesnt really require it. So different values for hard- and software types dont necessarily mean malfunction!

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
11/14

KNX TUTOR SEMINAR

Figure 5: Results of device info of a BCU2

Differences between BCU 2 and BCU 1: Serial number Download status display for program, address table and associations (objects group addresses) No indication of the software PEI type No bus voltage reading Read without group addresses the display is identical with other readings of different BCUs!

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
12/14

KNX TUTOR SEMINAR

Figure 6: Results of device info of a BIM M112

Differences to BCU 1 and BCU 2: 2 programs can run, namely the so-called PEI program can run in addition to the standard application. In the above case, there is no program. To determine whether the device functions correctly, you must refer to the description from the manufacturer or ask at his help desk.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
13/14

KNX TUTOR SEMINAR

Figure 7: Results of device info of a System B

The indicated data are retrieved using Property Read telegrams. Difference to a normal BIM M112: additionally the hardware type and the firmware version are shown, but the bus voltage is dropped. This feature is more and more omitted due to efforts reducing the design costs.

Home and Building Management Systems


Microcontrollers Microcontrollers_E0911a

KNX Association
14/14

You might also like