AnsweredAssumed Answered

I2C configuration

Question asked by robinson.henry on Feb 15, 2013
Latest reply on Feb 15, 2013 by robinson.henry

I'm using CMSIS to set up an I2C driver.  As an example device I have an EEPROM - tried and tested on PIC18s, so I've been through the learning curve for I2C - just getting it going on STM32.

Configured CLS and SDA pins as AF_PP.
Written interrupt handlers for EVT/BUF and ERR.
I have enabled the interrupts and called I2C_GenerateSTART()
The interrupt fires, reports SR1 SB bit set; so then I call I2C_Send7bitAddress() with direction_Transmitter

Problem - on logic analyzer, I'm getting the Start + address going out, but then NACK, ie SDA goes high for the 9th bit.

Before you ask, the address is correct; besides, I've tried unplugging the EEPROM and putting a 2k pulldown resistor on SDA.  On a scope, this is enough to pull it down when I tristate it; but when my I2C runs, it shows no sign at all of being pulled down.  (Also this technique worked well when I was working with other processors - useful for eliminating the possibility that it's the EEPROM playing hard to get.)

So I conclude that the processor is not releasing the SDA line in the 9th bit (ACK/NACK).

I have tried all colours and flavours of pixie-dust, nothing seems to work yet.

Any ideas?  I tried configuring the SDA pin as AF_OD but then nothing worked at all, not even the SCL.