Home

TCM 130 Step Code BA Software API User Manual V2

image

Contents

1. f MPLAB DE Vale Fie Ek wew Prot Debugger Progummer Took Configure Window Heb Ogi BASA seo CH rune dr SE EG Siope C R Instruckon Odes 21511834 ASHIBE as Tma Sex 1 302379 Process Fiequecy MHz ml Cika Samdsbon Tine On Reset gt CLRF Timeout DANKID MNOVLW 0x2 NOWUF INTCOM ACCESS 35 ODE 0OE34 WLW xEq TKWUF INTCONZ ACCESS MWPLAB SIM PIC1SF452 poala wis Mw2dcc Msn Figure 10 Microchip I CD 2 and MPLAB Pin out of the ICD 2 connector Color Description Programming Clock Programming Data Vdd 6 marvp EnOcean GmbH Page 25 of 30 TCM 130 User Manual V2 04 JU of unused energy enocean A 2 EnOcean Tools EnOcean offers a TCM 130 Starter Kit containing an evaluation board an adapter for the MPLAB ICD2 device from Microchip and 2 modified TCM 120 modules with mounted expansion port connector The evaluation board originally has been developed for use with RCM110 120 and TCM120 It is also possible to use it for the development of TCM 130 applications EVA 116 ae Os e ME ECCLE ENS a a Sano er co Fj Fj FE yr r 2 422 OT waz Figure 12 Adapter for MPLAB ICD 2 Important note The expansion port connector which is mounted for development purposes on the modules supplied with the TCM 130 Starter Kit ist not mounted on standard TCM 120 modules In order to program the TCM 120 modules with own software it is necessary t
2. TCM 130 Step Code BA Software API User Manual V2 04 July 2008 The power of unused energy enocean Revision History The following major modifications and improvements have been made to the initial version of the document TCM 130 User Manual V1 0 Version Subject major changes since last version Field BUTTONS defined for PTM200 Remark on interrupts added in chapter 4 Changes in 3 5 Current consumption 2 00 New functions added in latest release of API wait setSerialSpeed setRadioBufferMaturity repeater functionality included number of radio buffers configurable priority of radio interface over serial interface buffer size reduced for serial communication additional return codes for sleep and initTCM130 compatible with latest Microchip IDE V 7 3 and Compiler V 3 00 correction of current consumption Information added in setRxSensitivity Editorial changes Return parameter 7 in initTCM function corrected 2 04 Sensitivity values corrected in setRxSensitivity function Timing recommendation changed in sendRadioTelegram function Description of on board switches for EVA110 board modified 01 Published by EnOcean GmbH Kolpingring 18a 82041 Oberhaching O EnOcean GmbH All Rights Reserved I mportant This information describes the type of component and shall not be considered as assured characteristics No responsibility is assumed for possible omissions or inaccuracies Circuitr
3. 2 SER RX TX configured as digital output input 3 USART RX buffer overrun EnOcean GmbH Page 11 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean 4 Framing error Maybe due to serial speed mismatch Will be cleared automatically after correct reception of one byte 11 parameter address not allowed char sendSerialTelegram union telegram telegram The function is used to log the content of received or transmitted telegrams via the serial interface or to transmit other information via the serial interface The information is sent according to the EnOcean serial port protocol There are several possibilities to address the bytes in this structure as shown below There is a buffer for 9 telegrams 126 bytes Please note The transmission of a serial telegram takes at least about 15ms Please take care not to enter sleep mode before the transmission of the previous telegram has been finished union telegram struct hr struct F struct ti qi EnOcean GmbH unsigned char type unsigned char org unsigned char data3 unsigned char data2 unsigned char data1 unsigned char data0 unsigned char id3 unsigned char id2 unsigned char id1 unsigned char idO unsigned char status unsigned char type unsigned char org unsigned char mdata5 unsigned char mdata4 unsigned char mdata3 unsigned char mdata2 unsigned char mdata1 unsigned char mdata0 unsigned char mid1 unsigned char
4. Ox5A sync byte Ox5A sync byte Ox5A sync byte OxOB TX TELEGRAM OxOB TX TELEGRAM OxOB TX TELEGRAM YP 0x6B RX_TELEGRAM 0x6B RX_TELEGRAM 0x6B RX_TELEGRAM org OxOA OxOB data3 data3 mdata5 OxXX id3 id3 mdatal aidi id2 id2 mdata0 aidO id A id midd J X Oxx Remarks type value OxOB and Ox6B may be used other values reserved for future data2 datal data0 0x00 for RPS 1BS HRC Detailed description of ORG field ORG Description tion RRT TRT Acronym TRT Acronym ES NN NN received original or repeated message module received 4 byte data telegram from a STM sensor 4BS module received Telegram from a CTM module received x0 6byte Modem Telegram 0x08 Modem acknowledge telegram Description of data0 3 and id0 3 If ORG 0x05 and NU 1 N message from a PTM switch module id3 0 32bit transmitter ID data2 0 always 0 data3 as follows 7 0 RID UD PR SRID SUD SA RID 2 bit Rocker ID from left A to right D 0 1 2 and 3 decimal UD 1 bit UD 1 O button UD 0 gt I button PR 1 bit PR 1 gt Button pressed PR 0 gt Button released SRID 2 bit Second Rocker ID from left to right 0 1 2 and 3 SUD 1 bit Second SUD 1 gt Up button SUD 0 gt Down button SA 1 bit SA 1 gt Second action SA 0 gt No second action 2 viewed from TCM module EnOcean GmbH Page 14 of 30 TCM 130 User Manual V2 04 The
5. unsigned OUTO 1 TRUE HIGH level FALSE LOW level unsigned OUT1 1 unsigned OUT2 x unsigned OUT3 1 unsigned OUT4 1 3 unsigned reserved output Returns 0 state written to pin 1 some output pin is configured as input 2 pin value not allowed 3 OUT 4 SER TX configured as SER TX EnOcean GmbH Page 21 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean char configl nputs unsigned char configCode This function configures the TCM130 input pins as analog digital or reference input The table summarizes the available codes and configurations The default configuration is 0x00 If the SER RX is configured as IN 4 configSerialPins it is always a digital input Code IN 3 IN 2 IN 1 IN O Vref Vref A C MN HN AES 005 b vere b A IN Z Ve 0x08 A Vref Vref A IN 2 IN 1 OxOD D Vref Vref A IN 2 IN 1 O0 D D D D j Vdd vss A analog input D digital input Vref Vref reference input Returns 0 configuration entered 1 configuration code not allowed Configuration not entered char configSerialPins unsigned char pinConfigCode This function is used to configure the TCM130 pin 7 and 8 as serial pins or as digital input output At startup pin7 8 are configured as serial pins PinConfigCode 0 Pin7 IN 4 Pin8 OUT 4 pinConfigCode 0 Pin7 SER RX Pin8 SER TX Returns 0 configuration performed 1 pin7 IN 4 SER RX configured wrongly as output 2 pin8 OUT
6. 3 t1 id1 ID 256 amp 255 t1 id2 2 ID 256 256 8255 t1 id3 2 ID 256 256 256 amp 255 sendSerialTelegram amp t1 send serial telegram with ID wait 20 20ms delay to make sure telegram is sent before module goes into reset void wait unsigned long delay delay in ms unsigned long tstart tstart getTime do clrWdt while getTime tstart lt delay void checkID void 4 unsigned long ID csum unsigned char tel 14 i ID readIDBase if ID 0xFFFFFF80 I 1D not yet programmed dof clrWdt getSerialByte amp tel 0 while tel 0 20xA5 wait for sync byte for i 1 i lt 14 i X read serial telegram with 14 bytes cirwdt doiclrWdt while getSerialByte amp tel i csum 0 reset EnOcean GmbH for i 2 i lt 13 i csum tel i gt if csum amp 255 tel 13 reset Perform Reset if Checksum not OK if tel 0 2 ZOxA5 amp amp tel 1 220x5a amp amp tel 2 2 2OxAB amp amp tel 3 220x18 4 SET IDBASE command ID unsigned long tel 7 unsigned long tel 6 0x100 unsigned long tel 5 0x10000 unsigned long tel 4 0x1000000 setIDBase ID Page 30 of 30 TCM 130 User Manual V2 04
7. 4 SER TX configured wrongly as input char readADI n unsigned char inPin unsigned char resolution unsigned int ADconversion Performs a measurement of the voltage at this input inPin 0 3 for IN 0 3 using the built in A D converter with a resolution defined by the parameter resolution in bit max 10 bit and stores the result in ADconversion Returns 0 A D process performed 1 analog IN 0 not configured as analogue A D not performed 2 analog IN 1 not configured as analogue A D not performed 3 analog IN 2 not configured as analogue A D not performed 4 analog IN 3 not configured as analogue A D not performed 5 inPin value not allowed A D not performed 6 analog IN 0 configured as output A D not performed EnOcean GmbH Page 22 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean analog IN 1 configured as output A D not performed analog IN 2 configured as output A D not performed analog IN 3 configured as output A D not performed 0 resolution value 10 A D not performed 1 address pointed to by 3 parameter not allowed A D not performed LP rn WO 0O N char readDigitall n unsigned char inPin unsigned char level Reads the level of the input pin inPin inPin 0 for IN O 4 for IN 4 and stores the result in level TRUE if HIGH level FALSE if LOW level Returns read process correct IN O not configured as digital Reading not performed IN 1 not configured as digital Reading not perf
8. eere ntn inen inrer 18 char setIDBase unsigned long IDBase 1T 4e nenne enne nnne n nnns 18 unsigned long readIDBoas 6 l iiti titer titre b ebat E BERE cr ke epa eva E koc eb eee DUE y epe nee e pet epe ER Du os 19 char setRxSensitivity unsigned char sensitivity 19 MTP iN Asie m m 19 char sleep unsigned long time sese nennen nnne nnne nnne nns in tense tnn innen ens 19 TNT a Peeeet een ener eRe Beer aera eer ae ere eae eee ne ae E eee ene ee 20 char receiverOff M E 20 TN eea EE doen EAE EE E ET EE E EE EE EEN 20 char repeat rO RR 21 VOLT TOSO NT em 21 char writeOut unsigned char outPin unsigned char level eee 21 char configInputs unsigned char configCode ssssssseeeneeeen nenne 22 char configSerialPins unsigned char pinConfigCode sse pp char readADIn unsigned char inPin unsigned char resolution unsigned int MINN nn 22 char readDigitalIn unsigned char inPin unsigned char level esseere 23 UR ON GE TOT SC NS Qm EN EN ET vest 23 V6 6 En S 0 FEE EEE 23 void wait unsigned long delay rmrsnvrnrrnvrnnrnvrnnrnvrnnrnvrnsrnvrnssnvrnssnvrnssnrenssnvnnssnvnnssnvenssnvenssvrenssvresssvvesen 23 TTV m o uu 23 void switchWdtOn J mvrrrrrvrvrrsvrvrrrrrrrssrrnsssrrnsssrrnsssrrnsssvrnss
9. midO unsigned char status unsigned char type unsigned char org unsigned char 8 unsigned char 8 unsigned char 8 unsigned char 8 unsigned char aid1 unsigned char aid0 unsigned char 8 unsigned char 8 unsigned char status Page 12 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean Returns 0 1 2 11 Message format telegram sent information could not be sent in 20ms SER RX TX configured as digital input output parameter address not allowed The following figure shows the message format A data block of length n is composed of 2 synchronization bytes 1 octet for the header and n 1 octets for the message data SER TX SER RX Figure 8 Message format for asynchronous serial communication Octet signals and bit order e Default 9 6 kbps 8 data bits no parity bit one start bit one stop bit e Line idle is binary 1 standard e Each character has one start bit binary 0 8 information bits least significant bit first and one stop bit binary 1 EnOcean GmbH SER TX SER RX STA D1 D2 D3 DbD4 D5 D7 ISTOP Byte Bit B Bit Time Time Time Figure 9 Signals and bit order sending a byte Page 13 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean Encoding for RPS 1BS 4BS HRC Encoding for 6DT Encoding for MDA General encoding OxA5 sync byte OxA5 sync byte OxA5 sync byte OxA5 sync byte Ox5A sync byte
10. number of TX radio buffers must be at least the number of RX radio buffers 1 char initTCM130 void This function must be inserted as first line code in the main program Initializes the internal registers The startup procedure of the module takes less than 1 ms Returns 0 No error TCM130 correctly initialized 1 Radio buffer wrong initialized RX buffer address amount of RX radio buffer out of specified value TCM130 not correctly initialized Reset happened due to stack overflow Reset happened due to stack underflow Reset happened due to Brown out detection Reset happened due to watch dog timer overflow Reset happened due to power down Radio buffer wrong initialized TX buffer address amount of TX radio buffer out of specified value TCM130 not correctly initialized OUI 4 WN char sendSerialByte unsigned char value Send one byte via the serial interface There is a buffer for 126 bytes Returns 0 byte sent 1 byte could not be sent in 20ms 2 SER RX TX configured as digital input output char getSerialByte unsigned char value If a byte has been received via the serial interface it can be read with the getSerialByte function There is a buffer for 14 bytes Please note The radio receiver routine has priority over the serial interface In case of radio communication incoming serial bytes may be lost An error handling should be provided by the application Returns 0 byte received 1 no byte received
11. power of unused energy enocean If ORG 0x05 and NU 0 U message from a PTM switch module id3 0 32bit transmitter ID data2 0 always 0 data3 as follows 7 0 BUTTONS PR Reserved BUTTONS 3 bit Number of simultaneously pressed buttons as following PTM 100 Type1 PTM200 Type2 0 0 Buttons 0 0 Button 1 2 Buttons 1 not possible 2 3 Buttons 2 not possible 3 4 Buttons 3 3 or 4 buttons 4 5 Buttons 4 not possible 5 6 Buttons 5 not possible 6 7 Buttons 6 not possible 7 8 Buttons 7 not possible PR 1 bit PR 1 gt Button pressed PR 0 gt Button released Reserved 4 bit for future use If ORG 0x06 Telegram from a 1 Byte STM sensor id3 0 32bit transmitter ID data2 0 always 0 data3 Sensor data byte If ORG 0x07 Telegram from a 4 Byte STM sensor id3 0 32bit transmitter ID data3 Value of third sensor analog input data2 Value of second sensor analog input datal Value of first sensor analog input data0 Sensor digital inputs as follows 7 0 If ORG 0x08 Telegram from a CTM module set into HRC operation id3 0 32bit transmitter ID data2 0 always 0 data3 as follows 7 0 RID UD PR SR Reserved RID 2 bit Rocker ID from left A to right D 0 1 2 and 3 UD 1 bit UD 1 gt O button UD 0 gt I button PR 1 bit PR 1 gt Button pushed PR 0 gt Button released SR 1 bit SR 1 gt Store SR 0 gt Recall see note R
12. the serial telegram is sent through serial port tl type 0x0B this code is part of EnOcean serial protocol sendSerialTelegram amp t1 radio bytes received are send through the serial port if t1 data3 amp 0x10 writeOut 2 1 switch output 2 on if key pressed else writeOut 2 0 switch ouput 2 off if key released EnOcean GmbH Page 29 of 30 TCM 130 User Manual V2 04 Sample 2 At startup this The power of unused energy enocean application checks if already an ID has been programmed ID different from FFFFFF80 If the ID has not yet been programmed the application waits for a SET IDBASE telegram TCM 120 User Manual to change the ID If the ID has already been set it is provided via a serial telegram You can monitor it using the TCM Monitor application provided on CD ROM Watch dog timer period and brown out detection configuration define CONFIG 3 WDT period 2s BOD on include p18f452 h include TCM130 LIB h include TCM130 CFG h void wait unsigned long delay void checkID void void main void 4 unsigned long ID union telegram t1 unsigned char result initTCM130 TCM 130 init function checkID Check if ID already programmed If not wait for serial SET IDBASE telegram with ID as defined in TCM 120 documentation tl type 0x0B this code is part of EnOcean serial protocol tl org 0x07 4BS Telegram ID readIDBase tl id0 1D amp 255 convert ID into ID bytes 0
13. EnOcean GmbH Page 16 of 30 TCM 130 User Manual V2 04 En of unused energy enocean Returns telegram received telegram filtered not received telegram telegram stored in the last free rx radio buffer rx radio buffer overflow 1 parameter address not allowed e RUNKE char sendRadioTelegram union telegram telegram With this command one radio telegram can be transmitted In order to achieve a high level of transmission probability it is recommended to send 3 telegrams at random intervals within 40ms Random intervals can be generated using the pseudo random functions in stdlib h of the C18 compiler Returns telegram sent ID incorrect or data not allowed Telegram not sent ORG byte not allowed Telegram not sent telegram couldn t be sent within 5ms telegram written in last free tx radio buffer 1 parameter address not allowed e BK WNe char setRadioFilter unsigned long ID All received telegrams except modem telegrams will be filtered and all telegrams which do not stem from the module with the specified ID will be discarded Please note Filtering is done only for the getRadioTelegram function The repeater if activated will repeat also telegrams with other IDs Returns 0 filter set char setRadioBufferMaturity unsigned char time With this command the maturity time of the rx radio buffers may be changed The default value is 100ms Identical telegrams arriving within the maturity time are treated as on
14. URN 5 1 1 Basic Functionalities rrmrrvvrrrrrrrvrerrvrerrrrerrvrersnrrrsnrersnrersvrnssnressvressvressnressvressvressnressvressvrsssvrsssvrsssvsenn 5 1 2 Features Overview based on TCM120 Hardware een 6 1 3 Physical Dimensions TCM120 Hardware eene 6 TENT ANER 7 15 NONNE 7 2 FN NEPPE SPT Ne 8 Zee Peri EEE EEE EE EE EN 8 VINA IER UU M 8 3 APPLICATIONS INFORMATION gaard VS a d ona RM wa C V Fac a an 9 NT DE TN 10 ENE MN 10 i define NR RX RADIO BUFFERS esrrrsvrerrvrrsrversvessvressversvessvresnvessvessvresnvessvessvrsssvessvessvrsssvessvessvreen 10 define INR IX RADIO BUFFERS cincsenraruccasasdvinesonnesnsonisdianauen S Ybo Gd a ORE xu e Ea opas ERR PR uud tide 11 NTN NNN 11 char sendSerialByte unsigned char value sese eee 11 char getSerialByte unsigned char value mmmrmmmrrmrsrersrrresssrresssrerssvrensssrensssrenssnvensnne 11 char sendSerialTelegram union telegram telegram 1 7 eeeeees 12 char getRadioTelegram union telegram telegram esee 16 char sendRadioTelegram union telegram telegram 17 char setRadioFilter unsigned long ID eene 17 char setRadioBufferMaturity unsigned char time sesssssssee nes 17 char setSerialSpeed unsigned char SpeedCode 7 sees 18 char clearRadioFilter esee enne ener
15. V2 04 JO of unused energy enocean Description of On board Indicators Function Power supply indicator Signal indicator Indication output of received signal strength of all 868 3 MHz signals peak detection e Red No Radio Signal e Yellow Weak Radio Signal e Green 0 2 Strong Radio Signal 10 J Indicator for activity on SER TX Status indicator for OUT 4 inverted status Status indicator for OUT O OUT 2 Please note that the inverted status is shown 1 LED off Status indicator for OUT 3 1 LED on B Installation o Install the MPLAB environment IDE C Compiler and ICD 2 o Unpackthe TCM130 Vxxxx zip in one folder o Copy clib lib p18f452 lib and p18f452 h from the installation directory of your MPLAB C18 C compiler to this folder After that you can start MPLAB and open the project MyTCM130Project mcp If everything is installed correctly you should now be able to compile the project using the Build All button EnOcean GmbH Page 28 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean C Sample Applications Sample 1 During the first 20s after startup this sample application learns the ID of a PTM 100 switch and stores it in EEPROM Afterwards a filter for this ID is set Every time a telegram from this switch is received OUT 2 is set if a key is pressed and cleared if the key is released Watch dog timer period and brown out detection configuration d
16. are not repeated Please note The receiverOn command is executed automatically The getRadioTelegram routine must be called on a regular basis The RX buffers are only released if the maturity time has elapsed and the buffer content has been read via getRadioTelegram Otherwise the repeater will stop working Returns O radio repeater enabled 1 radio repeater could not be enabled Maturity time lt 60ms radio repeater could not be enabled Number of TX radio buffers lt Number of RX radio buffers 1 radio receiver control pin RCO wrongly configured as input Action not performed radio rx_data pin RB4 wrongly configured as output Action not performed radio antenna switch 1 pin RB2 wrongly configured as input Action not performed radio antenna switch 2 pin RC5 wrongly configured as input Action not performed OQ Ui 4 WN EnOcean GmbH Page 20 of 30 TCM 130 User Manual V2 04 da of unused energy enocean char repeaterOff Switches the integrated repeater function off The radio reception remains active The RX and TX buffers will be cleared Returns 0 radio repeater disabled void reset Performs a reset of the module char writeOut unsigned char outPin unsigned char level Set OUT 0 to OUT 4 level as defined in level The current status is stored in the global structure output char outPin 0 to 4 for OUT 0 to OUT 4 char level TRUE HIGH level FALSE LOW level global struct out4
17. areas unless the user specifies by using pragmas outside a function where the variables have to be allocated The largest connected memory area of 336 bytes is ApplicBank Please use this area for large arrays strings unions or structures If not more than 336 bytes of RAM in total are needed for the application the allocation works automatically Example for more allocating more than 336 bytes pragma udata ApplicBank unsigned char var1 336 pragma udata void main unsigned char var2 10 In this case vari is located in the special area defined as ApplicBank var2 is put into the other memory section For more information please refer to MPLAB C18 C Compiler User s Guide EnOcean GmbH Page 24 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean A Development Tools A 1 Microchip Tools Microchip offers a tool suite for the PIC 18F452 micro controller EnOcean recommends to use the following tools o Microchip MPLAB ICD 2 in circuit debugger o Microchip MPLAB IDE version 7 3 Please find version 7 3 on the CD ROM The license terms and conditions of Microchip apply The IDE is also available for free download from www microchip com o Microchip MPLAB C18 C Compiler version 3 0 Please find the full featured 60 day Student Edition on the CD ROM The license terms and conditions of Microchip apply The 60 day student edition is also available for free download from www microchip com
18. ction within a WDT period provokes a reset of the TCM130 uC Only in sleep modus the program can stay longer than the WDT period EnOcean GmbH Page 23 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean void switchWdtOn Switches the WDT on By default the WDT is on CONFIG 6 void switchW dtOff Switches the WDT off This allows saving around 10uA current consumption If the WDT is off before going to sleep waking up is only possible through a hardware signal change on pin 7 SER RX char writeEeprom unsigned char eepromAddress unsigned char data Writes the byte in data in the EEPROM address EEPROM address codes allowed are in the range 0x50 OxDF Other values out of this range are already used by the library and are therefore not permitted It is recommended to read the value in EEPROM after a write command for verification purposes Returns 0 code correctly written in EEPROM 1 address in 1 parameter not allowed char readEeprom unsigned char eepromAddress unsigned char data Reads data from EEPROM address eepromAddress and returns the value in data Returns 0 code correctly read from EEPROM 1 not allowed address code in 1 parameter 11 not allowed address in second parameter Allocation of variables in RAM In total about 0 5kB of RAM are available They are distributed over 2 memory areas For a single source code file the compiler is only able to allocate variables in one of these
19. dance receiver approx 11 kQ 14 RSSI RSSI signal from receiver Source impedance approx 20 kQ 15 Vec Supply voltage 5V 10 5 max 55 mA To reduce power consumption and for stable conditions EnOcean GmbH Page 8 of 30 TCM 130 User Manual V2 04 lee of unused energy enocean Expansion Port Pin No Symbol Function Operational characteristics 2 11 Reserved Reserved 0 iU VE supply voltage SV 10 5 max 55 mA 13 15 17 GND Groundconnection 4 19 ICSP DATA Used for programming 20 ICSP CLK Used for programming 10 0 0 0 O 3 APPLI CATI ONS INFORMATI ON Please refer to the TCM120 hardware users manual EnOcean GmbH Page 9 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean 4 API Description Important remark Please note that all interrupts are occupied by the API If interrupts are used the API may not work properly define CONFIG The first source code line of user application code must contain define CONFIG Code Through this define the user configures the watch dog timer WDT period and brown out state The following table explains the relation between the code and the configuration WDT approximate Brown out state Brown out voltage V period ms The current consumption is much lower without brown out detector relevant especially during sleep For applications using a battery where fluctuations of
20. e telegram This is necessary because a transmitter usually transmits up to 3 sub telegrams In addition a repeater may increase this number 100ms are set as default value for optimal performance with a repeater If no repeater is installed or the transmitter transmits less sub telegrams the maturity time can be reduced This may be helpful in environments with a large number of transmitters The value for time must be between 2 and 254 ms EnOcean GmbH Page 17 of 30 TCM 130 User Manual V2 04 da of unused energy enocean Returns 0 Maturity value correctly written 1 Maturity value correctly written Value under 100ms 2 Error code Maturity value not written Input value 2ms or 254ms 3 Error code Maturity value not written Value under 60ms not allowed when repeater active char setSerialSpeed unsigned char SpeedCode With this command the serial speed may be set The default value is 9600 bit s Serial speed bit s 9600 KE IZZSMwWs 19200 38400 57600 Returns 0 Serial speed correctly set 1 Error code Invalid input value char clearRadioFilter No radio telegram IDs are filtered Returns 0 filter cleared char setl DBase unsigned long IDBase With this command the user can rewrite its ID range base number The information of the 25 most significant bits is stored in EEPROM This command can only be used a maximum number of 10 times to avoid misuse Please note that this command needs 20ms f
21. ee eee nena nans 2 US IX Rx NENNE e 0 5 us I nputs up to 5 inputs configurable as digital or analog input AD conversion up to 10bit UNS m up to 5 digital outputs Free Memory e eren 144 bytes EEPROM 16 kB FLASH 0 5 kB RAM RSSI OE indicates received peak signal strength BOD Brown Out Detector WDT Watch Dog Timer 1 3 Physical Dimensions TCM120 Hardware Antenna No antenna installed 9 cm whip antenna or external antenna mountable only 1 antenna for transmit and receive Dimensions of PCB seeennnnmm ne 24 0 x 42 0 x 5 mm without wiring pins Connector surr 16 pins grid 2 0 mm 4 0 mm in length 0 5 mm All input pins connected to GND All other pins except Vcc and reset pin not connected at the time of measurement All outputs set to O EnOcean GmbH Page 6 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean Expansion Por Figure 2 TCM 120 package outlines 1 4 Environmental Conditions Operating temperature ssssssssssssssenenennnhe semen 25 up to 65 C Storage temperature 40 up to 85 C 85 up to 100 C for 1h max xi lglsH c O to 95 r h 1 5 Ordering Information Type EnOcean Ordering Code TCM 120 53003 kK120 O O O O O OOOO TCM 130 Starter Kit 63004 K130 TCM 130 Library CD ROM S3004 K930 Important note The expansion
22. efine CONFIG 3 WDT period 2s BOD on include p18f452 h include TCM130 LIB h include TCM130 CFG h void main void 4 unsigned long ID union telegram t1 unsigned char result idO id1 id2 id3 unsigned long time1 initTCM130 TCM130 init function This function must always be here as first program line It initializes the TCM130 receiverOn by default receiver is off Radio receiver functionality is desired radio receive must be activated setRxSensitivity 0 Low sensitivity for learn mode writeOut 3 1 LRN mode indicator timel getTime dof clrWdt when a PTM radio telegram is received the information will passed to t1 union if IgetRadioTelegram amp t1 amp amp t1 0rg2 5 1 writeEeprom 0x50 t1 idO store ID in EEPROM writeEeprom 0x51 t1 id1 writeEeprom 0x52 t1 id2 writeEeprom 0x53 t1 id3 break exit LRN mode P while getTime time1 lt 20000 end learn mode after 20s setRxSensitivity 1 writeOut 3 0 LRN mode indicator off clrWdt readEeprom 0x50 amp id0 read ID from EEPROM readEeprom 0x51 amp id1 readEeprom 0x52 amp id2 readEeprom 0x53 amp id3 ID unsigned long idO unsigned long id1 0x100 unsigned long id2 0x10000 unsigned long id3 0x1000000 clrWdt setRadioFilter ID set filter for learned ID while 1 X clrWdt when a radio telegram is received the information will passed to t1 union if IgetRadioTelegram amp t1 X
23. eserved 3 bit for future use Note The bit SR is used only when the lower 3 Bits from idO B 111 scene switch and RID z 0 indicates that the memory buttons MO M6 are operated in the handheld remote control Description of mdata0 5 and midO 1 If ORG Ox0A Modem telegram Please note the different structure of modem telegrams with 6 data bytes mdata0 5 and 2 address bytes midO 1 for the address of the receiving modem EnOcean GmbH Page 15 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean Description of aidO 1 If ORG OxOB Modem Acknowledge telegram Please note the different structure of modem acknowledge telegrams with 2 address bytes aid0 1 for the address of the answering modem Detailed description of STATUS field If ORG 0x05 Telegram from a PTM switch module 7 0 Reserved 2 bit for future use T21 1 bit T2120 gt PTM switch module of type 1 T2121 gt PTM switch module of type 2 NU 1 bit NU 1 gt N message NU 0 U message RP COUNTER 4 bit 0 15 Repeater level 0 is original message not repeated PTM switch modules of Type 1 e g PTM 100 do not support interpretation of operating more than one rocker at the same time e N message received Only one pushbutton was pressed e U message received gt No pushbutton was pressed when activating the energy generator or more than one pushbutton was pressed PTM switch modules of Type 2 allow interpretation o
24. f operating two buttons simultaneously e N message received gt Only one or two pushbuttons have been pressed U message received gt No pushbutton was pressed when activating the energy generator or more than two pushbuttons have been pressed Note for telegrams from PTM 100 piezo transmitters Due to the mechanical hysteresis of the piezo energy bow in most rocker switch device implementations pressing the rocker sends an N message and releasing the rocker sends a U message If ORG 0x06 0x07 0x08 or 0x0A all other telegrams 7 0 RP COUNTER Reserved 4 bit for future use RP COUNTER 4 bit Repeater level 0 original message 1 repeated message Description of ChkSum Least Significant Byte from addition of all octets except sync bytes and checksum The checksum is calculated automatically by the library char getRadioTelegram union telegram telegram When a radio telegram is received the telegram content 11 byte is stored internally There is a buffer for several telegrams The number of buffers is defined via define NR RX RADIO BUFFERS as described above The default number of buffers is 4 maximum value 10 With the function getRadioTelegram the telegram content is made available Identical telegrams arriving within the maturity time of the buffer default 100ms are treated as one telegram typically EnOcean transmitters are repeating the same message 3 times to improve the transmission probability
25. ll different kinds of telegrams e g PTM 100 or STM 100 can be generated o The TCM 130 can send on 128 different IDs derived from 1 base number Filter functionality Serial interface support Read analog and digital inputs write digital outputs EEPROM read write Timer functionality Various power down modes EnOcean GmbH Page 5 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean 1 2 Features Overview based on TCM120 Hardware Frequency modulation type transmission power 868 3 MHz ASK max 10 mW Data rate transmitter channel bandwidth receiver 120 kbps 280 kHz Transmission range sssssssssssesesee nennen sehen an nnn nn nnn 300 m free field Power supply voltage 0 0 ccc cece cece rece eee Innen nnn nn nnn nnns 5V 10 5 Sleep current without BOD and WDT seeenRemeennen typ 0 1 uA Sleep current with WDT on BOD on off eee typ 50uA 10 uA Current consumption receiver on off typ 33 mA max 40 mA 15 mA Current consumption receive transmit eeeeennnnnne max 55 mA Bi directional serial interface full duplex async 9 6 57 6 kbps Receiver features eee sensitivity can be reduced by SW command FasE POWE UD aerer uta kae bake Eta aE EE banda d ds 1ms Fast Tx power up from Stand by ccccc cece cece eeeeeeee
26. o contact the programming pins with needles EnOcean GmbH Page 26 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean The meaning of connectors indicators and switches are however different from the description in the EVA 100 manual Description of On board Connectors Symbol Function Operational characteristics Adapter Female jack for power supply 14 30 V 100 mA max RCM TCM Female header for plug in RCM or TCM module Pin 1 is module antenna side Test Female header connected directly to module leads Connector Input IN O IN 3 are available here Jack to disconnect the power supply to the inserted Bridge module EM Ground connectors for functional control outputs Pe ee RN Functional control outputs directly connected to the 5V CMOS output 20 mA max OUT 0 2 output pins of inserted module No function oam PR m DB9 female serial interface connector to PC e RCM 120 Operating Mode 0 Rx TCM RCM Selector for RCM or TCM module operation e TCM 120 Rx and Tx Description of On board Switches Symbol Function Switch 1 can be used to reset the module Switch 2 connected to IN 0 External pull up needed Switch 3 connected to IN 1 External pull up needed LRN Connected to IN 2 External pull up needed SSLM Connected to IN 3 External pull up needed Connected to IN 4 External pull up needed Figure 13 External pull ups EnOcean GmbH Page 27 of 30 TCM 130 User Manual
27. ocean char receiverOn The receiver is switched off after the start up of the module With this command the receiver is switched on the power consumption strongly increases Global unsigned char rec pdown TRUE if receiver powered down FALSE if receiver is running The flag rec pdown is set according to the current status Returns 0 radio receiver enabled 1 radio receiver control pin RCO wrongly configured as input Action not performed 2 radio rx data pin RB4 wrongly configured as output Action not performed 3 radio antenna switch 1 pin RB2 wrongly configured as input Action not performed 4 radio antenna switch 2 pin RC5 wrongly configured as input Action not performed char receiverOff With this function the receiver can be switched off The flag rec pdown is set according to the current status Global unsigned char rec pdown TRUE if receiver powered down FALSE if receiver is running Returns 0 radio receiver disabled 1 radio receiver control pin RCO wrongly configured as input Action not performed char repeaterOn Switches the integrated repeater function on For a set of sub telegrams belonging to the same telegram the repeater functions generates typically three repeated sub telegrams If the air channel is occupied at the moment of sending the number of repeated sub telegrams may be smaller than 3 Telegrams which have already been repeated are not repeated again Remote learn telegrams
28. or execution Therefore in CONFIG 1 and 4 a reset will be performed by the WDT If one of these configurations is used please switch off the WDT during execution of this command 32 0 25 most significant bits 0 0 0 0 0 0 0 Dunes Returns 0 new ID base set 1 ID base lt OxFF800000 ID base not allowed New ID not set 2 ID programmed more than 10 times New ID not set Important note When the module is programmed with your application the ID originally written to the TCM 120 module at production time is erased The default value of the ID after programming is FFFFFF80 Therefore the ID has to be changed after programming It is recommended to read the ID from the TCM 120 module before programming using the serial interface as described in the TCM 120 user manual and write this ID back to the module after programming see Sample 2 in Appendix C EnOcean GmbH Page 18 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean unsigned long readl DBase Returns unsigned long IDBase Codes in OxFF800000 OxFFFFFFFF with 7 LSBs to O char setRxSensitivity unsigned char sensitivity With this command the TCM radio sensitivity is set In LOW radio sensitivity signals from far transmitters are not detected by the TCM receiver This feature is useful when only information from transmitters in the vicinity should be processed sensitivity 1 high sensitivity typ 95 dBm 0 low sensitivity typ 65 dBm Re
29. ormed IN 2 not configured as digital Reading not performed IN 3 not configured as digital Reading not performed inPin value not allowed Reading not performed IN O configured as output Reading not performed IN 1 configured as output Reading not performed IN 2 configured as output Reading not performed IN 3 configured as output Reading not performed 10 IN 4 SER RX configured wrongly as SER RX Reading not performed 11 address pointed to by 2 parameter not allowed Reading not performed 12 IN 4 SER RX configured as output Reading not performed WOON AUABWNF O unsigned long getTime This command returns a time stamp from the internal system clock The time stamp is increased every ms gt restart from O after about 50 days During sleep the timer is stopped Please note During the transmission also repeating and reception of radio telegrams the timer may be delayed by about 1 ms per telegram Returns Current 32 bit time stamp Ox0O OxFFFFFFFF in milliseconds void nop Performs a non instruction cycle Each nop instruction lasts 100ns void wait unsigned long delay Performs a delay of delay milliseconds A clear watch dog timer is implemented to avoid a possible reset void cirWdt Clears the watch dog timer counter Clear watch dog timer should be used preferably only once in the program It should be written in a source code point which is executed on a regular basis Not clearing WDT though this instru
30. port connector which is mounted for development purposes on the modules supplied with the TCM 130 Starter Kit ist not mounted on standard TCM 120 modules In order to program the TCM 120 modules with own software it is necessary to contact the programming pins with needles EnOcean GmbH Page 7 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean 2 FUNCTI ONAL DESCRI PTI ON 2 1 Block Diagram RF Analog Digital IN 0 3 10 bit A D Trans mitter EE OUT _0 3 ia Switch ANT RF SER RX IN 4 Receiver SER TX OUT 4 RSSI RxD RESET VCC GND Figure 3 Block diagram of TCM 120 2 2 Pin Description Main connector Pin No Symbol Function Operational characteristics GND Ground connection Beas 3 IN Digital or analog input Connect to GND if not used 4 IN Digital or analog input Connect to GND if not used ANE Digital or analog input Connect to GND if not used _ ee EI ee IN 4 reception line 5V CMOS input ER ee rss omme OUT 4 transmission line 5V CMOS output 20 mA max 9 OUTO Digital output 5V CMOS output 20 mA max 10 OUT Digital output 5V CMOS output 20 mA max 11 OUT2 Digital Pigital output 5V CMOS EV CMOS output 20 mA max 20 mA max OUT 3 Digital output output 5V CMOS 5V CMOS output 20 mA max 20 mA max Raw base band data from 5V TTL output source impe
31. svensssvenssvrenssvvrnssnvenssvvenssvvenssvvenssvvesssvvenssvvesen 24 EnOcean GmbH Page 3 of 30 TCM 130 User Manual V2 04 da of unused energy enocean void switehnWdtON d PN T UU T u m 24 char writeEeprom unsigned char eepromAddress unsigned char data 24 char readEeprom unsigned char eepromAddress unsigned char data 24 Allocation of variables in RAM essere nnne nnne nennen nene rnn sensere sen nns serere n rnnt 24 A Development TOO Ls 25 AMT NN E m meme 25 ME ENTEN 26 Be ka sj Es 8 e E E E S 28 C SNE APPEAU I opis rav eru sever D DUCERE EDI asain EUC SPEI EIIRREIE MNT CUI IDEE EDGE EE 29 EnOcean GmbH Page 4 of 30 TCM 130 User Manual V2 04 da of unused energy enocean 1 GENERAL DESCRIPTION The TCM 130 is a software API for the transceiver module TCM 120 of EnOcean It enables the realization of bi directional RF applications based on the innovative EnOcean radio technology The TCM 120 transceiver module serves the 868 MHz air interface protocol of EnOcean It receives all signals of the EnOcean radio transmitters based on e g modules PTM 100 STM 100 and makes them available via an API The API provides several hardware interfaces such as a serial interface 10bit A D inputs and digital inputs and digital outputs Figure 1 TCM 120 module 1 1 Basic Functionalities e Receive and transmit EnOcean radio telegrams o A
32. the voltage are not expected it may be helpful to switch off the brown out detector and extend battery life Please note The WDT period strongly depends on temperature Please refer to the data sheet of the PIC18F452 micro controller for more details If not specified _CONFIG 6 is used Important note It may take up to 60ms until the receiver is stable after a receiverOn repeaterOn or return from sleep command It may happen that during that time the interrupt routine for receiving is called quite often during that time In combination with a WDT period of 16ms this may lead to a repeated reset of the module define NR RX RADIO BUFFERS With this define the number of rx radio buffers is defined i define NR RX RADIO BUFFERS NumBuf NumBuf must be between 4 and 10 The default value is 4 Please note e The free RAM size is reduced by increasing the number of radio buffers e he number of radio buffers must be defined before initTCM130 is executed EnOcean GmbH Page 10 of 30 TCM 130 User Manual V2 04 The power of unused energy enocean define NR TX RADIO BUFFERS With this define the number of tx radio buffers is defined i define NR TX RADIO BUFFERS NumBuf NumBuf must be between 1 and 11 The default value is 1 Please note e The free RAM size is reduced by increasing the number of radio buffers e The number of radio buffers must be defined before initTCM130 is executed e If the repeater functionality is used the
33. turns 0 sensitivity set 1 radio sensitivity uC pin RA4 wrongly configured as input Sensitivity not set char readRxSensitivity Returns 0 low radio sensitivity typ 65 dBm 1 high radio sensitivity typ 95 dBm 2 radio sensitivity uC pin RA4 wrongly configured as input Sensitivity not read char sleep unsigned long time Sleep for a time interval specified in WDT period units as defined in CONFIG The I O ports maintain the status they had before the Sleep instruction was executed For lowest current consumption in this mode place all I O pins at either VDD or VSS ensure no external circuitry is drawing current from the I O pin Pull all I O pins that are hi impedance inputs high or low externally to avoid switching currents caused by floating inputs With a signal change on the SER RX line it is also possible to wake up the module Please note o If the WDT has been switched off the unit will only wake up with the signal change on SER RX o If a telegram has been sent via the serial interface using the sendSerialTelegram command it is necessary to wait for about 20ms before entering the sleep mode Otherwise the serial telegram will not be transmitted completely o RX TX radio buffers are erased by the function before entering in sleep Returns 0 Watch dog timer woke up uC from sleep 1 External signal woke up uC from sleep EnOcean GmbH Page 19 of 30 TCM 130 User Manual V2 04 En of unused energy en
34. y and specifications are subject to change without notice For the latest product specifications refer to the EnOcean website http www enocean com As far as patents or other rights of third parties are concerned liability is only assumed for components not for applications processes and circuits implemented within components or assemblies EnOcean does not assume responsibility for use of devices described and limits its liability to the replacement of devices determined to be defective due to workmanship Devices or systems containing RF components must meet the essential requirements of the local legal authorities EnOcean GmbH does not recommend the use of its products in life support applications and will not knowingly sell its products for use in such applications unless it receives an adequate products liability indemnification insurance agreement Components of the modules are considered and should be disposed of as hazardous waste Local government regulations are to be observed Packing Please use the recycling operators known to you By agreement we will take packing material back if it is sorted You must bear the costs of transport For packing material that is returned to us unsorted or that we are not obliged to accept we shall have to invoice you for any costs incurred EnOcean GmbH Page 2 of 30 TCM 130 User Manual V2 04 da of unused energy enocean Table of Contents l GENERAL DESCRIPTION rank ekorn EX REA

Download Pdf Manuals

image

Related Search

Related Contents

Toshiba Satellite S55t-A5138  NL Gebruiksaanwijzing DE Bedienungsanleitung EN Instruction  Panasonic CQ-C1001U - PanasonicCQ  Hedge Trimmer Heckenschere Taille-Haies Tosasiepi  Relatório Final do EP de Fogões e Fornos a Gás - 1ª rodada  GX-9100 Software Configuration Tool for Windows User's Guide  Le commerce électronique : une réalité du développement  Manual de Usuario versión 2.2  

Copyright © All rights reserved.
Failed to retrieve file