Hi,
i am working with the 28069M MCU and the DRV8301 evaluation board and have been trying to receive SCI data via an interrupt.
However, after the interrupt is triggered once, it doesn't trigger again, although data is still sent.
I've already tried out the SCI echoback example and everything worked fine.
Another interesting aspect is that, although the baud rate is set to 9600, I always receive the data on my PC at a higher baud rate, in this case at 57600.
Thank you for any help in advance.
I'm attaching the relevant code lines below:
Init part:
// -------------- Initialize handles --------------//
MeinGPIOHandle = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj));
MeinADCHandle = ADC_init((void *)ADC_BASE_ADDR, sizeof(ADC_Obj));
MeinCLKHandle = CLK_init((void *)CLK_BASE_ADDR, sizeof(CLK_Obj));
MeinTIMERHandle = TIMER_init((void *)TIMER0_BASE_ADDR, sizeof(TIMER_Obj));
MeinTIMER1Handle = TIMER_init((void *)TIMER1_BASE_ADDR, sizeof(TIMER_Obj));
MeinTIMER2Handle = TIMER_init((void *)TIMER2_BASE_ADDR, sizeof(TIMER_Obj));
MeinFLASHHandle = FLASH_init((void *)FLASH_BASE_ADDR, sizeof(FLASH_Obj));
MeinPLLHandle = PLL_init((void *)PLL_BASE_ADDR, sizeof(PLL_Obj));
MeinCPUHandle = CPU_init((void *)NULL, sizeof(CPU_Obj));
MeinWDOGHandle = WDOG_init((void *)WDOG_BASE_ADDR, sizeof(WDOG_Obj));
MeinSCIHandle = SCI_init((void *)SCIA_BASE_ADDR, sizeof(SCI_Obj));
MeinPIEHandle = PIE_init((void *)PIE_BASE_ADDR, sizeof(PIE_Obj));
// -------------- Initialize GPIO --------------//
GPIO_setPullup(MeinGPIOHandle, GPIO_Number_28, GPIO_Pullup_Enable);
GPIO_setPullup(MeinGPIOHandle, GPIO_Number_29, GPIO_Pullup_Disable);
GPIO_setQualification(MeinGPIOHandle, GPIO_Number_28, GPIO_Qual_ASync);
GPIO_setMode(MeinGPIOHandle, GPIO_Number_28, GPIO_28_Mode_SCIRXDA);
GPIO_setMode(MeinGPIOHandle, GPIO_Number_29, GPIO_29_Mode_SCITXDA);
// -------------- Initialize SCI --------------//
CLK_enableSciaClock(MeinCLKHandle);
SCI_enableTx(MeinSCIHandle);
SCI_enableRx(MeinSCIHandle);
SCI_setMode(MeinSCIHandle, SCI_Mode_IdleLine);
SCI_disableParity(MeinSCIHandle);
SCI_disableLoopBack(MeinSCIHandle);
SCI_disableRxErrorInt(MeinSCIHandle);
SCI_setNumStopBits(MeinSCIHandle, SCI_NumStopBits_One);
SCI_setCharLength(MeinSCIHandle, SCI_CharLength_8_Bits);
SCI_enableRxInt(MeinSCIHandle);
SCI_disableTxInt(MeinSCIHandle);
SCI_setBaudRate(MeinSCIHandle, SCI_BaudRate_9_6_kBaud);
SCI_enable(MeinSCIHandle);
PIE_registerPieIntHandler(MeinPIEHandle, PIE_GroupNumber_9, PIE_SubGroupNumber_1, (PIE_IntVec_t)&sciaRxIsr);
PIE_enableInt(MeinPIEHandle, PIE_GroupNumber_9, PIE_InterruptSource_SCIARX);
CPU_enableInt(MeinCPUHandle, CPU_IntNumber_9);
CPU_enableGlobalInts(MeinCPUHandle); // Enable Global Interrupts
PIE_clearInt(MeinPIEHandle, PIE_GroupNumber_9);
Functions:
interrupt void sciaRxIsr(void)
{
// Do something ...
PIE_clearInt(MeinPIEHandle, PIE_GroupNumber_9);
}
System:
DRV8301-69M-KIT
C2000™ InstaSPIN™ TMS320F28069M MCU
Motorware_1_01_00_14