Simulating SMBus slave messages from a Smart Battery

This topic is similar to a very old post I found in the forum here:

http://forum.arduino.cc/index.php?topic=200951.0

I am attempting to simulate the slave communication that a Smart Battery communicates to the master host.

I am very familiar with the SMBus/Smart Battery protocol, but very unfamiliar with Arduino. From reading multiple sources it appears as though the Wire library is unable to perform the required message protocol. Perhaps this was just with an older implementation of the library? or perhaps there is a new library that can perform these functions.

Anyway, standard communication protocol uses the SMBus Read Word and SMBus Block Read.

[u]Read Word (Slave response in bold)[/u] Start Address (7-bit address 0x000B) Write bit (0) Ack Command Code Ack Start Address (7-bit address 0x000B) Read bit (1) Ack Data byte low Ack Data byte high Nack Stop

[u]Read Block (slave response in bold)[/u] Start Address (7-bit address 0x000B) Write bit (0) Ack Command Code Ack Start Address (7-bit address 0x000B) Read bit (1) Ack Byte Count = N Ack Data byte 1 Ack Data byte 2 Ack ... Data byte N Nack Stop

So, is there a way of performing this with prebuilt libraries?

This is exactly what i am trying to do. I noticed no one has replied to your request but was wondering if you had any joy?

I found an I2C Sniffer program

https://github.com/rricharz/i2c-sniffer-100kBaud-Arduino-Mega

Using this i found it was getting the request for 09 - Voltage and it was sending a response (should be 2 bytes) but i am not sure the ack was working and why there are 3 bytes.

I am using the arduino Wire library. The master is a 3DR Solo looking to get battery information from the smart battery.

Below is the result from the sniffer

Acquiring data Analyzing data, number of transitions = 4252 i2c bus activity: * means ACQ = 1 (not ok) Dev=0B W Data=09 Dev=0B R Data=B9 19 7F* Dev=0A W Data=12* Dev=0B R Data=B9 19 7F* Dev=0B W Data=09 Dev=0B R Data=B9 19 7F* Dev=0B W Data=09 Dev=0B R Data=B9 1A FF* Dev=0B W Data=12* Dev=0B R Data=B9 19 7F* Dev=0B W Data=09 Dev=0B R Data=B9 19 7F* Dev=0B W Data=09 Dev=0B R Data=B9 19 7F*