2010-04-12 07:32 AM
STM8L15x I2C : Cannot write I2C registers
2011-05-17 06:08 AM
Solved !
One to watch out for on the STM8Lx parts
Need to enable peripheral clock seperately in peripheral clock register.
Call to I2C_Init() doesn't do this. You need to add
CLK_PeripheralClockConfig(CLK_Peripheral_I2C,ENABLE);
2011-05-17 06:08 AM
OPS!!!
I suggest to split the forum for STM8S and STM8L since they seems different devices. For sure, in an ultra low power family like STM8L it's better clock peripherlas are disabled after reset. But on STM8S, by default after reset, all peripheral clocks are enabled, then user can disable selectively unwanted peripheral clock (opposite to STM8L). brazov2011-05-17 06:08 AM
Hi Patrick,
Did you manage to write a I2C driver for the STM8L discovery board?
I'm trying to write one from the STM8L15x_I2C_master_poll (AN3281) but
nothing comes out of PC0 and PC1. Do you know if there anything special with the discovery board?
Felix
2011-05-17 06:08 AM
Hi Felix
There are problems with the I2C on this device.
I used the firmware library I2C code initially but there are bugs in the silicon.
There is a workaround which seems to work if you need details I can send to you
2011-05-17 06:08 AM
Hi Patrick!
Could you provide me details of workaround. I am stuck with I2C on STM8L15x. Interrupt BERR - Misplaced Start or Stop condition occured.2011-05-17 06:08 AM
Hi Patrick, Romanov,
I finally managed to get the I2C working with the examples from the AN3281_STM8L_I2C_examples.
I use Polling mode wich is quite simple BUT I had to disable interrupts in the I2C init ie:
I2C1->ITR = 0; (in file i2c_master_poll.c)
I hope this can help someone.
Felix