Home

Developing your M24LR64-R datalogger application

image

Contents

1. 24 Main routine algorithm 26 Acquisition running algorithm llle III 27 Start acquisition stop acquisition acquisition update algorithms 27 M24LR64 R Datalogger application software home page 28 START button algorithm ER Re hh 29 STOP button algorithm 30 TRACE GRAPH algorithm 31 Dynamic view timer algorithm ese EE ES EE ee ek Ih 32 Temperature acquisition datalogger schematics 34 Doc ID 17419 Rev 1 5 42 Overview of M24LR64 R datalogger application AN3209 1 Overview of M24LR64 R datalogger application 1 1 Board architecture The entire circuit is implemented on a 90x50 mm PCB board which integrates the three ST components M24LR64 R STTS75 and STM8L101K3 plus a 20x40 mm antenna connected to the dual EEPROM RF interface The system is supplied from a 3 V battery BR2330 fixed on the back side of the PCB as shown in Figure 2 The board is equipped with a connector which provides an easy access to the STM8L101K3 SWIM signal required to program the microcontroller and debug the firmware see Figure 2 This reference board allows the SDA and the SCL DC signals to be probed using dedicated connectors Figure 1 Datalogger front side view Temperature Sensor STTS75 Microcontroller STM8L STMicroelectronics M24LR64 Dual Interface EEPROM Data logger M24LR64 R v2 REV A Antenna Al18019b Figure 2 Datalogger back
2. TI AN3209 YI Application note Developing your M24LR64 R datalogger application for temperature acquisition June 2010 Introduction The M24LR64 R is a Dual interface EEPROM Since it has both an 13 56 MHz ISO 15693 RFID and a 400 kHz I2C interface the device is a good solution for RF enabled sensors for which ST has developed a reference design One of the main benefits brought by the M24LR64 R is that the sensor data can be accessed in read and write mode without consuming any on board power This application note presents a practical useful application for the M24LR64 R datalogger It describes an autonomous battery powered datalogger able to record and store 64 Kbits of temperature data using the M24LR64 R Dual interface EEPROM CC and RF The datalogger microcontroller is an STM8L101K3 It communicates with the M24LR64 R using its serial interface and controls an STTS75 digital temperature sensor An on board demonstration firmware the M24LR64 R Datalogger application firmware stored in the STM8L101K3 memory selects and controls the temperature acquisition through a RFID reader connected by a USB cable to a PC The application is delivered with a PC software the M24LR64 R Datalogger application software to configure and control the datalogger as well as download and display the temperature values ST provides all the resources required to develop your own datalogger application and PC software e Source files of the
3. CH1 PB3 HS TIM2 P B2 HS TIM2 Al18024 Doc ID 17419 Rev 1 15 42 Component overview AN3209 Figure 11 STM8L101K3 functional block diagram PA 6 0 PB 7 0 PC 6 0 PD 7 0 COMP REF Power 16 MHZ int RC Clock Wr controller Volt reg Vss 38 kHz int RC Clocks to core and peripherals PORPDR STM8 Core up to 16 MHz Up to 8 Kbytes Flash memory including up to 2 Kbytes Nested interrupt controller up to 29 external interrupts Debug module SWIM KID multimaster TI SDA SCL um SPI de IN M2 out 16 bit Timer 2 gd mog 16 bit Timer 3 pi TIM3 CH 2 1 TIM3 TRIG gt Q 2 x o 0 o m 3 a 2a D o o c o 8 bit Timer 4 Al18025 2 2 2 STM8L101K3 IC interface The STM8L101K3 I C peripheral allows multimaster and slave communications with bus error management in standard up to 100 kHz or fast up to 400 kHz mode In the demonstration datalogger application only the single master mode is used DC synchronous communications require only two signals SCL Serial clock line and SDA Serial data line The corresponding port pins must be configured as floating inputs Refer to the STM8L101K3 datasheet for additional details To manage errors resulting from DC and RF arbitration an error management mode has been implemented in the FC library i2c_ee c called by the M24LR64 R_Datalogger_application_firmware see AN3057 for de
4. DataLogger Function description Prototype Function ReadRF single DataLogger lngAddLow As Long yp lngDataSize As Long lngNbByteAddress As Long As String IngAddLow address the read operation starts from Parameters IngDataSize number of data bytes to be read IngNbByteAddress number of bytes used to code the address Returned String value ReadRF_single_DataLogger 0 4 2 returns the 4 bytes read from address Example 0 coded on 2 bytes B 4 Read Multiple Block The Read Multiple Block ISO 15693 command is performed by calling the ReadRF multiple DataLogger function Table 13 ReadRF multiple DataLogger Function description Function ReadRF multiple DataLogger lngAddLow As Long Prototype 1ngRowNumber As Long lngDataSize As Long lngNbByteAddress As Long As String IngAddLow address the read operation starts from IngRowNumber number of blocks to be read maximum 32 P t SES IngDataSize number of bytes per block IngNbByteAddress number of bytes used to code the address Returned String value ReadRF multiple DataLogger 0 32 4 2 returns in 32 4 bytes read from the address Example 0 coded on 2 bytes Doc ID 17419 Rev 1 37 42 M24LR64 R RF commands AN3209 B 5 B 6 38 42 Write single block The Write Single Block ISO 15693 command is performed calling the ReadRF multiple DataLogger function WriteSingleBlockRF DataLogger function Table 14 WriteSingleBlockRF DataLogg
5. EX SE RE RE RR ER ENE HERE EE 36 B3 Read single DOEK sis EE EEN RE ER 3o EIN EER EE RE eed d 37 B4 Head Multiple Block ee ema ebd Mee KEES dune EE DiE 37 Bs Write single block as RR x edt ba ER Bi EE EE ED KAG 38 B 6 estarcommands iss EE EE EE EE Ee ke ke ee ee lees 38 Appendix C STTS75 IC commande 39 C 1 Acquire temperature isi EE ER ES Re ee ees 39 C2 Read acquired Temperature 39 6 Revision history wd nin somnia hor mr RO OR OR s N Ne E ENKE ll 41 ky Doc ID 17419 Rev 1 3 42 List of tables AN3209 List of tables Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Table 10 Table 11 Table 12 Table 13 Table 14 Table 15 Table 16 Table 17 4 42 M24LR64 R signal names sussana naaa 8 PG page tel 10 Baa AA RA 10 M24LR64 R R memory organization 0 00 eee 12 Status byte values ie ss se teas 13 Overwrite byte values rh 13 Delay byte valueS escrir cried rrak or Erer eee 13 Relationship between temperature and digital output EE eaaa 20 Component values for schematics EE EE Se Se Se Se ees 35 Inventory DataLogger EE eee 36 ResetToReadyRF DataLogger EE EE Ee Se Ee ren 36 ReadRF single DataLogger EE cect ee ren 37 ReadRF multiple Datalogger EE EG EG Ee Ge ren 37 WriteSingleBlockRF Datalogger EE EE Re Ee Re Re ee ed eee 38 l2 SS Config RR cere EE EO OE EE Pade EE 39 I2C SS C
6. Status Byte Low battery START message appears NO Write Status Byte STOP Switch Stop button in Start button Authorize Dynamic view 5 1 3 TRACE GRAPH button algorithm Al18031 Clicking the TRACE GRAPH button from the menu downloads all the acquired temperature values stored in the M24LR64 R memory through the RF interface and displays a graphical representation of these data When the delay is set to 1 s the window displays a checkbox that allows the user to activate a dynamic view Figure 25 shows the TRACE GRAPH algorithm 30 42 Doc ID 17419 Rev 1 AN3209 PC software Figure 25 TRACE GRAPH algorithm Send Inventory command SUCCESS Read Status Byte Status Byte RUNNING There is no Data Logger in the reader field Read Delay Byte Delay Byte sis Authorize Dynamic view Trace a graph of stored temperatures Switch Trace Graph button in Refresh Graph button Start Timer Al18032 Timer management When the timer function is enabled it is executed once per second This function is used for graphic animations such as dynamic view periodic thermometer refresh display of the number of acquisition values and meteorological pictogram As an example when the Dynamic view option box is checked and as long as the datalogger stays in the reader field the acquired temperature values are automatically added to the graph each second see Figure 26 for a
7. algorithm main c is located at C Program Files M24LR64 R Datalogger ApplicationlsourcesWM24LR64 R Datalogger application firmware or by clicking Start M24LR64 R Datalogger Application M24LR64 R Datalogger application firmware The datalogger firmware is based on an infinite loop The first operation checks the status byte stored in the M24LR64 R dual mode EEPROM This byte indicates the state of the datalogger STARTED or STOPPED Doc ID 17419 Rev 1 25 42 Developing compiling and debugging your datalogger firmware AN3209 Figure 19 Main routine algorithm Power I2C bus Power dual mode EEPROM stop acquisition NO Read dual mode EEPROM Status byte start acquisition acquisition update acquisition running dual mode EEPROM RUNNING Al18027 26 42 Doc ID 17419 Rev 1 d AN3209 Developing compiling and debugging your datalogger firmware 4 3 2 4 Acquisition algorithm functions Figure 20 Figure 21 and Figure 23 describe the algorithms corresponding to the red rectangle functions of the main routine see Figure 19 Figure 20 Acquisition_running algorithm acquisition_running Power temperature sensor Read dual mode EEPROM Overwrite Authorized write the sensor to acquire a temperature read the sensor to get the acquired temperature Write the temperature in the dual mode EEPROM start_acquis
8. data logger firmware M24LR64 R Datalogger application firmware they allow implementing DC communications between the M24LR64 R the STTS75 and the STM8L101K3 e Source files of the PC software M24LR64 R Datalogger application software they control RF communications between the M24LR64 R and an RFID reader Basic information about the M24LR64 R STTS75 and STM8L101K3 component characteristics as well as a description of the algorithms for the datalogger firmware and PC software are provided in this document Reference documents e M24LR64 R datasheet e M24LR64 R tool driver install guide user manual UM0863 e Using the M24LR64 R datalogger reference design user manual UM0925 e How to manage M24LR64 R data transfers from the I2C bus or an RF channel application note AN3057 e STM8L101K3 datasheet e STM8L101 reference manual RM0013 e STTS75 datasheet The documents are available from http www st com dualeeprom Doc ID 17419 Rev 1 1 42 www st com Contents AN3209 Contents 1 Overview of M24LR64 R datalogger application 6 1 1 Board architecture 6 1 2 Communication interfaces 7 1 3 Power management ses sis dusk ER EE EE PRAE SEER EED ENE RR EE Ed 7 2 Component overview 8 2 1 M24LR64 R Dual interface EEPROM 8 2 1 1 M24LR64 R main features llli 8 2 1 2 M24LR64 R PC Interface 9 2 1 3 M24LR64 R RF Interface EE EE EE EE ER ee 11 2 1 4 Datalogger mem
9. is available under START gt Programs gt ST Toolset gt Development Tools gt ST Visual Develop C compilers The C compilers are integrated into the STDV development environment They allow to directly configure and control the building of your application through an easy to use graphical interface The demonstration application uses STM8 Cosmic C compiler free version up to 16 KBytes of code Doc ID 17419 Rev 1 ky AN3209 Developing compiling and debugging your datalogger firmware Cosmic compiler is available with the related documentation at http www cosmicsoftware com download stm8 16k php Note 1 You have to request a free license to use the compiler 2 Refer to hitp www cosmic software com and hitp www raisonance com for more information on complier download installation and configuration 4 3 Description of the datalogger firmware The M24LR64 R Datalogger application firmware implemented in the STM8L101K3 is low power oriented It manages two power consumption modes Active consumption mode where the operations are executed by the application e Low consumption mode when no operation is ongoing the application switches to low consumption mode for a predefined delay The following sections describe the main and the acquisition routines where the red rectangles represent functions Each function is described in details in a dedicated section 4 3 1 Main routine Figure 19 describes the flowchart of main c file
10. not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners 2010 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 42 42 Doc ID 17419 Rev 1 ky
11. serial clock The device I C address is 1010 0000b 0xA0 The 1 C master writes and reads to from the M24LR64 R memory These basic operations are performed by the M24LR64 R_Datalogger_application_firmware by calling i2c_ee c library functions Write operations To write to the memory the DC master sends write commands to the M24LR64 R The command frame must be compliant with the format described in Figure 7 The M24LR64 R_Datalogger_application_firmware calls the 12c EE PageWrite function which programs a set of bytes into the EEPROM see Table 2 for a description and an example Write DC frame format AC AC vrl Page Write l Dev Select Byte address Byte address Data in 1 Data in 2 Data in N LLJ R W K ACK K ACK ACK ACK A Star Stop Al18422 Doc ID 17419 Rev 1 9 42 Component overview AN3209 10 42 Table 2 I2C page write function Function description I2C EE PageWrite uint8 t pBuffer uintl6 t WriteAddr Function name uint8 t NumByteToWrite pBuffer pointer to the buffer containing the data to be written to the EEPROM Parameters WriteAddr internal address of the EEPROM where the data must be written NumByteToWrite number of bytes to be written into the EEPROM ErrorStatus Return value SUCCEEDED FAILED I2C EE PageWrite s data 0x0002 0x01 writes the content of the buffer pointed by sedate at address 0x01 Example To read from
12. side view Battery 6 SWIM connector O O Al18020b 6 42 Doc ID 17419 Rev 1 1577 AN3209 Overview of M24LR64 R datalogger application 1 2 1 3 Communication interfaces The communications between the STM8L101K3 M24LR64 R and STTS75 are performed through an DC bus The STM8L101K3 acts as the IC master and both the M24LR64 R and STTS75 act as slaves The Dual interface EEPROM is also connected to an antenna to communicate with the RFID reader Refer to Figure 3 for an overview of the communication interfaces Figure 3 STM8L101K3 M24LR64 R STTS75 communication block diagram Master i Slave STTS75 temperature sensor 12C STM8L Microcontroller 12C Slave 12C M24LR64 Dual Interface EEPROM A118021 Power management The datalogger is a low power application requiring a particular power management The entire power supply is managed by the microcontroller which is the only device directly powered by the battery see Figure 4 Both slave nodes and I C power supply Vcc are powered by the STM8L101K3 microcontroller Figure 4 Datalogger power management STM8L Microcontroller M24LR64 R Al18022 Doc ID 17419 Rev 1 7 42 Component overview AN3209 2 2 1 8 42 Component overview This section describes the main characteristics of the three STMicroelectronics components M24LR64 R STTS75 and STM8L101K3 It explains how to configure them for
13. the temperature acquisition application and it describes the corresponding code function and examples M24LR64 R Dual interface EEPROM M24LR64 R main features The M24LR64 R device is a dual access electrically erasable programmable memory EEPROM It features an DC interface and can be operated from a Vcc power supply It is also a contactless memory powered by the received carrier electromagnetic wave The M24LR64 R is organized as 8192x8 bits in the DC mode and 2048x392 bits in the ISO 15693 and ISO 18000 3 mode 1 RF mode Figure 5 M24LR64 R pinout Al15107 Figure 6 M24LR64 R functional block diagram Row decoder ACO AC1 Al5123 Table 1 M24LR64 R signal names Signal name Function Direction EO E1 Chip Enable Input SDA Serial Date VO SCL Serial Clock Input Doc ID 17419 Rev 1 DI AN3209 Component overview Figure 7 Table 1 M24LR64 R signal names continued Signal name Function Direction ACO AC1 Antenna coils VO Voc Supply voltage Vss Ground M24LR64 R IC interface The M24LR64 R can work both in standard and Fast DC modes The device carries a built in 4 bit device type identifier code 1010b compliant with the DC bus definition For the demonstration application the STM8L101K3 master operates at a speed of 100 kHz The M24LR64 R behaves as a slave for the 1 C protocol with all memory operations synchronized by the
14. with a data rate of 1 6 Kbit s using the 1 256 pulse coding mode or 26 Kbit s using the 1 4 pulse coding mode Outgoing data are generated by the M24LR64 R load variation using Manchester coding with one or two subcarrier frequencies at 423 kHz and 484 kHz Data are transferred from the M24LR64 R at 6 6 Kbit s in low data rate mode and 26 Kbit s high data rate mode The M24LR64 R supports the 53 Kbit s in high data rate mode in one subcarrier frequency at 423 kHz The M24LR64 R follows the ISO 15693 ISO 18000 3 mode 1 recommendation for radio frequency power and signal interface RF commands are sent and decoded by the RFID reader The demonstration application can operate with FEIG and estar USB readers for compliance with the available M24LR64 R kits e Development kit FEIG reader e Demonstration kit FEIG reader e Starter kit estar reader The commands depend on the type of reader The PC M24LR64 R Datalogger application software is developed in Visual Basic It includes functions allowing to operate the datalogger with both FEIG and estar readers e Inventory Reset To Ready Read Single Block Write Single Block Read Multiple Block Refer to Appendix B M24LR64 R RF commands for a detailed description of these functions Doc ID 17419 Rev 1 11 42 Component overview AN3209 12 42 FEIG commands FEIG readers are delivered with a package to develop and program application software in AINSI C C and Visual Basic se
15. 1 4 2 4 2 1 4 2 2 24 42 Developing compiling and debugging your datalogger firmware Installing the datalogger application firmware The source code of the demonstration M24LR64 R Datalogger application firmware is then available under C Program Files M24LR64 R_Datalogger_Application sources M24LR64 R_Datalogger_application_firmware see Figure 16 or by clicking Start gt M24LR64 R_Datalogger_Application gt M24LR64 R_Datalogger_application_firmware Software tool chain overview To develop compile and run an application software on an STM8L101K3 microcontroller the following software tool chain components are required see Figure 18 e Integrated development environment IDE composed of the ST Visual Develop STDV and the ST Visual programmer software interface STVP e ACcomplier e The R LINK hardware Figure 18 Needed material to compile and run an application on STM8L101K3 Ry D CG SH SE E Seta tagoerl 3 Data Logger R LINK ST Visual Develop Al18026 ST Visual Develop STDV STVD is a full featured development environment It is a seamless integration of the Cosmic and Raisonance C compilers for STM8 microcontroller family STDV software is available at http st com stonline products support micro files sttoolset exe To install STDV download the installation software and follow each step of the installation wizard When the installation is complete the executable
16. OMIQQ EE ER N OE OE Hd 40 Document revision history 41 Doc ID 17419 Rev 1 ky AN3209 List of figures List of figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 27 Datalogger front side view 6 Datalogger back side view 6 STM8L101K3 M24LR64 R STTS75 communication block diagram 7 Datalogger power management 7 M24LR64 R pinout RE EE ER EE EE dud EO EE 8 M24LR64 R functional block diagram EE EE EE EG eee 8 eni format OE AE N EE de EE N N N 9 Read Cras tonal EE 10 FEIG software support for windows 12 STM8L101K3 32 pin package pinout EE RR EE Ee Re Se eee 15 STM8L101K3 functional block diagram ie EE EE EE SG ae 16 STTS75 temperature sensor pinout is EE ER RE EE Ee s 18 STTS75 temperature sensor block diagram is EE EE eee 18 Typical Pointer Set Configuration Register Write ie EE Ee EE ee ee ee ee 19 Typical pointer set followed by a READ for 2 byte register 20 M24LR64 R Datalogger Application Software folder structure 22 M24LR64 R Datalogger Application Software start menu 23 Needed material to compile and run an application on STM8L101K3
17. Table 5 for the meaning of each possible value Table 5 Status byte values Status byte value Description 0x11 START 0X22 PAUSED 0x33 RUNNING 0x44 STOPPED 0x55 UPDATE 0x66 OTHER e Overwrite byte During the acquisition the temperature values are stored in the memory When the memory is full the application can either stop or rewrite data starting from the first address depending on the value of the Overwrite byte see Table 6 Table 6 Overwrite byte values Overwrite byte value Description Ox1 1 Overwrite authorized Any other values Overwrite non authorized e Delay byte The Delay byte contains the value of the acquisition rate see Table 7 Table 7 Delay byte values Delay byte value OXOD Description s 1 Temperature measured and saved every second Comment 0x10 30 Temperature measured and saved every 30 seconds e Nb Temp bytes NbTemp bytes contains the number of temperature values stored in the memory It consists in two hexadecimal coded bytes The number of temperature values is the concatenation of Nb Temp 1 and Nb Temp 0 where Nb Temp 0 is the LSB and Nb Doc ID 17419 Rev 1 13 42 Component overview AN3209 14 42 Temp 1 is the MSB For example if Nb Temp 0 equals OxF3 and Nb Temp 1 equals 0x02 then the number of acquired temperature values is OxO2F3 755d Application data Temp bytes Tempx 0
18. and Tempx 1 contain the raw temperature see Table 4 x ranging from 1 to 4092 For example if Tempx 0 0x1E and Tempx 1 is 0x80 the concatenation of these two bytes gives the temperature value that is OX1E80 corresponding to 30 5 C according to the temperature sensor format The temperature format conversion is performed by issuing the following Visual Basic command function convert temp TempToConvert As String As Single Doc ID 17419 Rev 1 ky AN3209 Component overview 2 2 STM8L101K3 8 bit low power microcontroller 2 2 1 STM8L101K3 overview The STM8L101K3 part number STM8L101K3T6 8 bit low power microcontroller features an enhanced STM8 CPU core which provides an increased processing power up to 16 MIPS at 16 MHz while maintaining the advantages of a CISC architecture of improved code density 24 bit linear addressing space and an optimized architecture for low power operations see Figure 10 and Figure 11 For more details refer to the STM8L101K3 datasheet and to the STM8L101xx reference manual RMOO13 Figure 10 STM8L101K3 32 pin package pinout _RX 2 Do T O O0 E xr 5 n H ik za G 2 9 o 0 2 o x O SZ a PC3 HS USART TX PC2 HS USART PC1 12C_SCL PCO IEC SDA PB7 HS SPI_MISO PB6 HS SPI_MOSI PB5 HS SPI_SCK PB4 HS SPI NSS _CH1 TRIG COMP2_CH2 CH2 COMP2 PB1 HS TIM3 CH1 COMP1_CH2 PDO HS TIM3 CH2 COMP1 CH3 PBO HS TIM2_CH1 COMP1
19. any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE ST PRODUCTS ARE NOT RECOMMENDED AUTHORIZED OR WARRANTED FOR USE IN MILITARY AIR CRAFT SPACE LIFE SAVING OR LIFE SUSTAINING APPLICATIONS NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY DEATH OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ST PRODUCTS WHICH ARE NOT SPECIFIED AS AUTOMOTIVE GRADE MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall
20. description of the Timer function used in conjunction with the Dynamic view Refer to UM0925 for a description of the other animations Doc ID 17419 Rev 1 31 42 PC software AN3209 Figure 26 Dynamic view timer algorithm Read NbTemp Byte EE is no Data Logger in Y the reader field SUCCESS Display the number of Stored Temperatures Read the last acquired temperature Wait for 1s Display the last acquired temperature Is Dynamic view Show Dynamic view CheckBox Enabled unChecked Dynamic view CheckBox Checked Hide D ic vi heckB temperature to the graph Al18033 d 32 42 Doc ID 17419 Rev 1 AN3209 Temperature acquisition datalogger schematics Appendix A Temperature acquisition datalogger schematics Figure 27 and Table 9 describe the electrical schematics of the datalogger for temperature acquisition 4 Doc ID 17419 Rev 1 33 42 AN3209 Temperature acquisition datalogger schematics Figure 27 Temperature acquisition datalogger schematics M24LR64 Data Logger Antenna36 pF J1 CONN H4 Antenna STMicroelectronics M24LR64 V1 0 March 2010 Doc ID 17419 Rev 1 34 42 AN3209 Temperature acquisition datalogger schematics Table 9 Component values for schematics Component Quantity Description U1 1 M24LR64 R U2 1 STM8L101K3 U3 1 STTS75 R1 amp R2 2 19 kQ R3 1 10 kQ C1 1 100 nF J1 1 Connec
21. e Figure 9 Figure 9 FEIG software support for windows Java NET NET library NETTO Java library C class library Not free of OBIDISC4J FEDM Function libraries DLL Al18023 Estar commands Estar readers are delivered with a package to develop and program application software in ANSI C C 4 and Visual Basic The following dll files are provided e For Visual Basic HIDdll bas e For C C HIDdll h HIDdlLlib Datalogger memory mapping The M24LR64 R memory is used as described in Table 4 The first two blocks of sector 0 contain critical system parameters and application data Table 4 M24LR64 R R memory organization teg iP eege kab bit 31 24 bit 23 16 bit 15 8 bit 7 0 0 0 0 RFU Delay Overwrite Status 0 1 4 RFU RFU Nb Temp 1 Nb Temp 0 0 2 8 Tempe 1 Temp2 0 Temp1 1 Temp1 0 0 3 12 Temp4 1 Temp4 0 Temps 1 Temp3 0 0 4 16 Temp6 1 Temp6 0 Temp5 1 Temp5 0 0 5 20 Tempe 1 Temps 0 Temp7 1 Temp7 0 Doc ID 17419 Rev 1 ky AN3209 Component overview Table 4 M24LR64 R R memory organization Sector RF block CC byte T M T TS number address address bit 31 24 bit 23 16 bit 15 8 bit 7 0 63 2016 8064 bai ng Lu cui Temp4091 1 Temp4091 0 System bytes e Status byte The Status byte shows the current application state Refer to
22. er Function description Function WriteSingleBlockRF DataLogger 1ngadd As Long strData Prototype As String lngDataSize As Long lngNbBytesAddress As Byte As integer Ingadd address where the data must be written EE strData String containing the data to be written IngDataSize number of data bytes to be written IngNbBytesAddress number of bytes used to code the address a ErrorStatus eturned SUCCEEDED value FAILED WriteSingleBlockRF_DataLogger 0 Data To Send 4 2 returns SUCCEEDED if Example the data write has succeeded FAILED otherwise estar commands All previous Visual Basic functions are compatible with estar readers Doc ID 17419 Rev 1 ky AN3209 STTS75 I2C commands Appendix C STTS75 IC commands The M24LR64 R Datalogger application firmware uses the i2c ee c C library to interface with the STTS75 temperature sensor The library is available under C Program Files M24LR64 R_Datalogger_Application sources M24LR64 R_Datalogger_application_firmware or from Start gt M24LR64 R_Datalogger_Application gt M24LR64 R_Datalogger_application_firmware The address Byte defines the address of the STTS75 on the I C bus It is defined by the SENSOR_ADDRESS global variable of the i2c_ee c define SENSOR ADDRESS 0x90 C 1 Acquire temperature The I2C SS Config function configures the STTS75 in temperature acquisition mode Refer to the STTS75 datasheet for a detailed description of t
23. he pointer byte and of the corresponding registers Table 15 DC SS Config Function description Prototype I2C SS Config uinti6 t ConfigBytes ConfigBytes 2 bytes resulting from the concatenation of the Pointer byte and Configuration byte Pointer byte Bits P2 to P7 must always be set to 0 Bits PO and P1 define the Parameters pointer value corresponding to the register to be configured Configuration byte Value to be programmed in the Configuration register It is the last byte of the Pointer Set Configuration Register Write frame see Section Acquire temperature Default value is OxOO ErrorStatus Returned SUCCEEDED value FAILED Example I2C SS Config 0x0183 configures the STTS75 to perform one temperature acquisition with a resolution of 9 bits and store the value in the 16 bits temperature register where Pointer byte 0x01 Configuration byte 0x83 ConfigBytes 0x0183 C 2 Read acquired Temperature The 2C SS BufferRead function allows to read a temperature acquisition value KY Doc ID 17419 Rev 1 39 42 STTS75 I2C commands AN3209 Table 16 DC SS Config Function description I2C SS BufferRead unit8 t pBuffer unitl6 t ReadAddr Prototype unit8 t NumberByteToRead pBuffer pointer to the buffer containing the 2 bytes temperature data This buffer contains the acquired temperature coded on 2 bytes refer to Table 8 Relationship between temperature and dig
24. ibration functions of the STM8L101 firmware library see code example below AWU_AutoLSICalibration AWU Init AWU Timebase 1s AWU Cmd ENABLE The datalogger FW then issues the HALT instruction to switch the microcontroller to Active halt low power mode In the following function command3 will automatically be executed 1second after command2 according to the previous configuration void function void commandi command2 halt command3 Doc ID 17419 Rev 1 17 42 Component overview AN3209 2 3 Digital temperature sensor 2 3 1 STTS75 main features The STTS75 is a high precision CMOS digital temperature sensor IC with a programmable 9 to 12 bit analog to digital ADC converter and an I2C compatible serial digital interface The STTS75 typically accuracy is 3 C over the full temperature measurement range of 55 to 125 C and 2 C in the 25 to 100 C range It operates from a 2 7 to 5 5 V supply voltage with a typical supply current of 75 pA at 3 3 V For the demonstration datalogger application the sensor is configured to the default resolution settings that is 9 bits to achieve a temperature resolution of 0 5 C The STTS75 is factory calibrated and requires no external components to measure temperature Figure 12 STTS75 temperature sensor pinout spa EI 8E3vpp Sel ES o S INT C SEA GND CI 5 KI Ap AI1 1841 1 SDA and OS INT are open drain Figu
25. ital output Parameters pBuffer 1 and pBuffer 2 are the MSB and the LSB respectively ReadAddr Pointer byte The Pointer byte must be set to 0x00 to access the temperature register NumberByteToRead Number of bytes to read ErrorStatus Returned SUCCEEDED value FAILED Example I2C SS BufferRead pBuffer 0x00 0x02 accesses the sensor temperature register and stores the read value in pBuffer d 40 42 Doc ID 17419 Rev 1 AN3209 Revision history 6 Revision history Table 17 Document revision history Date 08 Jun 2010 Revision 1 Initial release Changes Doc ID 17419 Rev 1 41 42 AN3209 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If
26. ition stop_acquisition Al18028 Figure 21 Start_acquisition stop_acquisition acquisition update algorithms stop acquisition start acquisition acquisition update Write dual mode Delay read dual mode Delay Byte Byte 1s Configure AWU with Delay read dual mode Delay Byte Byte Value Configure AWU with Delay Byte Value write dual mode Status Byte RUNNING write dual mode Number of temperature Bytes 0x0000 write dual mode Status Byte STOPPED write dual mode Status Byte RUNNING Al18029 Doc ID 17419 Rev 1 27 42 PC software AN3209 5 5 1 PC software Once the setup exe file is installed the M24LR64 R Datalogger application software project is available under C Program Files M24LR64 R Datalogger Application1sources1M24LR64 R Datalogger application software or from the menu Start M24LR64 R Datalogger Application M24LR64 R Datalogger application software The M24LR64 R Datalogger application software is developed with Visual Basic 6 0 Double click on DATA LOGGER source code Software Launch Project vbp to open the corresponding workspace in Visual Basic Description of the PC software A user interface features all the functions and options to launch and control the temperature sensing datalogger application see Figure 22 e START STOP button see Section 5 1 1 e STOP button see Section 5 1 2 e TRACE GRAPH button see Sectio
27. n 5 1 3 e Dynamic view checkbox see Section 5 1 4 Figure 22 M24LR64 R Datalogger application software home page 57 M24LRxx Application Software Reader Application Image Transfer Application Demo STM32 PRIMER2 Datalogger Tools Help m S Form1 Number of Acquisition 36 www st com version 1 5 data logger V1 0 STMicroelectronics Ej m24LRxx Application 28 42 Doc ID 17419 Rev 1 ky AN3209 PC software 5 1 1 START button algorithm In data acquisition mode clicking the START button from the menu writes the START value in the Status byte see Section System bytes via the RF interface and starts data acquisition Figure 23 shows the START button algorithm Figure 23 START button algorithm Start Acquisition Send Inventory command SUCCESS Read Status Byte Status Byte START There is no Data Logger in the reader field Low battery message appears YES Mr am Authorize Dynamic view Start Timer Al18030 Doc ID 17419 Rev 1 29 42 PC software AN3209 5 1 2 STOP button algorithm In data acquisition mode clicking the STOP button from the menu writes the STOP value in the application Status byte see Section System bytes via the RF interface and stops data acquisition Figure 24 shows the STOP button algorithm Figure 24 STOP button algorithm Read Status Byte
28. n Figure 14 This is done by calling the 12c SS Config uinti6 t ConfigBytes function Figure 14 Typical Pointer Set Configuration Register Write EE MP 3 Address Byte Pointer Byte Configuration Byte Cond ACK ACK ACK by Master by by by Master STTS75 STTS75 STTS75 Al12280b ky Doc ID 17419 Rev 1 19 42 Component overview AN3209 Read acquired temperature To read the 2 bytes temperature register the I2C master must send a Pointer Set Configuration Register Write frame followed by a 2 byte read frame see Figure 15 This operation is managed by calling the 12c SS BufferRead unit8 tx pBuffer unit16 t ReadAddr unit8 t NumberByteToRead function Figure 15 Typical pointer set followed by a READ for 2 byte register L Start Address Byte Pointer Byte by ACK ACK Master by by STTS75 STTS75 L l Stop T T T Repeat Address Byte Most Significant Data Byte Least Significant Data Byte Cond Start ACK ACK NoACK by by by by by Master Master STTS75 Master Master Al12282b 2 3 4 Temperature format Table 8 shows the relationship between the output digital data and the external temperature for 9 to 12 bit resolution The left most bit in the output data stream controls temperature polarity information for each conversion If the sign bit is O the temperature is positive and of the sign bit is 1 the temperature is negative Table 8 Rela
29. o install the USB driver follow the steps described in section 31 of user manual UM0863 section 3 1 Figure 16 M24LR64 R Datalogger Application Software folder structure We C Program Files Jaya File Edit view Favorites Tools Help Q Back 3 pa Search lig Folders Folders 2 Desktop ET O My Documents EI d My Computer ee Local Disk C O Program Files C3 M24LR64 R Datalogger Application O driver 73 imagesT C3 sources O M24LR64 R Datalogger application Firmware O M24LR64 R Datalogger application software 22 42 Doc ID 17419 Rev 1 ky AN3209 Installing the datalogger package on your computer Figure 17 M24LR64 R_Datalogger_Application_Software start menu Microsoft Excel Microsoft PowerPoint Microsoft Word Outlook ST Programs Documents Public Transport Ticketing Demo a Reader USB CRX14 Version 2 0 lE STDemokit SR Dr Search EI Reader USB CRX14 Demokit Version 4 1 M24LR64 R Datalogger Application Settings Help and Support Run Log OFF rudy houque Le o uv v KA 2 2 a D gt lt Lu z o E Shut Down 4 Ei M24LR64 R Datalogger Application Software sources Si M24LR64 R Datalogger Application on the Web E Uninstall M24LR64 R Datalogger Application Software Doc ID 17419 Rev 1 23 42 Developing compiling and debugging your datalogger firmware AN3209 4 4
30. ory mapping 12 2 2 STM8L101K3 8 bit low power microcontroller EE EE ke ee 15 2 2 1 STM8L101K3 overview 15 2 2 2 STM8L101K3 IC interface 16 2 2 3 STM8L101K3 configuration 17 2 3 Digital temperature sensor 18 2 3 1 STTS75 main features 0 cee eae 18 2 3 2 od REPETIT 19 2 3 3 STT575 IPC commands 2 pawa wake Ke e amr Each aix e AEN 19 2 3 4 Temperature format 20 3 Installing the datalogger package on your computer 22 4 Developing compiling and debugging your datalogger firmware 24 4 1 Installing the datalogger application firmware 24 4 2 Software tool chain overview 24 4 2 1 ST Visual Develop GTM 24 4 2 2 C compil rS 6 5 28 VERE RE Ms Rr EUG KGG DER S E RE E 24 4 3 Description of the datalogger firmware elles 25 4 3 1 Main routine 0 200 4 0044 eb exuti goo LR Ree uvm EE ee 25 4 3 2 Acquisition algorithm functions 27 5 PC softWare oe oe Ese ARE ER EE HE DRR RR DIE dIE ewe eR DEER ORE 28 5 1 Description of the PC software 28 2 42 Doc ID 17419 Rev 1 ky AN3209 Contents 5 1 1 START button algorithm 29 5 1 2 STOP button algorithm 30 5 1 3 TRACE GRAPH button algorithm 30 5 1 4 Timer management 31 Appendix A Temperature acquisition datalogger schematics 33 Appendix B M24LR64 R RF commands 36 B 1 Ed ek dr CPC ER eam EE OE OE HEER FOK 36 B 2 Reset to Ready costos RR BEE
31. re 13 STTS75 temperature sensor block diagram mr Temperature Configuration Register Sensor and Converter ADO emperature Register o THYS Set Point Register TOS Set Point Register Control and Logic os Comparator 2 gt SDA SCL Al11833a 18 42 Doc ID 17419 Rev 1 ky AN3209 Component overview 2 3 2 2 3 3 STTS75 I2C interface The STTS75 has a simple 2 wire I C compatible digital serial interface which allows to access the data stored in the temperature register at any time It communicates via the serial interface with a master controller which operates at speeds up to 400 kHz However for the demonstration datalogger application the master operates at a speed of 100 kHz AO A1 and A2 pins select the address and allow to connect to up to 8 devices on the same bus without address conflict For the demonstration application AO A1 and A2 are connected to ground STTS75 I C device address is 1001 0000b 0x90 STTS75 I2C commands The I C master requests the sensor to acquire a temperature value and read the data from the sensor register These operations are performed by calling functions of the IC library i2c ee c Refer to Appendix C STTS75 I2C commands for a detailed description of these STTS75 functions Acquire temperature To configure the temperature sensor in temperature acquisition mode the I C master sends a Pointer Set Configuration Register Write frame as shown i
32. tails 16 42 Doc ID 17419 Rev 1 AN3209 Component overview 2 2 3 STM8L101K3 configuration Clock configuration The STM8L101K3 microcontroller is configured as follows for the demonstration M24LR64 R Datalogger application firmware e Master clock set to 2 MHz minimum e 2C timer 2 TIM2 Auto wakeup clocks enabled This is done by calling the following functions of the STM8L 101 firmware library CLK MasterPrescalerConfig CLK MasterPrescaler HSIDiv8 CLK PeripheralClockConfig CLK Peripheral I2C ENABLE CLK PeripheralClockConfig CLK Peripheral TIM2 ENABLE CLK PeripheralClockConfig CLK Peripheral AWU ENABLE VO configuration Three dedicated pins are set in output mode to power the Dual interface EEPROM the temperature sensor and the DC bus This is done by using the following STM8L101 firmware library function GPIO Init GPIOD GPIO Pin 5 e GPIO Pin 6 e GPIO Pin 7 GPIO Mode Out PP Low Fast This example is illustrated in Figure 4 Note It is recommended to set unused pins in input mode to minimize power consumption 4 Auto wakeup configuration The Auto wakeup AWU provides an internal wakeup timebase that can be used when the microcontroller enters Active halt power saving mode This timebase is clocked by the low speed internal LSI RC oscillator clock To ensure the best possible accuracy when using the LSI clock its frequency can be measured with TIM2 timer input capture 1 by calling the AWU_AutoLSICal
33. the memory the DC master can send read commands to the M24LR64 R The command frame must be compliant with the format described in Figure 8 The M24LR64 R Datalogger application firmware calls the 12C EE BufferRead function which reads a set of bytes from the EEPROM see Table 3 for a description and an example Figure 8 Read 12C frame format ACK ACK ACK ACK ACK Sequential EE Read Start D Start D ACK NO ACK 1jl Data out N ad Stop LC Al01105d Table3 ZC buffer read function Function description Function I2C EE BufferRead uint8 tr pBuffer uint16 t ReadAddr uint8 t name NumByteToRead pBuffer pointer to the buffer where the data read from the EEPROM are stored Parameters ReadAddr internal EEPROM address from which the read operation is performed NumByteToRead number of bytes to read from the EEPROM ErrorStatus Return value SUCCEEDED FAILED I2C EE BufferRead s data 0x0002 0x01 reads one byte from memory address 0x01 and stores the value in the buffer pointed by s data points Example Doc ID 17419 Rev 1 ky AN3209 Component overview 2 1 3 M24LR64 R RF Interface In ISO 15693 ISO 18000 3 1 RF mode the M24LR64 R is accessible via the 13 56 MHz carrier electromagnetic wave Incoming data are demodulated from the received signal amplitude modulation ASK amplitude shift keying The received ASK wave is 1096 or 100 modulated
34. tionship between temperature and digital output Temperature Sign Number of bits used by 9 10 11 12 Always DC C conversion resolution zero Hex 12 bit resolution 0000 11 bit resolution 0 0000 10 bit resolution 0 0 0000 9 bit resolution 0 0 0 0000 1125 0 111 1101 0 0 0 0 0000 7D00 425 0625 0 001 1001 0 0 0 1 0000 1910 110 125 0 000 1010 0 0 1 0 0000 0A20 10 5 0 000 0000 1 0 0 0 0000 0080 d 20 42 Doc ID 17419 Rev 1 Component overview AN3209 Table 8 Relationship between temperature and digital output continued Digital mer sign a anaa 2 09 r1 12 A Lee Hex 0 0 000 0000 0 0 0 0 0000 0000 0 5 1 111 1111 1 0 0 0 0000 FF80 10 25 1 111 0101 1 1 1 0 0000 F5E0 25 0625 1 110 0110 1 1 1 1 0000 E6FO ky Doc ID 17419 Rev 1 21 42 Installing the datalogger package on your computer AN3209 3 Installing the datalogger package on your computer To install the datalogger package on your computer 1 Execute the setup exe file available from http www st com dualeeprom to install the M24LR64 R Datalogger application software and copies the following folders on your computer see Figure 16 USB driver dll files Source code of the M24LR64 R Datalogger application firmware The RFID reader must not be connected to your PC 2 When the installation is complete connect the reader to the PC through an USB cable 3 T
35. tor Doc ID 17419 Rev 1 35 42 M24LR64 R RF commands AN3209 Appendix B M24LR64 R RF commands B 1 B 2 36 42 The M24LR64 R Datalogger application software uses the USB driver library to control RFID readers The library is written in Visual Basic It is available under C Program Files M24LR64 R_Datalogger_Application sources M24LR64 R_Datalogger_application_software or from Start gt M24LR64 R_Datalogger_Application gt M24LR64 R_Datalogger_application_software Inventory The ISO 15693 inventory command is performed by calling the Inventory DataLogger function Function Inventory DataLogger As Integer Table 10 Inventory DataLogger Function description Prototype Inventory DataLogger Parameters None i Result Function status SUCCEDDED FAILED Returned value Reset to Ready The Reset to Ready ISO 15693 command is performed by calling ResetToReadyRF_DataLogger function Function ResetToReadyRF DataLogger As Integer Table 11 ResetToReadyRF DataLogger Function description Prototype ResetToReadyRF DataLogger Parameters None i Result Function status SUCCEDDED FAILED Returned value Doc ID 17419 Rev 1 ky AN3209 M24LR64 R RF commands B 3 Read single block The Read Single Block ISO 15693 command is performed by calling the ReadRF single DataLogger function Table 12 ReadRF single

Download Pdf Manuals

image

Related Search

Related Contents

ProCloud Online Backup Manager User's Guide  INSTRUCTIONS D`UTILISATION ET DE MAINTENANCE  OUTCAST JUNIOR Manuel de l`utilisateur  PAT-SIP Guía de Usuario “Módulo de Control” (Ver. 1.0 Web)  Samsung SM-T800 راهنمای محصول  educational end user license agreement for plastic scm software  Getting Started - Catalyst Manufacturing  DOI  "user manual"  Samsung E1390B Manual de utilizare  

Copyright © All rights reserved.
Failed to retrieve file