STM8S003F3调试跳坑记录

2019-07-19 21:00发布

本帖最后由 aozima 于 2016-7-29 13:27 编辑

1. CLK->PCKENR1 使能 CLK_PCKENR1_UART1 无效
想降低功耗,单独打开 CLK_PCKENR1_UART1,但UART无输出。
核对资料发现:stm8s.h中是这样定义的

STM8S.h.jpg

英文版参考手册上面是这样写的
RM16.jpg

数据手册上面是这样的
DS.jpg
解决方法: 不要使用 stm8s.h中的 CLK_PCKENR1_UART1
自己使能 bit3

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
8条回答
aozima
2019-07-20 04:11
3. 数据手册中有写 AFR0和AFR1不能同时使用,但他们的IO并不冲突呀?而且我目前就这样用了,而且调试正常。
但刚才翻资料看到这句就懵了。

AFR1 Alternate function remapping option 1 (2)
0: AFR1 remapping option inactive: default alternate function(1)
1: Port A3 alternate function = SPI_NSS; port D2 alternate function =TIM2_CH3.

AFR0 Alternate function remapping option 0(2)
0: AFR0 remapping option inactive: Default alternate functions(1)
1: Port C5 alternate function = TIM2_CH1; port C6 alternate function =TIM1_CH1; port C7 alternate function = TIM1_CH2.

1. Refer to the pinout description.
2. Do not use more than one remapping option in the same port. It is forbidden to enable both AFR1 and
AFR0.

AFR0_AFR1.jpg

这个暂时还没得到答案!为保险起见,决定不使能AFR1,还是修改电路,把 PD2 [TIM2_CH3] 还是换成PA3 TIM2_CH3。


一周热门 更多>