AN2681 Freescale Semiconductor / Motorola, AN2681 Datasheet - Page 3

no-image

AN2681

Manufacturer Part Number
AN2681
Description
1-Wire Interface on the i.MX21 Application Processor
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
The DS 2751 is equipped with internal registers, a 32-byte EEPROM, and a 16-byte SRAM for battery
statistics storage and battery capacity calculations. The function commands recognized by the DS2751
include Read Data from DS2751 registers and memory, Write Data to certain registers and memory,
Copy Data from the SRAM to the EEPROM, Recall Data from the EEPROM to the SRAM, and Lock an
EEPROM block containing the specified address.
For this scenario, a Lithium Ion battery is connected as shown in Figure 1. The rate at which the battery
loses its charge depends on the load current, which was controlled using the potentiometer. The DS2751
records the voltage readings to its 16-bit voltage register. The i.MX21 is programmed to read the voltage
readings from the DS2751 through the 1-Wire interface every few minutes while the battery is
discharging. The following sections explain how to interface with the 1-Wire module on the i.MX21, and
also provide the software for communication with the DS2751.
2 i.MX21 1-Wire Hardware Interface
GPIO port E on the i.MX21 processor can be configured as a 1-Wire bus. Timing requirements are met in
hardware with the help of the clock (1 MHz) and the 1-Wire state machine. The registers identified in
Table 1are available to control the 1-Wire communication.
MOTOROLA
2. Match: an address that is transmitted bit-by-bit, while all the slaves listen. As soon as a mismatch
3. Search: learn the addresses of all devices connected to the bus via the process of elimination.
4. Skip: addressing all together, as long as only the DS2751 is connected. This is the scheme
1-Wire Time Divide Register
1-Wire Control Register
1-Wire Reset Register
occurs, the slave ignores the rest of the transmission until a reset pulse is seen.
This scenario does not use this address command, so it will not be discussed in detail. See
Chapter 5 of the Book of DS19xx_iButton Standards found at
explanation of net address search.
employed for the testing documented in this paper. The DS2751 is ready to accept a function
command after receiving the skip net address command.
Description
Table 1.
Freescale Semiconductor, Inc.
For More Information On This Product,
1-Wire Module Register Memory Locations
MC9328MX21 Application Note
Go to: www.freescale.com
TIME_DIVIDER
CONTROL
RESET
Name
www.maxim-ic.com
i.MX21 1-Wire Hardware Interface
0x10009000
0x10009002
0x10009004
Address
for a complete
3

Related parts for AN2681