微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > CC2640 UART0 中断问题

CC2640 UART0 中断问题

时间:10-02 整理:3721RD 点击:

不使用操作系统,裸机跑,使用UART0时,其中断与其他外围器件不太一样,必须使用UARTIntRegister(UART0_BASE,Uart0ISR);这个函数注册才行,而不是使用如下的中断向量表就可以的,而TIMER就直接使用下面的向量表就可以进中断

#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
void (* const g_pfnVectors[])(void) =
{
    (void (*)(void))((unsigned long)&__STACK_END),
                                            // The initial stack pointer
    ResetISR,                               // The reset handler
    NmiSR,                                  // The NMI handler
    FaultISR,                               // The hard fault handler
    IntDefaultHandler,                      // The MPU fault handler
    IntDefaultHandler,                      // The bus fault handler
    IntDefaultHandler,                      // The usage fault handler
    IntDefaultHandler,                                      // Reserved
    IntDefaultHandler,                                      // Reserved
    IntDefaultHandler,                                      // Reserved
    IntDefaultHandler,                                      // Reserved
    IntDefaultHandler,                      // SVCall handler
    IntDefaultHandler,                      // Debug monitor handler
    IntDefaultHandler,                                      // Reserved
    IntDefaultHandler,                      // The PendSV handler
    IntDefaultHandler,                      // The SysTick handler
    IntDefaultHandler,                      // AON edge detect
    IntDefaultHandler,                      // I2C
    IntDefaultHandler,                      // RF Core Command & Packet Engine 1
    IntDefaultHandler,                      // AON SpiSplave Rx, Tx and CS
    IntDefaultHandler,                      // AON RTC
    Uart0ISR,                                  // UART0 Rx and Tx
    Uart1ISR,                                  // AUX software event 0
    IntDefaultHandler,                      // SSI0 Rx and Tx
    IntDefaultHandler,                      // SSI1 Rx and Tx
    IntDefaultHandler,                      // RF Core Command & Packet Engine 0
    IntDefaultHandler,                      // RF Core Hardware
    IntDefaultHandler,                      // RF Core Command Acknowledge
    IntDefaultHandler,                      // I2S
    IntDefaultHandler,                      // AUX software event 1
    IntDefaultHandler,                      // Watchdog timer
    GPTTimer0AISR,                          // Timer 0 subtimer A
    IntDefaultHandler,                              // Timer 0 subtimer B
    IntDefaultHandler,                          // Timer 1 subtimer A
    IntDefaultHandler,                              // Timer 1 subtimer B
    IntDefaultHandler,                              // Timer 2 subtimer A
    IntDefaultHandler,                          // Timer 2 subtimer B
    IntDefaultHandler,                                  // Timer 3 subtimer A
    IntDefaultHandler,                          // Timer 3 subtimer B
    IntDefaultHandler,                      // Crypto Core Result available
    IntDefaultHandler,                      // uDMA Software
    IntDefaultHandler,                      // uDMA Error
    IntDefaultHandler,                      // Flash controller
    IntDefaultHandler,                      // Software Event 0
    IntDefaultHandler,                      // AUX combined event
    IntDefaultHandler,                      // AON programmable 0
    IntDefaultHandler,                      // Dynamic Programmable interrupt
                                            // source (Default: PRCM)
    IntDefaultHandler,                      // AUX Comparator A
    IntDefaultHandler,                      // AUX ADC new sample or ADC DMA
                                            // done, ADC underflow, ADC overflow
    IntDefaultHandler                       // TRNG event
};

Jun,

非常感谢分享,希望共同进步:)

谢谢你。感觉很厉害,但不会用啊。

问题1: #pragma DATA_SECTION(g_pfnVectors, ".intvecs") 中DATA_SECTION  和 intvecs怎么来的啊。

问题2:举个例子说明下怎么使用定时器0的溢出中断吧。就说说溢出中断吧。

问题3:我遇到个问题,设置了定时器0,并且开启了定时器0的timeout 中断,但发现不会注册中断 以及找不到中断处理函数名字啊。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top