Arm 在LPC2468中配置UART1

Arm 在LPC2468中配置UART1,arm,Arm,我在lpc2468基于ARM的微控制器上工作。我无法配置控制器的UART1。以前我使用UART0也是出于同样的目的,但是由于硬件上的一些变化,现在我不得不使用UART1 我想将GPRS模块(SIMCOM 300)连接到微控制器的UART1。以下是我目前的代码: void init_serial_gprs (void){ PINSEL7 |= 0x0000000F; U1LCR = 0x00000080; U1DLL = 0x00000041; U1DLM

我在lpc2468基于ARM的微控制器上工作。我无法配置控制器的UART1。以前我使用UART0也是出于同样的目的,但是由于硬件上的一些变化,现在我不得不使用UART1

我想将GPRS模块(SIMCOM 300)连接到微控制器的UART1。以下是我目前的代码:

void init_serial_gprs (void){
    PINSEL7  |= 0x0000000F;
    U1LCR  = 0x00000080;
    U1DLL  = 0x00000041;
    U1DLM  =   0x00000000;
    U1LCR  = 0x03;
    VICVectAddr7 = (unsigned)serial1_isr;
    VICIntEnable = 1 << 7;
    SBUF= U1RBR;
    U1IER = 3;
}

void serial1_isr(void) __irq {
    volatile char dummy;
    volatile UWORD32 IIR1;

    /*------------------------------------------------
     Repeat while there is at least one interrupt source.
     ------------------------------------------------*/
    while (((IIR1 = U1IIR) & 0x01) == 0)
    {
        switch (IIR1 & 0x0E)
        {
            case 0x06: /* Receive Line Status */
                dummy = U1LSR;  /* Just clear the interrupt source */
                break;

            case 0x04: /* Receive Data Available */
            case 0x0C: /* Character Time-Out */
                SBUF= U1RBR;
                if(genflag.fl_m_psw || new_st == 0 ||new_st == 0x1f){
                    if(genflag.gprs_con)  receive_data();
                    else
                        receive_data_gprs();
                }
                break;

            case 0x02: /* THRE Interrupt */
                if(genflag.gprs_con) transfer_data();
                else transfer_data_gprs();
                dummy   = U1LSR;
                break;

            default:
                break;
        }
    }
    VICVectAddr = 0; /* Acknowledge Interrupt */
}
void init_serial_gprs(void){
PINSEL7 |=0x0000000F;
U1LCR=0x00000080;
U1DLL=0x00000041;
U1DLM=0x00000000;
U1LCR=0x03;
VICVectAddr7=(无符号)串行1_isr;

VICIntEnable=1您是否尝试先对哑终端(超级终端、minicom、putty)轮询串行端口为了确保您掌握了基本知识,然后继续讨论中断?

它看起来不错,但不确定它为什么不工作。PCLK_SEL0是uart所需的吗?您的除数是正确的吗?我会将一些内容发送到端口,并使用哑终端或示波器来确保波特率是您所期望的。同样,使用哑终端返回到端口查看接收器是否工作并获取字节。