![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
april 2011 doc id 17419 rev 2 1/42 AN3209 application note developing your m24lr64- r datalogger application for temperature acquisition introduction the m24lr64-r is a dual in terface eeprom. since it ha s both an 13.56 mhz iso 15693 rfid and a 400-khz i 2 c 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 (i 2 c 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: source files of the data logger firmware (m24lr64- r_datalogger_application_firmware): they allow implementing i 2 c communications between the m24lr64-r, the stts75, and the stm8l101k3. source files of the pc software (m24lr64- r_datalogger_applicatio n_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 m24lr64-r datasheet ?m24lr64-r tool driver install guide? user manual (um0863) ?using the m24lr64-r datalogger reference design? user manual (um0925) ?how to manage m24lr64-r data transfers from the i2c bus or an rf channel? application note (an3057) stm8l101k3 datasheet stm8l101 reference manual (rm0013). stts75 datasheet. the documents are available from http://www.st.com/dualeeprom. www.st.com
contents AN3209 2/42 doc id 17419 rev 2 contents 1 overview of m24lr64-r datalog ger application . . . . . . . . . . . . . . . . . . 6 1.1 board architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2 communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 component overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1 m24lr64-r dual interface eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.1 m24lr64-r main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.2 m24lr64-r i 2 c interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.3 m24lr64-r rf interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.4 datalogger memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 stm8l101k3 8-bit low power microcontroller . . . . . . . . . . . . . . . . . . . . . 15 2.2.1 stm8l101k3 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.2 stm8l101k3 i 2 c interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2.3 stm8l101k3 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3 digital temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.3.1 stts75 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.3.2 stts75 i 2 c interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.3 stts75 i 2 c commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 (stdv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.2.2 c compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3 description of the datalogger firmware . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3.1 main routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3.2 acquisition algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5 pc software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.1 description of the pc software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 AN3209 contents doc id 17419 rev 2 3/42 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 inventory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 b.2 reset to ready . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 b.3 read single block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 b.4 read multiple block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 b.5 write single block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 b.6 estar commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 appendix c stts75 i 2 c commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 c.1 acquire temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 c.2 read acquired temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 6 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 list of tables AN3209 4/42 doc id 17419 rev 2 list of tables table 1. m24lr64-r signal names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 table 2. i 2 c page write function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 table 3. i 2 c buffer read function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 0 table 4. m24lr64-r-r memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 table 5. status byte values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 table 6. overwrite byte values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 table 7. delay byte values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 table 8. relationship between temperature and digital output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 table 9. component values for schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 table 10. inventory_datalogger() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 table 11. resettoreadyrf_datalogger() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 table 12. readrf_single_datalogger() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 table 13. readrf_multiple_datalogger() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 table 14. writesingleblockrf_datalogger(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 8 table 15. i2c_ss_config(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 16. i2c_ss_config(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 17. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 AN3209 list of figures doc id 17419 rev 2 5/42 list of figures figure 1. datalogger front side view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 2. datalogger back side view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 3. stm8l101k3/m24lr64-r/stts75 communication block diagram. . . . . . . . . . . . . . . . . . . 7 figure 4. datalogger power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 figure 5. m24lr64-r pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 figure 6. m24lr64-r functional block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 figure 7. write i 2 c frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 8. read i 2 c frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 9. feig software support for windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 figure 10. stm8l101k3 32-pin package pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 figure 11. stm8l101k3 functional block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 12. stts75 temperature sensor pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 13. stts75 temperature sensor block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 14. typical pointer set configuration register write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 figure 15. typical pointer set followed by a read for 2-byte register. . . . . . . . . . . . . . . . . . . . . . . . . 20 figure 16. m24lr64-r_datalogger_application_software folder structure . . . . . . . . . . . . . . . . . . . . 22 figure 17. m24lr64-r_datalogger_application_software start menu . . . . . . . . . . . . . . . . . . . . . . . . 23 figure 18. needed material to compile and run an application on stm8l101k3 . . . . . . . . . . . . . . . . 24 figure 19. main routine algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 20. acquisition_running algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 figure 21. start_acquisition/stop_acquisition/acquisition update algorithms . . . . . . . . . . . . . . . . . . . . 27 figure 22. m24lr64-r_datalogger_application_software home page . . . . . . . . . . . . . . . . . . . . . . . . 28 figure 23. start button algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 figure 24. stop button algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 figure 25. trace graph algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 figure 26. dynamic view - timer algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 figure 27. temperature acquisition datalogger schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 overview of m24lr64-r datalogger application AN3209 6/42 doc id 17419 rev 2 1 overview of m24lr64-r datalogger application 1.1 board architecture the entire circuit is implemented on a 90x5 0 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 i 2 c signals to be probed using dedicated connectors. figure 1. datalogger front side view figure 2. datalogger back side view temper a t u re s en s or ( s tt s 75) d ua l interf a ce eeprom (m24lr64-r) microcontroller ( s tm 8 l) antenn a ai1 8 019 b ai1 8 020 b s wim connector b a ttery AN3209 overview of m24lr64-r datalogger application doc id 17419 rev 2 7/42 1.2 communication interfaces the communications between the stm8l101k3, m24lr64-r, and stts75 are performed through an i 2 c bus. the stm8l101k3 acts as the i 2 c 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 1.3 power management the datalogger is a low power application requiring a particular power management. the entire power supply is managed by the microcon troller which is the only device directly powered by the battery (see figure 4 ). both slave nodes and i 2 c power supply (v cc ) are powered by the stm8l101k3 microcontroller. figure 4. datalogger power management 3 4 4 3 t e m p e r a t u r e s e n s o r - , 2 $ u a l ) n t e r f a c e % % 0 2 / - 3 l a v e ) # ) # ) # ! n t e n n a 3 l a v e - a s t e r - i c r o c o n t r o l l e r 3 4 - , ! ) ! ) " a t t e r y - a s t e r - i c r o c o n t r o l l e r 3 4 - , $ $ $ 6 $ $ 3 4 4 3 6 $ $ - , 2 2 6 # # 3 $ ! 3 # , 6 $ $ component overview AN3209 8/42 doc id 17419 rev 2 2 component overview this section describes the main characteristic s of the three stmicroelectronics components (m24lr64-r, stts75, and stm8l101k3). it explains how to configure them for the temperature acquisition application, and it describes the corresponding code function and examples. 2.1 m24lr64-r dual interface eeprom 2.1.1 m24lr64-r main features the m24lr64-r device is a dual-access elec trically erasable programmable memory (eeprom). it features an i 2 c interface and can be operated from a v cc 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 i 2 c mode and 2048x32 bits in the iso 15693 and iso 18000-3 mode 1 rf mode. figure 5. m24lr64-r pinout figure 6. m24lr64-r functional block diagram table 1. m24lr64-r signal names signal name function direction e0, e1 chip enable input sda serial date i/o scl serial clock input 3 $ ! 6 3 3 3 # , % ! # % 6 # # ! # ! ) % % 0 2 / - 2 o w d e c o d e r , a t c h , o g i c 2 & ) # 2 & |