头像-368978

KW59

个人成就

获得 0 次赞

帮助过1人

stm8使用UART 要设置RX TX的方向寄存器吗

需要的。TX与RX是复用功能的输出与输入。stm8s参考手册(RM0016)中要求复用功能的输入是 floating或者pull-up(For Alternate Function input you should select floating or pull-up input configuration in the DDR and CR1 registers);复用功能输出就强制把DDR设为1了。(Alternate function outputs provide a direct path from a peripheral to an output or to an I/O pad taking precedence over the port bit in the data output latch register (Px_ODR) and forcing the Px_DDR corresponding bit to 1.)上个类似的帖子,欢迎交流​:http://www.stmcu.org.cn/module/forum/forum.php?mod=viewthread&tid=626014&page=1&extra=#pid2514937​

stm8使用UART 要设置RX TX的方向寄存器吗

设置了复用功能,就已经设好方向了吧