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.
Hello,
I am porting over a SCI driver and protocol handler to a SYS/BIOS project.
Do I need to configure a HWI for the SCI interrupts? Or can I just use my existing driver to set up the interrupts and ISRs.
Here's how I configure the interrupts and ISR
case SCIB_UART_PORT: PieVectTable.SCITXINTB = (PINT)&SCIB_FIFOTxBufferEmpty_isr; PieVectTable.SCIRXINTB = (PINT)&SCIB_FIFORxBufferFull_isr; PieCtrlRegs.PIEIER9.bit.INTx3 = 1; PieCtrlRegs.PIEIER9.bit.INTx4 = 1; IER |= M_INT9; break;
will any of these be overwritten by SYS/BIOS?
If doing it this way is an issue, could you please show me the steps to set up an HWI? See below. Did I set them up correctly?
What else do I need to do?
Stephen
I'd recommend using a Hwi, especially if you want to be able to call SYS/BIOS functions from inside the ISR. Your Hwi setup looks fine. Make sure to remove the code that writes to PieVectTable from your application. SYS/BIOS is going to fill the vector table with its Hwi dispatcher which will call the ISR function, so writing to PieVectTable yourself with overwrite the SYS/BIOS configuration which can cause scheduler issues.
This post has some nice information about using SYS/BIOS on the C28x including quite a bit on Hwis:
[FAQ] Are there any C28 device specific items with TI-RTOS (SYS/BIOS)? - C2000 microcontrollers forum...
Whitney
Hello whitney,
thanks.
Do I still ack the PIE (e.g. PieCtrlRegs.PIEACK.all |= PIEACK_GROUP8; // Must acknowledge the PIE group) at the end of the ISR or does sys/bios do that?
Stephen
Also, will sys/bios do all the following:
PieVectTable.SCITXINTB = (PINT)&SCIB_FIFOTxBufferEmpty_isr; PieVectTable.SCIRXINTB = (PINT)&SCIB_FIFORxBufferFull_isr; PieCtrlRegs.PIEIER9.bit.INTx3 = 1; PieCtrlRegs.PIEIER9.bit.INTx4 = 1; IER |= M_INT9;
Yes, by default, SYS/BIOS will perform the ACK, configure the PIE vector table, and enable the interrupts in both the PIE and the CPU (IER).
If you don't want SYS/BIOS to automatically do the enable, you can uncheck that "Enable at startup" box and then use the Hwi_enablePIEIER and Hwi_enableIER functions to enable it later in the application.
Whitney