我在测试其所有端口的时候发现,portj4~7不能正常翻转。portj0~2正常翻转。portj端口全部引脚只用SIP单排插针引出没接别的。以下是我的测试
程序。
int main(void)
{
//// 时钟初始化:晶振,16MHz
unsigned long ulLoop;
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, 0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, 0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, 0xf0);
GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, 0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, 0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, 0x3f);
GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_1|GPIO_PIN_7|GPIO_PIN_0);
GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, 0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTJ_BASE, 0xff);
for(; ; )
{
GPIOPinWrite(GPIO_PORTA_BASE,0xff,0xff);
GPIOPinWrite(GPIO_PORTB_BASE,0xff,0xff);
GPIOPinWrite(GPIO_PORTC_BASE,0xf0,0xf0);
GPIOPinWrite(GPIO_PORTD_BASE,0xff,0xff);
GPIOPinWrite(GPIO_PORTE_BASE,0xff,0xff);
GPIOPinWrite(GPIO_PORTF_BASE,0x3f,0x3f);
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_1|GPIO_PIN_7|GPIO_PIN_0, GPIO_PIN_1|GPIO_PIN_7|GPIO_PIN_0);
GPIOPinWrite(GPIO_PORTH_BASE,0xff,0xff);
GPIOPinWrite(GPIO_PORTJ_BASE,0xff,0xff);
for(ulLoop = 0; ulLoop < 200000; ulLoop++)
{
}
GPIOPinWrite(GPIO_PORTA_BASE,0xff,0);
GPIOPinWrite(GPIO_PORTB_BASE,0xff,0);
GPIOPinWrite(GPIO_PORTC_BASE,0xf0,0);
GPIOPinWrite(GPIO_PORTD_BASE,0xff,0);
GPIOPinWrite(GPIO_PORTE_BASE,0xff,0);
GPIOPinWrite(GPIO_PORTF_BASE,0x3f,0);
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_1|GPIO_PIN_7|GPIO_PIN_0, 0);
GPIOPinWrite(GPIO_PORTH_BASE,0xff,0);
GPIOPinWrite(GPIO_PORTJ_BASE,0xff,0);
for(ulLoop = 0; ulLoop < 200000; ulLoop++)
{
}
}
}
我看过9b90 datasheet portj4~7复位后不是特殊
功能引脚,按照上面的程序为什么portj4~7不能正常翻转呢,难道是芯片的特性还是它的BUG?求解。
此帖出自
小平头技术问答
一周热门 更多>