cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Wrong - STM32F0

Nickname925_O
Associate II
Posted on December 20, 2013 at 08:56

Hello everybody,

I have a problem with the I2C protocol used by the STM32F0.

In fact, after setting up all the necessary stuff if I use this code:

I2C_GenerateSTART(I2C1);

I get the waveform I2C_ONE

http://www.coocox.org/forum/images/ckeditorimages/20131219181541_I2C_ONE.png

The first channel is SDA and the second one is SCL.

Otherwise if I use this code:

I2C1->CR2=0xAA;

I2C_GenerateSTART(I2C1);

I get the waveform I2C_TWO.

http://www.coocox.org/forum/images/ckeditorimages/20131219181602_I2C_TWO.png

In any case, if I use I2C_SendData(....

I am not able to get any data on the I2C bus.

Can you try to use the I2C protocol with the STM32F0 and give me a feedback?

Thanks a lot,

Peppe

stm32f0-i2c-start

23 REPLIES 23
Nickname925_O
Associate II
Posted on January 17, 2014 at 19:31

Sorry, but can I give you my skype contact?

risingbiker

I hope to see your request.

Nickname925_O
Associate II
Posted on January 19, 2014 at 19:53

Hi,

I have a news and I tell you.

Today I sent the start condition with the address of I2C1 module and it recognizes the address (9th clk with the ACK).

So I am very frustrated... why, if I sent the I2C2 module address by I2C1 module.... the I2C2 module does not recognizes its own address??????

chen
Associate II
Posted on January 20, 2014 at 15:37

Hi

''''I2C_SlaveAddressConfig(I2C1,0x30);''

means that I2C1 will send 0x30 as slave address after the generate_start instruction :-)''

This must be something you have written. I could not find it in the standard peripheral library for I2C.

''can I give you my skype contact?''

Sorry but I do this in 'spare' time at work. I cannot spare the time to talk, I have a job to do.

''Today I sent the start condition with the address of I2C1 module and it recognizes the address (9th clk with the ACK).''

The data sheet says

''By default the I2C interface operates in Slave mode. To switch from default Slave mode to

Master mode a Start condition generation is needed''

So, when the I2C peripheral is configured, it should be listening for the slave address if it is not sending.

312494845
Associate
Posted on March 02, 2014 at 09:39

Hello, 

I have a problem with the I2C protocol used by the STM32F0. After calling I2C_GenerateSTART(I2C1), I get the same waveform I2C1 like you got.

http://www.coocox.org/forum/images/ckeditorimages/20131219181541_I2C_ONE.png

And after using the function of sending data, there is no waveform.

Can you teach me the method of how you get it successful? Thanks a lot.