This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP--C5000--GPIO高速翻转输出

尊敬的TI工程师:

    您好,现在我用GPIO模拟串口UART。想用GP22作为输出,但是这个IO口输出的速率很慢,10hz一下的输出方波的波形正常,让它以1Khz,它就成一条直线了,输出的全是高电平。我哪里设置错了?


/* Disable CPU interrupt */
IRQ_globalDisable();

/* Initialize Interrupt Vector table */
IRQ_setVecs((Uint32)(&VECSTART));

/* Open GPIO module */
hGpio_GP22 = GPIO_open(&GpioObj_GP22,&status);

   GPIO_reset(hGpio_GP22);

config.pinNum = CSL_GPIO_PIN22;
config.direction = CSL_GPIO_DIR_OUTPUT;
config.trigger = CSL_GPIO_TRIG_CLEAR_EDGE;
status = GPIO_configBit(hGpio_GP22,&config);

/* Enabling Interrupt */
IRQ_enable(GPIO_EVENT);
IRQ_globalEnable();




void gpt1Isr(void)
{

fTimer_01++;
if(fTimer_01%2 == 0)
{ 
GPIO_write(hGpio_GP22,CSL_GPIO_PIN22,1);
}
else
{
GPIO_write(hGpio_GP22,CSL_GPIO_PIN22,0);

}

/* Clear Timer Interrupt Aggregation Flag Register (TIAFR) */
CSL_SYSCTRL_REGS->TIAFR = 0x02;

printf("\r\nTimer1 ISR\r\n");
}