cancel
Showing results for 
Search instead for 
Did you mean: 

ST72F63B I2C Interface Fails to Generate Stop for Single Byte Read

gerickson
Associate II
Posted on June 16, 2008 at 10:05

ST72F63B I2C Interface Fails to Generate Stop for Single Byte Read

2 REPLIES 2
gerickson
Associate II
Posted on April 16, 2008 at 23:13

I am working with an ST72F63B on the Raisonance ReVA board and am experimenting with the 'testall' application, specifically I2C reads and writes to the on-board EEPROM. Ostensibly, the included I2C code in 'testall' is from the ST7 sample library.

The polled-mode I2C read in this code seems to follow the guidelines for a master receiving in the data sheet precisely; however, what I see in practice on the scope is that for reads of 2 or more bytes, the read transaction works correctly, terminating with a STOP condition. However, for a single (1) byte read, there is never a STOP condition.

This discrepancy is despite the fact that the polled mode read code has an explicit case for a byte count of one (which must also be executed for the multi-byte cases).

Has anyone gotten this ST7 library code to work? If so, what changes did you need to make to do so? Is there something undocumented in the datasheet required for a single byte read transaction? Perhaps ACK must be cleared for BOTH the second to the last and the last byte?

seb13_colin
Associate II
Posted on June 16, 2008 at 10:05

Hello gerickson,

In the ST7 library, the function ''I2C_GetBuffer'' is designed to receive buffer. So it means more than 1 byte. If you want to receive only one byte you have to use the function ''I2C_GetByte''.

For more details you can refer to the user manual of the library page 18-20.

Best regards,

Seb