请教:如何把MM32F0010的烧录引脚SWDIO设置为普通io口呢?
1、现在按照正常初始化后是不能控制的,同样初始化程序其它io可以正常控制。
2、是不是烧录口初始化普通io需要其他操作?
,程序如下s32 main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHBPeriphClockCmd(RCC_AHBENR_GPIOA, ENABLE);
GPIO_StructInit(&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_13 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIOA->AFRL = 0x7777;
GPIOA->AFRH = 0x7777;
while(1)
{
i = 65535;
(GPIOA->ODR&(1<<4))?(GPIOA->BRR=(1<<4)):(GPIOA->BSRR = (1<<4)); //示波器可以看到取反信号
while(i){i--;asm("nop");}
(GPIOA->ODR&(1<<13))?(GPIOA->BRR=(1<<13)):(GPIOA->BSRR = (1<<13));<font color="#ff0000">//示波器看不到取反信号</font>
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
(GPIOA->ODR&(1<<15))?(GPIOA->BRR=(1<<15)):(GPIOA->BSRR = (1<<15));//示波器可以看到取反信号
}
}
|