2008-09-04 11:20 PM
Problem with I2c and STM32F103
2011-05-17 03:43 AM
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 ]2011-05-17 03:43 AM
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 ]2011-05-17 03:43 AM
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.2011-05-17 03:43 AM
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.