Other Parts Discussed in Thread: MOTORWARE, C2000WARE
Tool/software:
Greetings! My project is base on lab01_eabi from the MotorWare library 5_03. So I am using SCIB(GPIO pins 12 and 13). I can transmit data correctly with the expected baudrate. But I can`t receive data using RXINT. The interrupt fires just ones. The received byte is incorrect, I receive FIFO OVF flag and so on. Here is my code:
// UART TX GPIO_setMasterCore(12, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_12_SCITXDB); GPIO_setDirectionMode(12, GPIO_DIR_MODE_OUT); GPIO_setPadConfig(12, GPIO_PIN_TYPE_PULLUP); GPIO_setQualificationMode(12,GPIO_QUAL_ASYNC); // UART RX GPIO_setMasterCore(13, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_13_SCIRXDB); GPIO_setDirectionMode(13, GPIO_DIR_MODE_IN); GPIO_setPadConfig(13, GPIO_PIN_TYPE_STD); GPIO_setQualificationMode(13,GPIO_QUAL_ASYNC); void HAL_setupSCIB(HAL_Handle halHandle) { HAL_Obj *obj = (HAL_Obj *)halHandle; // Initialize SCIA and its FIFO. SCI_performSoftwareReset(obj->sciHandle[1]); // Configure SCIA for echoback. //SCI_setConfig(obj->sciHandle[1], DEVICE_LSPCLK_FREQ, 9600, // (SCI_CONFIG_WLEN_8 | // SCI_CONFIG_STOP_ONE | // SCI_CONFIG_PAR_NONE)); SCI_setConfig(obj->sciHandle[1], SYS_PER_CLK, 9600, (SCI_CONFIG_WLEN_8 | SCI_CONFIG_STOP_ONE | SCI_CONFIG_PAR_NONE)); SCI_resetChannels(obj->sciHandle[1]); SCI_resetRxFIFO(obj->sciHandle[1]); SCI_resetTxFIFO(obj->sciHandle[1]); SCI_clearInterruptStatus(obj->sciHandle[1], SCI_INT_TXFF | SCI_INT_RXFF); SCI_enableFIFO(obj->sciHandle[1]); SCI_enableModule(obj->sciHandle[1]); SCI_performSoftwareReset(obj->sciHandle[1]); } // end of DRV_setupSci() function Interrupt_register(INT_SCIB_RX, &SCIB_ISR); SCI_enableInterrupt(halHandle->sciHandle[1],SCI_INT_RXFF); SCI_clearInterruptStatus(halHandle->sciHandle[1],SCI_INT_RXFF|SCI_INT_RXRDY_BRKDT); SCI_enableModule(halHandle->sciHandle[1]); SCI_performSoftwareReset(halHandle->sciHandle[1]); SCI_enableInterrupt(halHandle->sciHandle[1],SCI_INT_RXFF|SCI_INT_RXRDY_BRKDT); SCI_clearInterruptStatus(halHandle->sciHandle[1], SCI_INT_RXFF|SCI_INT_RXRDY_BRKDT); SCI_clearOverflowStatus(halHandle->sciHandle[1]); Interrupt_enable(INT_SCIB_RX); Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9); // // disable global interrupts // HAL_enableGlobalInts(halHandle); __interrupt void SCIB_ISR(void) { // if(RS485_IncomeBufferPointer<RS485_BufferSize) { RS485_IncomeBuffer[RS485_IncomeBufferPointer++]=SCI_readCharBlockingFIFO(halHandle->sciHandle[1]); } Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9); return; }
So it fires just once. Am I reading the databyte in a wrong way? Or am I not clearing the int flag properly?
Thanks!