各位大神,我是新手,希望各位能够耐心解答。我现在用到stm32RCT6的PA口,其中低八位PA7----PA0做数据口。我的问题是这8个口的输出不受程序控制。
初始化函数如下
void Data_Gpio_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3||GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
}
我在main函数中写
GPIO_SetBits(GPIOA, GPIO_Pin_1);
或者是
GPIO_Write(GPIOA, 0x00FF);
都不能输出高,请各位不吝赐教,先谢谢了!!!
|