[应用相关] stm32PD0,PD1禁止重映射问题

[复制链接]
627|10
 楼主| huwr 发表于 2019-10-13 13:56 | 显示全部楼层 |阅读模式
stm32C8 (48管脚)PD0,PD1已经禁止了重映射,为什么还是用不了,一直检测到为低电平,而其他的管脚输出正常
liuzaiy 发表于 2019-10-13 13:59 | 显示全部楼层

楼主程序可以公开吗?贴程序看下吧,这么说看不出什么原因
 楼主| huwr 发表于 2019-10-13 14:14 | 显示全部楼层
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);

}
 楼主| huwr 发表于 2019-10-13 14:19 | 显示全部楼层
supernan 发表于 2019-10-13 14:19 | 显示全部楼层
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.
ousj 发表于 2019-10-13 14:24 | 显示全部楼层
用寄存器配置试试
morrisk 发表于 2019-10-13 14:33 | 显示全部楼层
PD0和PD1重映射后可以当中普通的IO管脚使用?
zyf部长 发表于 2019-10-13 14:46 | 显示全部楼层

没看英文说明吗?只能作为输出使用
xxmmi 发表于 2019-10-13 14:58 | 显示全部楼层
不能作为输入使用
kangzj 发表于 2019-10-13 15:01 | 显示全部楼层
可以作为输入使用,验证过了
zwll 发表于 2019-10-13 15:04 | 显示全部楼层

你最后那句把映射又打开了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

780

主题

8627

帖子

5

粉丝
快速回复 在线客服 返回列表 返回顶部