Uart中断服务器程序进不去。
我的配置步骤如下
1.
2. C64_enableIER (C64_EINT5);
3.Initialize Uart0
uart_handle->regs->PWREMU_MGMT = 0; // Reset UART TX & RX components
_wait( 100 );
uart_handle->regs->DLL = ( divisor & 0xff ); // Set baud rate
uart_handle->regs->DLH = ( divisor >> 8 ) & 0xff;
uart_handle->regs->FCR = 0x0007; // Clear UART TX & RX FIFOs
uart_handle->regs->FCR = 0x0001; // Enable TX & RX FIFOs 1-byte
uart_handle->regs->IER = 0x0007; // Enable interrupts
uart_handle->regs->LCR = 0x0003; // 8-bit words,
// 1 STOP bit generated,
// No Parity, No Stick paritiy,
// No Break control
uart_handle->regs->MCR = 0x0000; // RTS & CTS disabled,
// Loopback mode disabled,
// Autoflow disabled
uart_handle->regs->PWREMU_MGMT = 0x6001; // Emulation Free,
// Enable TX & RX componenets
if ( ( uart_handle->regs->IIR & 0xC0 ) == 0xC0 )// Check FIFOs are Enabled
return uart_handle;
else
return ( UART_Handle )-1;
4.中断服务程序
void uartisr ()
{
Uint8 data = 50;//, errors = 0;
Uint8 iir;
//UART_Handle uart0;
iir =evm_uart_getIIR( uart0 );
pevm_uart_putChar( uart0, data ); // Write 1 byte
printf("\nUart send message sucessful!");
_waitusec( 1000000);
}
问题出在哪里呢?谢谢
Chris Meng:
你好,
中断服务程序前是否应该有Interrupt关键字? 或者使用Dispatcher?
也请看看IER寄存器:https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/t/6322。
mr bryant:
回复 Chris Meng:
嗯,非常感谢!!