当前位置:网站首页>Gd32f4 (6): serial port garbled caused by crystal oscillator
Gd32f4 (6): serial port garbled caused by crystal oscillator
2022-07-18 21:08:00 【Little Grey Bear】
GD32F4(6): Crystal oscillator causes serial port garbled
List of articles
1. System environment
System :win10
IDE:keil5
Development board :GD Official evaluation board GD32450Z_EVAL
User manual version :GD32F4xx_yonghushouce_Rev2.6.pdf
Standard library version :GD32F4xx_Demo_Suites_V2.5.0
2. The serial port of the development board is garbled
The official development board crystal vibrators are 25M Of , When designing by yourself, you may use external crystal oscillators with other values , You need to design your own clock program , Fortunately GD There are many official programs , You change the macro by , You can switch back and forth under different crystal oscillators , as follows :
you 're right , In this way, it is set to 200M 了 , Please refer to my other article for the specific principle :GD32F4(5):GD32F450 The clock is configured as 200M process analysis
Now the system is 200M you 're right , But the peripheral does not know the current clock of the system , That will lead to an error in the initialization clock of the peripheral , For example, when using serial port , You will find that the data is garbled , This is because there is a macro that defines the clock that needs to be modified , as follows :
explain : When using peripherals , Peripheral clock initialization will call rcu_clock_freq_get(rcu_clock_freq_enum clock) Get clock , Here's the picture :
This function will read the configured crystal oscillator clock and the registers related to the clock configuration , Work out each bit Clock delay required , When the calculated delay is equal to the real delay , There will be no garbled code .
边栏推荐
- 宇宙第一 IDE 霸主,换人了。。。
- 树莓派记录
- R语言ggplot2可视化:使用ggpubr包的ggecdf函数可视化经验累积密度分布函数曲线(Empirical cumulative density function)
- [JS encapsulates a simple asynchronous API to obtain asynchronous operation results and process parsing]
- R语言使用pcauchy函数生成柯西分布累积分布函数数据、使用plot函数可视化柯西分布累积分布函数数据(Cauchy distribution)
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型
- 剑指 Offer 53 - II. 0~n-1中缺失的数字
- stm32F407----电源管理
- 基于STM32电源模块开发
- VMware 恢复快照出现 无法创建 5040 MB 的匿名分页文件: 系统资源不足,无法完成请求的服务
猜你喜欢
随机推荐
Dynamically adding routes and refreshing the page will show a blank screen
SF city test development side 49min answer
(manual) [sqli-labs54-57] limit the number of injections: joint injection, error echo, get injection
stm32F407----电源管理
Sword finger offer 57 And are two numbers of S
剑指 Offer 57. 和为s的两个数字
[动态规划]DP21 正则表达式匹配-较难
Remember these points and you can quickly find bugs
博客从 CloudBase 迁移至云主机
推荐一篇写得很好的“I2C协议讲解”文章
初始 Redis(认识Redis以及常见命令)
Applet page navigation
What is industrial planning? How to make industrial planning for industrial parks
关于#sql#的问题:orcale sql, 为什么MERCHANT table的外键inventory—id 语句是无效的
Tableau JDBC连接GraphDB
What skills do software test engineers need to master if they need to speak 20K? I dare to be higher with these skills~
redis实现分布式锁
Amaslab-epic-kbs9 industrial computer brushing document
About SQL: orcale SQL, why is the foreign key inventory ID statement of the merchant table invalid
知识图谱de构建与应用(四):知识获取









