Hi,
I am working on SCI communication between two TMS320F280049C. I have an issue with the RX FIFO interrupt, it never triggers.
Here is my code. (The same code is used in both TMS320F280049C)
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Disable pin locks and enable internal pullups.
//
Device_initGPIO();
//
// Disable sync(Freeze clock to PWM as well)
//
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
//
// Initializes PIE and clear PIE registers. Disables CPU interrupts.
// and clear all CPU interrupt flags.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
Interrupt_register(INT_SCIB_RX, &INT_mySCIB_RX_ISR);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
Interrupt_disable(INT_SCIB_RX);
sci_gpio_init();
sci_init();
#ifdef AUTOBAUD
//
// Perform an autobaud lock.
// SCI expects an 'a' or 'A' to lock the baud rate.
//
SCI_lockAutobaud(SCIB_BASE);
#endif
//
//Enable SCIB interrupt
//
SCI_enableInterrupt(SCIB_BASE, SCI_INT_RXFF);
Interrupt_enable(INT_SCIB_RX);
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
while(1)
{
sci_send_state(sciDataSend);
DEVICE_DELAY_US(1000);
}
}
__interrupt void INT_mySCIB_RX_ISR(void)
{
sciDataReceived = SCI_readCharBlockingFIFO(SCIB_BASE);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
SCI_clearInterruptStatus(SCIB_BASE, SCI_INT_RXFF);
}
//
//
//
void sci_init(void)
{
SCI_performSoftwareReset(SCIB_BASE);
SCI_disableModule(SCIB_BASE);
SCI_setConfig(SCIB_BASE, 25000000, 9600, (SCI_CONFIG_WLEN_8 |
SCI_CONFIG_STOP_ONE |
SCI_CONFIG_PAR_NONE));
SCI_disableLoopback(SCIB_BASE);
SCI_resetChannels(SCIB_BASE);
//
// FIFO and interrupt configuration
//
SCI_enableFIFO(SCIB_BASE);
SCI_clearInterruptStatus(SCIB_BASE, SCI_INT_RXFF);
SCI_setFIFOInterruptLevel(SCIB_BASE, SCI_FIFO_TX1, SCI_FIFO_RX1);
SCI_enableModule(SCIB_BASE);
SCI_performSoftwareReset(SCIB_BASE);
}
//
//
//
void sci_gpio_init(void)
{
EALLOW;
GPIO_setMasterCore(SCIB_TX, GPIO_CORE_CPU1); //
GPIO_setMasterCore(SCIB_RX, GPIO_CORE_CPU1); //
GPIO_setPinConfig(GPIO_56_SCIB_TX); //
GPIO_setPinConfig(GPIO_57_SCIB_RX); //
GPIO_setDirectionMode(SCIB_TX, GPIO_DIR_MODE_OUT); //
GPIO_setDirectionMode(SCIB_RX, GPIO_DIR_MODE_IN); //
// GPIO_setPadConfig(SCIB_TX, GPIO_PIN_TYPE_STD); //
// GPIO_setPadConfig(SCIB_RX, GPIO_PIN_TYPE_STD); //
GPIO_setQualificationMode(SCIB_TX, GPIO_QUAL_ASYNC); // No synchronization
GPIO_setQualificationMode(SCIB_RX, GPIO_QUAL_ASYNC); // No synchronization
EDIS;
}
void sci_send_state(uint16_t state)
{
while(SCI_isTransmitterBusy(SCIB_BASE) == true); //
SCI_writeCharBlockingNonFIFO(SCIB_BASE, state); // Send the current state of the Buck
}
Thank you in advance for your answer !
Lorend Dalloshi