Problem with I2c and STM32F103
Company  
ST Home | Microcontrollers

Index  »  ARM Cortex-M3 STM32  »  Problem with I2c and STM32F103
     
   Problem with I2c and STM32F103
 Moderated by :   »  STOne-32

Author
beginning argument    ( Replies received: 3 )
niek_ebbers   Posted 04-09-2008 at 16:36   



Registered on :
09-04-2008

Messages : 5

 OFF-Line

I'm trying to use the I2C with a m24c64-wmn6 EERPOM. I'm using pb8 and pb9 for I2C output, so I've remapped the peripheral to these pins.
The START command works fine, but when I send the Address, the ADDR bit is never set.
The scope tells me that the data isn't send in the proper way. The SDA-pin changes state on the falling flank of SCL, not on the rising. The NACK from the EEPROM is written on the rising flank.

I'm not using the libraries provided with the controller, but I've wrote my own.

Has anyone encountered this problem before?

If necessary, I can post my code.


[ This message was edited by: niek_ebbers on 04-09-2008 16:37 ]



 Profile   Quote  
jaroslaw.oska   Posted 05-09-2008 at 08:56   



Registered on :
11-21-2008

Messages : 36

 OFF-Line

Did you check if you send address twice (in two bytes)? The library example send only one byte address. I have used it with lib v1.1 and it works now I am working with lib v2.0 but I didn't check it if this works with lib 2.0 as well.




[ This message was edited by: jaroslaw.oska on 05-09-2008 09:01 ]


[ This message was edited by: jaroslaw.oska on 05-09-2008 09:02 ]



 Profile   Quote  
niek_ebbers   Posted 05-09-2008 at 10:19   



Registered on :
09-04-2008

Messages : 5

 OFF-Line

I'm using 7 bit addressing mode so one byte should be enough.
The main problem is that the SDA line sends it's bits on the rising flank of SCL, but I need it to send it on the falling edge.



 Profile   Quote  
lanchon   Posted 05-09-2008 at 11:50   



Registered on :
11-02-2008

Messages : 367

 OFF-Line

I've posted master mode i2c code that works and a couple of posts detailing limitations of the i2c macrocell, look them up if you want.



 Profile   Quote  
On Top

Search in the forums
 
Jump To