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.

[参考译文] TMS320F28379D:

Guru**** 2590550 points
Other Parts Discussed in Thread: C2000WARE

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1039379/tms320f28379d

器件型号:TMS320F28379D
主题中讨论的其他器件:C2000WARE

I2C 中断服务例程未触发?

当我调试/运行我的代码时、它最终会在一个名为  Interrupt_DefaultHandler 的例程中报告 变量:压电式 Vect=0x0DB1 和 vectID 88

我的代码包含以下行:

Interrupt_initModule();
Interrupt_initVectorTable();
Interrupt_register(INT_I2CA, &i2cAISR);

I2C_disableModule(I2CA_BASE);
I2C_initMaster(I2CA_BASE, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_33);
I2C_setBitCount(I2CA_BASE, I2C_BITCOUNT_8);
I2C_setSlaveAddress(I2CA_BASE, SLAVE_ADDRESS);
I2C_setEmulationMode(I2CA_BASE, I2C_EMULATION_STOP_SCL_LOW);
I2C_enableInterrupt(I2CA_BASE, I2C_INT_STOP_CONDITION |
I2C_enableFIFO(I2CA_BASE);
I2C_clearInterruptStatus(I2CA_BASE, I2C_INT_RXFF | I2C_INT_TXFF);
I2C_enableModule(I2CA_BASE);

    if(I2C_getStopConditionStatus(I2CA_BASE))
    {
        return(ERROR_STOP_NOT_READY);
    }

    I2C_setSlaveAddress(I2CA_BASE, SLAVE_ADDRESS);

    if(I2C_isBusBusy(I2CA_BASE))
    {
        return(ERROR_BUS_BUSY);
    }

    I2C_setDataCount(I2CA_BASE, (msg->numBytes + 2));

    I2C_putData(I2CA_BASE, msg->command);
    I2C_putData(I2CA_BASE, msg->memoryHighAddr);
    I2C_putData(I2CA_BASE, msg->memoryLowAddr);

    for (i = 0; i < msg->numBytes; i++)
    {
        I2C_putData(I2CA_BASE, msg->dataBuffer[i]);
    }

    //
    // Send start as master transmitter
    //
    I2C_setConfig(I2CA_BASE, I2C_MASTER_SEND_MODE);
    I2C_sendStartCondition(I2CA_BASE);
    I2C_sendStopCondition(I2CA_BASE);

INT_I2CA 寄存器矢量0x0DB0 (不是0x0DB1) 寄存器描述为:

名称 矢量 ID 地址 大小(x16) 说明 内核优先级 ePIE 组优先级
INT8.1 88 0x0000 0DB0 2. I2CA 中断 12. 1 (最高)

它是如何在奇数地址上结束的?  我认为我甚至不会注册地址 "0x0DB1"

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Terry、

    我建议查看并比较 C2000WARE 中 F2837x 器件的'i2c_ex6_EEPROM_interrupt'软件示例。 目录位置如下:

    C:\ti\c2000Ware_3_04_00_00\driverlib\f2837xd\examples\cpu1\i2c

    一些用于检查中断使能的附加函数/代码行:

        //
        // Interrupts that are used in this example are re-mapped to ISR functions
        // found within this file.
        //
        Interrupt_register(INT_I2CA_FIFO, &i2cFIFO_isr);
    
        Interrupt_enable(INT_I2CA_FIFO);
    
        Interrupt_register(INT_I2CA, &i2c_isr);
    
        Interrupt_enable(INT_I2CA);
    
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;

    最棒的

    Kevin

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢 Kevin:

       我最终放弃了这种方法、并使用了示例4中的代码、这对我来说很有效。