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.

TMS320F28P650DK: XBARINPUT触发外部中断

Part Number: TMS320F28P650DK

大家好:

         我想使用GPIO输出XBAR来控制外部中断信号产生,使用如下程序,发现中断并不响应,需要如何配置呢

     //
// Included Files
//
#include "driverlib.h"
#include "device.h"
__interrupt void Xint1ISR(void)
{
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// Main
//
void main(void)
{
    //
    // Initialize device clock and peripherals
    //
    Device_init();
    //
    // Assign RAMs and Flash banks to CPU2.
    // In the default CPU2 linker cmd files, GS4, FLASH_BANK3 and FLASH_BANK4
    // are used for allocating various CPU2 sections.
    // In case CPU2 needs additional RAM or Flash regions, CPU1 needs to assign
    // its ownership to CPU2 using the following functions :
    //      - MemCfg_setGSRAMControllerSel for GSRAM
    //      - SysCtl_allocateDxRAM for DRAM
    //      - SysCtl_allocateFlashBank for Flash
    //
    MemCfg_setGSRAMControllerSel(MEMCFG_SECT_GS4, MEMCFG_GSRAMCONTROLLER_CPU2);
    SysCtl_allocateFlashBank(SYSCTL_FLASH_BANK3, SYSCTL_CPUSEL_CPU2);
    SysCtl_allocateFlashBank(SYSCTL_FLASH_BANK4, SYSCTL_CPUSEL_CPU2);
 
    //
    // Boot CPU2 core
    //
#ifdef _FLASH
    Device_bootCPU2(BOOTMODE_BOOT_TO_FLASH_BANK3_SECTOR0);
#else
    Device_bootCPU2(BOOTMODE_BOOT_TO_M0RAM);
#endif
    //
    // Initialize PIE and clear PIE registers. Disables CPU interrupts.
    //
    Interrupt_initModule();
    //
    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    //
    Interrupt_initVectorTable();
    GPIO_setPadConfig(201U, GPIO_PIN_TYPE_STD);
    GPIO_setDirectionMode(201U, GPIO_DIR_MODE_OUT);
    GPIO_setPinConfig(GPIO_201_OUTPUTXBAR1);
    XBAR_setOutputMuxConfig(OUTPUTXBAR_BASE,XBAR_OUTPUT1,XBAR_OUT_MUX07_INPUTXBAR4);
    GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_RISING_EDGE);
    GPIO_enableInterrupt(GPIO_INT_XINT1);
    GPIO_enableInterrupt(GPIO_INT_XINT1);
    Interrupt_enable(INT_XINT1);
    Interrupt_register(INT_XINT1, &Xint1ISR);
   
    //
    // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
    //
    EINT;
    ERTM;
    //
    // Loop Forever
    //
    for(;;)
    {
        GPIO_writePin(201U, 0);
        //
        // Delay for a bit.
        //
        DEVICE_DELAY_US(500000);
        GPIO_writePin(201U, 1);
        //
        // Delay for a bit.
        //
        DEVICE_DELAY_US(500000);
    }
}