TI中文支持网
TI专业的中文技术问题搜集分享网站

6747 UART中断

我参考的研旭6747的开发板,例程uart是查询方式,我想使用成中断方式,所以自己修改了只有uart的小程序,但是始终进不了中断,不知道初始化哪里有问题。

void main( void )
{
/* 初始化6747核 */

C6747_init();
PINMUX11 = 0x00001100; //UART1_TXD,UART1_RintXD
CSR&=0xfffe;
asm(" NOP 2 ");
/* 打开UART1,并设置波特率 */
Wuart_test(1);
INTmux1=0x2E0000; // 指定uart1 到中断
asm(" NOP 2 "); ISTP=0x80000000;
asm(" NOP 2 "); // 重置中断向量表到0C00h
ICR=0xfff0; asm(" NOP 2 ");
ISR=0x0; // 清除等待的中断
asm(" NOP 2 ");
IER=0xffff; CSR=CSR|0x1; //开总中断
while(1)
{
}

}

 UART_Handle C6747_UART_open( Uint16 id, Uint32 baudrate )
{
        UART_Handle uart_handle;
        Uint32 divisor;
volatile Uint16 dummy;

        /*
         *  UART clk / baudrate
         *  = 150,000,000 / (900 * 16)
         */
        divisor = 150000000 / ( baudrate * 16);

        switch ( id )
        {
            case 0:
                uart_handle = ( UART_Handle )&UART_MODULE_0;
                break;
            case 1:
                uart_handle = ( UART_Handle )&UART_MODULE_1;
                break;
            case 2:
                uart_handle = ( UART_Handle )&UART_MODULE_2;
                break;
            default:
                return ( UART_Handle )-1;
        }

        uart_handle->regs->PWREMU_MGMT = 0;         // Reset UART TX & RX components

        C6747_wait( 100 );

        uart_handle->regs->DLL = (divisor & 0xff);  // Set baud rate
        uart_handle->regs->DLH = (divisor >> 8);
        
        uart_handle->regs->FCR = 0x0007;            // Clear UART TX & RX FIFOs
        uart_handle->regs->FCR = 0x0000;            // Non-FIFO mode
        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 = 0xE001;    // Enable TX & RX componenets

// Clear any pre-existing characters
        dummy = uart_handle->regs->THR;
    return uart_handle;
}

Shine:

重复帖。http://www.deyisupport.com/question_answer/dsp_arm/c6000_dsp/f/32/t/127785.aspx 

赞(0)
未经允许不得转载:TI中文支持网 » 6747 UART中断
分享到: 更多 (0)