AN 493: I2C Battery Gauge Interface Using Altera MAX Series

ID 683033
Date 9/22/2014
Public

1.3. Implementation

The detailed description of the implementation is based on the MAX II devices. This application can also be implemented in MAX V and MAX 10 devices.

This design example can be implemented with an EPM240 device or any other MAX II device and a I2C battery gauge device such as the Maxim DS2745. This design communicates with the Maxim DS2745 battery gauge through the I2C bus and displays the constantly updated voltage readings without requiring any external stimulus.

The voltage status returned by the DS2745 battery gauge is 11-bit wide and is in 2's complement form. The voltage readings are converted into a viewer-friendly form with eight voltage magnitude levels by the MAX II device. These are subsequently displayed with the help of an LED array with eight LEDs.

The following details the implementation of this design example on the MDN-B2 demo board.

Table 2.  Design Example Using the MDN-B2 Demo Board
EPM240G Pin Assignments
Signal Pin Signal Pin
SCLK pin 39 SDA pin 40
led_level[0] pin 76 led_level[1] pin 75
led_level[2] pin 74 led_level[3] pin 73
led_level[4] pin 72 led_level[5] pin 71
led_level[6] pin 70 led_level[7] pin 69

Assign unused pins as input tri-stated in the Quartus® II software. You must also enable the Auto Open Drain setting on the SCLK and SDA pins. To do this, on the Assignments menu, click Settings and then select Analysis and Synthesis Settings to enable the Auto Open-Drain setting. These settings are followed by a compilation cycle.

This design example has been implemented in Verilog and successful operation has been demonstrated using the MDN-B2 demo board, as described in this document.