ST意法半导体
直播中

任斌

7年用户 177经验值
私信 关注
[问答]

STM8L15x I2C:无法写入I2C寄存器

STM8L15x I2C:无法写入I2C寄存器

以上来自于谷歌翻译


以下为原文



STM8L15x I2C : Cannot write I2C registers

回帖(6)

任斌

2019-4-2 14:03:30
解决了 !
 
一个值得关注的是STM8Lx部件
 
需要在外设时钟寄存器中单独使能外设时钟。
 
调用I2C_Init()不会这样做。你需要添加
 
CLK_PeripheralClockConfig(CLK_Peripheral_I2C,ENABLE);

以上来自于谷歌翻译


以下为原文





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);
举报

贾虎世

2019-4-2 14:13:52
OPS!
 
 
 我建议拆分STM8S和STM8L的论坛,因为它们似乎是不同的设备。当然,在像STM8L这样的超低功耗系列中,复位后可以禁用更好的时钟外设。但是在STM8S上,默认情况下,复位后,所有外设时钟都被使能,然后用户可以选择性地禁用不需要的外设时钟(与STM8L相反)。
 
 brazov

以上来自于谷歌翻译


以下为原文





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).

brazov
举报

张浩

2019-4-2 14:33:32
嗨Patrick,
 
您是否设法为STM8L发现板编写I2C驱动程序?
我正在尝试从STM8L15x_I2C_master_poll(AN3281)写一个,但是
没有任何东西来自PC0和PC1。你知道发现板有什么特别之处吗?
 
费利克斯

以上来自于谷歌翻译


以下为原文





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
举报

任斌

2019-4-2 14:39:00
菲利克斯
 
此设备上的I2C存在问题。
 
我最初使用的是固件库I2C代码,但芯片中存在漏洞。
 
如果您需要我可以发送给您的详细信息,有一种解决方法似乎有效

以上来自于谷歌翻译


以下为原文





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
举报

更多回帖

发帖
×
20
完善资料,
赚取积分