在STM32上如果不使用外部晶振,OSC_IN和OSC_OUT的接法

本文介绍如何在不使用外部晶振的情况下,配置STM32的内部RC振荡器。对于不同封装的STM32产品,提供了两种配置方法:硬件配置,通过10K电阻将OSC_IN和OSC_OUT接地;软件配置,重映射PD0和PD1,并将其配置为输出'0'。软件配置能降低功耗,硬件配置则提升EMC性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果使用内部RC振荡器而不使用外部晶振,请按照下面方法处理:

1)对于100脚或144脚的产品,OSC_IN应接地,OSC_OUT应悬空。
2)对于少于100脚的产品,有2种接法:
  2.1)OSC_IN和OSC_OUT分别通过10K电阻接地。此方法可提高EMC性能。
  2.2)分别重映射OSC_IN和OSC_OUT至PD0和PD1,再配置PD0和PD1为推挽输出并输出'0'。此方法可以减小功耗并(相对上面2.1)节省2个外部电阻。

以下是在ST英文网站FAQ上抄下的详细解释:

1) In 100 and 144 packages,  the OSC_IN /OSC_Out pins are a dedicated pins for HSE and mapped respectively on pins 12, 13 and pins 23, 24 for LQFP packages. Although, for BGA 100 and BGA 144 packages, they are mapped respectively on pins C1,D1 and pins D1,E1. In this case the recommended configuration is:

OSC_In pin must be connected to ground as it is always an input pin
OSC_Out must be left not connected as it is always an output pin.

2) In LQFP48 and LQFP64 packages,  the OSC_IN/OSC_Out pins are mapped on pins 5,6 whereas in the VFQFPN36 package they are mapped on pins 2,3. However the PD0 and PD1 functionality can be remapped by software on these pins.  There are two possible configurations:

Hardware configuration: Connect the OSC_IN/OSC_Out pins to ground through a 10K pull down resistors.

Software configuration: First, the OSC_IN/OSC_Out pins are left not connected on PCB layout. Then, remap the PD0 and PD1 functionality by software on these pins and configure the PD0/PD1 to Output push-pull forced to 0 logic level(Data Register = 0). This will maintain those I/Os to a fixed level minimizing Noise and external stress on these pins.

The software configuration is recommended to reduce the power consumption and saves cost by avoiding the use of external pull down resistors as the I/O is already connected to the ground internally. Whereas the hardware configuration is recommended to increase the EMC performance.

转载于:https://www.cnblogs.com/king-77024128/articles/2862810.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值