完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
STM32C8 (48管脚)PD0,PD1已经禁止了重映射,为什么还是用不了,一直检测到为低电平,而其他的管脚输出正常。求各位大神指导一下,下面是程序:
void RCC_Configuration(void) { RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO|RCC_APB2Periph_ADC1|RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOD|RCC_APB2Periph_GPIOC,ENABLE) ; //打开GPIOA,GPIOB,GPIOD的时钟,ADC时钟。 RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); GPIO_PinRemapConfig(GPIO_Remap_PD01,DISABLE); AFIO->MAPR=( AFIO->MAPR&~((u32)0x1<<15));//禁用PD01重映射 GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE); DBGMCU->CR&=~((u32)1<<5); AFIO->MAPR=( AFIO->MAPR&~((u32)0x7<<24))|(2<<24); }
|
|
相关推荐
8个回答
|
|
|
The pins number 2 and 3 in the VFQFPN36 package, and 5 and 6 in the LQFP48 and LQFP64 packages are configured as
OSC_IN/OSC_OUT after reset, however the functionality of PD0 and PD1 can be remapped by software on these pins. For the LQFP100 package, PD0 and PD1 are available by default, so there is no need for remapping. For more details, refer to the Alternate function I/O and debug configuration section in the STM32F10xxx reference manual. The use of PD0 and PD1 in output mode is limited as they can only be used at 50 MHz in output mode. |
|
|
|
|
|
用寄存器配置试试
|
|
|
|
|
chenwei6991627 发表于 2016-5-26 21:00 意思就是说PD0和PD1重映射后可以当中普通的IO管脚使用? |
|
|
|
|
|
还是不行,不过我加了一个上拉电阻后然后 设置GPIO_PinRemapConfig(GPIO_Remap_PD01,ENABLE); PD1既然可以正常高低电平输出,没搞懂为什么这样,GPIO_PinRemapConfig(GPIO_Remap_PD01,ENABLE)这条语句的设置PD1/0口还是处于重映射的状态吗?。 |
|
|
|
|
|
没看英文说明吗?只能作为输出使用
|
|
|
|
|
|
不能作为输入使用
|
|
|
|
|
|
|
|
|
|
|
|
你最后那句把映射又打开了
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
STM32F405驱动DS1302时钟模块,输出时间错乱该怎么排查?
2797 浏览 2 评论
stm32f405rgt6驱动DS1302ZN出现时间错乱问题
2403 浏览 1 评论
stm32用fsmc读取ad7606采集数据,数据不变,只有开发版复位才更新数据
2276 浏览 0 评论
2388 浏览 1 评论
1637 浏览 1 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 02:18 , Processed in 1.030678 second(s), Total 86, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
811