ST AN3209 Application note

AN3209

Application note

Developing your M24LR64-R datalogger application for temperature acquisition

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 (I2C 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 M24LR64R_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 (M24LR64R_Datalogger_application_firmware): they allow implementing I2C communications between the M24LR64-R, the STTS75, and the STM8L101K3.

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

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 I²C 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.

April 2011

Doc ID 17419 Rev 2

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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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 I2C 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 I2C 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 I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.3 STTS75 I2C 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

2/42

Doc ID 17419 Rev 2

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 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 I2C commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

C.1 Acquire temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 C.2 Read acquired Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41

Doc ID 17419 Rev 2

3/42

List of tables

AN3209

 

 

List of tables

Table 1. M24LR64-R signal names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Table 2. I2C page write function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Table 3. I2C buffer read function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 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(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Table 15. I2C_SS_Config(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Table 16. I2C_SS_Config(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Table 17. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4/42

Doc ID 17419 Rev 2

AN3209

List of figures

 

 

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 I2C frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Figure 8. Read I2C 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

Doc ID 17419 Rev 2

5/42

ST AN3209 Application note

Overview of M24LR64-R datalogger application

AN3209

 

 

1 Overview of M24LR64-R datalogger application

1.1Board 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 I2C signals to be probed using dedicated connectors.

Figure 1. Datalogger front side view

Temperature Sensor (STTS75)

Microcontroller (STM8L)

Dual Interface EEPROM

(M24LR64-R)

Antenna

AI18019b

Figure 2. Datalogger back side view

Battery

SWIM connector

AI18020b

6/42

Doc ID 17419 Rev 2

AN3209

Overview of M24LR64-R datalogger application

 

 

1.2Communication interfaces

The communications between the STM8L101K3, M24LR64-R, and STTS75 are performed through an I2C bus. The STM8L101K3 acts as the I2C 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

 

-ASTER

3LAVE

3443

 

34- ,

 

 

 

 

 

TEMPERATUREUSENSOR

 

 

 

 

 

 

 

 

 

 

-ICROCONTROLLER

) #

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

) #

 

 

 

 

 

 

3LAVE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

) #

 

- ,2

 

 

 

 

 

 

 

 

 

$UAL )NTERFACE %%02/-

!NTENNA

!)

1.3Power 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 I2C power supply (VCC) are powered by the STM8L101K3 microcontroller.

Figure 4. Datalogger power management

 

 

 

 

 

 

 

-ASTER

 

 

 

 

 

 

 

 

 

 

 

 

 

34- ,

$

 

 

 

 

 

 

 

 

 

 

6$$ 3443

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-ICROCONTROLLER

$

 

 

 

 

 

 

 

 

 

 

 

6$$ - ,2 2

 

 

 

 

 

 

 

 

 

 

 

6$$

 

$

 

 

 

 

 

 

 

 

 

 

 

6##

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

"ATTERY

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3$!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3#,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

!)

Doc ID 17419 Rev 2

7/42

Component overview

AN3209

 

 

2 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 the temperature acquisition application, and it describes the corresponding code function and examples.

2.1M24LR64-R Dual interface EEPROM

2.1.1M24LR64-R main features

The M24LR64-R device is a dual-access electrically erasable programmable memory (EEPROM). It features an I2C 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 I2C mode and 2048x32 bits in the ISO 15693 and ISO 18000-3 mode 1 RF mode.

Figure 5. M24LR64-R pinout

%

 

 

 

 

 

6##

 

 

!#

 

 

 

 

%

!#

 

 

 

 

 

 

3#,

 

 

 

633

 

 

 

3$!

 

 

 

 

 

 

 

!)

Figure 6. M24LR64-R functional block diagram

2OWWDECODER

!#

2&

!#

2& 6##

 

%%02/-

 

 

 

 

 

 

 

 

,ATCH

 

 

 

 

 

 

 

,OGIC

 

 

 

 

3#,

 

 

 

 

 

 

) #

 

 

3$!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6##

0OWER MANAGEMENT

 

#ONTACTT6##

 

 

633

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

!)

Table 1.

M24LR64-R signal names

 

 

 

Signal name

 

Function

Direction

 

 

 

 

 

 

E0, E1

 

Chip Enable

Input

 

 

 

 

 

 

SDA

 

Serial Date

I/O

 

 

 

 

 

 

SCL

 

Serial Clock

Input

 

 

 

 

 

8/42

Doc ID 17419 Rev 2

AN3209

 

 

Component overview

 

 

 

 

 

 

Table 1.

M24LR64-R signal names (continued)

 

 

 

 

 

 

 

 

Signal name

Function

Direction

 

 

 

 

 

 

 

AC0, AC1

Antenna coils

I/O

 

 

 

 

 

 

 

VCC

Supply voltage

 

 

 

VSS

Ground

 

2.1.2M24LR64-R I2C interface

The M24LR64-R can work both in standard and Fast I2C modes. The device carries a builtin 4-bit device type identifier code (1010b) compliant with the I2C 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 I2C protocol with all memory operations synchronized by the serial clock. The device I2C address is 1010 0000b (0xA0)

The I2C 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 I2C 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 I2C_EE_PageWrite function which programs a set of bytes into the EEPROM (see Table 2 for a description and an example).

Figure 7. Write I2C frame format

!#+

!#+

!#+

!#+

!#+

!#+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0AGEG7RITE

$EVV3ELECT

 

 

 

 

 

 

"YTE ADDRESS

 

"YTE ADDRESS

 

 

 

 

$ATA INA

 

 

 

 

 

 

$ATA INA

 

 

 

 

 

 

 

 

 

 

$ATA INA.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3TART

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3TOP

!)

Doc ID 17419 Rev 2

9/42

Component overview

 

AN3209

 

 

 

 

 

Read operations

I2C page write function

 

Table 2.

 

 

 

Function description

 

 

 

 

Function name

I2C_EE_PageWrite(uint8_t* pBuffer, uint16_t WriteAddr,

 

 

 

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

 

 

 

 

 

Example

 

I2C_EE_PageWrite(s_data, 0x0002, 0x01) writes the content of the

 

 

buffer pointed by sedate at address 0x01.

 

 

 

 

 

 

 

To read from the memory, the I2C 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 I2C_EE_BufferRead function which reads a set of bytes from the EEPROM (see Table 3 for a description and an example).

Figure 8. Read I2C frame format

3EQUENTIAL

2ANDOM

2EAD

3TART

 

 

 

 

 

 

 

 

!#+

 

 

 

 

 

 

!#+

!#+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$EVVSELECT

 

 

 

 

 

"YTE ADDRESS

 

 

"YTE ADDRESS

 

 

3TART

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

!#+

 

 

 

./ !#+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$ATA OUT .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3TOP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

!#+ !#+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$EVVSELECT

 

 

 

 

$ATA OUT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 7

!) D

Table 3. I2C buffer read function

Function description

Function I2C_EE_BufferRead(uint8_t* 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

Example

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.

10/42

Doc ID 17419 Rev 2

AN3209

Component overview

 

 

2.1.3M24LR64-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 10% or 100% modulated 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:

Development kit: FEIG reader

Demonstration kit: FEIG reader

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:

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 2

11/42

Component overview

AN3209

 

 

FEIG commands

FEIG readers are delivered with a package to develop and program application software in AINSI-C/C++, and Visual Basic (see Figure 9).

Figure 9. FEIG software support for windows

*AVA .%4

.%4 LIBRARY

.%4

*AVA LIBRARY

# CLASSCLIBRARY

.OT FREE OF

 

.%4

 

 

 

 

 

 

CHARGE

/")$)3# .%4

/")$)3# *

&%$-

 

 

&UNCTION LIBRARIES $,, ,

 

 

 

 

 

&%&5

 

 

 

 

&%)3#

 

!PPLICATIONS ,EVEL

&%#/-

&%53"

&%4#0

 

 

 

 

+ERNEL ,EVEL

7INDOWS

$RIVER

7INDOWS

DRIVER

/")$53" 393

DRIVER

 

 

23

23

53"

,!.

 

 

 

 

!)

Estar commands

Estar readers are delivered with a package to develop and program application software in ANSI-C/C++, and Visual Basic. The following dll files are provided:

For Visual Basic: HIDdll.bas

For C/C++: HIDdll.h, HIDdll.lib

2.1.4Datalogger 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

 

 

Sector

RF block

i2C byte

bit [31:24]

bit [23:16]

bit [15:8]

bit [7:0]

number

address

address

 

 

 

 

 

 

 

 

 

 

 

0

0

0

RFU

Delay

Overwrite

Status

 

 

 

 

 

 

 

0

1

4

RFU

RFU

Nb Temp[1]

Nb Temp[0]

 

 

 

 

 

 

 

0

2

8

Temp2 [1]

Temp2 [0]

Temp1 [1]

Temp1 [0]

 

 

 

 

 

 

 

0

3

12

Temp4 [1]

Temp4 [0]

Temp3 [1]

Temp3 [0]

 

 

 

 

 

 

 

0

4

16

Temp6 [1]

Temp6 [0]

Temp5 [1]

Temp5 [0]

 

 

 

 

 

 

 

0

5

20

Temp8 [1]

Temp8 [0]

Temp7 [1]

Temp7 [0]

 

 

 

 

 

 

 

12/42

Doc ID 17419 Rev 2

AN3209

 

 

 

 

Component overview

 

 

 

 

 

 

 

 

 

Table 4.

M24LR64-R-R memory organization

 

 

 

 

 

 

 

 

 

 

 

Sector

RF block

i2C byte

bit [31:24]

bit [23:16]

bit [15:8]

bit [7:0]

 

number

address

address

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...

...

...

...

...

...

...

 

 

 

 

 

 

 

 

 

63

2016

8064

Temp4092

Temp4092

Temp4091 [1]

Temp4091 [0]

 

[1]

[0]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

System bytes

Status byte

The Status byte shows the current application state. Refer to 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

 

 

 

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

 

 

 

 

0x11

Overwrite authorized

 

 

 

 

Any other values

Overwrite non authorized

 

 

 

Delay byte

The Delay byte contains the value of the acquisition rate (see Table 7):

Table 7.

Delay byte values

 

Delay byte value

Description (s)

Comment

 

 

 

0x0D

1

Temperature measured and saved every second

 

 

 

0x10

30

Temperature measured and saved every 30 seconds

 

 

 

 

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 2

13/42

Loading...
+ 29 hidden pages