Other Parts Discussed in Thread: CONTROLSUITE
Tool/software: Code Composer Studio
Hello everyone ,
I start a new CSS project , I am adding manually all needed files.
Then i configure CPU0 interruption , and SPI interruption.
The problem is that only the cpu_timer_0 interruption works.
I also add cpu_timer_1 interruption to test , and same result. Only the cpu_timer_0 interrrupt works.
I test with an exemple from ti / Controle suite/ devices support [....] : SPI_ lookback_int , and I add in this example the cpu_timer_0 interruption. and It works.
I am confused , I have probably the same code that in the example from control_ suite, but something is missing .
For the spi_fifo_init I have the same configuration that in your example .
My configuration :
SysCtrlRegs.PCLKCR3.bit.CPUTIMER0ENCLK = 1; // CPU Timer 0
SysCtrlRegs.PCLKCR0.bit.SPIAENCLK = 1; // SPI-A
I have this line for interruption :
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.TINT0 = &cpu_timer0_isr;
PieVectTable.SPIRXINTA = &spiRxFifoIsr;
PieVectTable.SPITXINTA = &spiTxFifoIsr;
EDIS;
--------------------------------------------------------------------------------------------
// Enable CPU INT1 which is connected to CPU-Timer 0
IER |= M_INT1;
IER |= M_INT6;
--------------------------------------------------------------------------------------------
// Enable TINT0 in the PIE: Group 1 interrupt 7
PieCtrlRegs.PIEIER1.bit.INTx7 = 1;
PieCtrlRegs.PIEIER6.bit.INTx1=1; // Enable PIE Group 6, INT 1 SPI A TX
PieCtrlRegs.PIEIER6.bit.INTx2=1; // Enable PIE Group 6, INT 2 SPI A RX
-------------------------------------------------------------------------------------------
// Enable the PIE
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
// Enables PIE to drive a pulse into the CPU
PieCtrlRegs.PIEACK.all = 0xFFFF;
For my interruption I have :
__interrupt void cpu_timer0_isr(void)
{
DAC1(DAC_order1 ,1);
CpuTimer0Regs.TCR.bit.TIF=1; // Timer flag set to 0
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Acknowledge this interrupt to receive more interrupts from group 1
}
__interrupt void spiTxFifoIsr(void)
{
sdata ++ ;
SpiaRegs.SPIFFTX.bit.TXFFINTCLR=1; // Clear Interrupt flag
PieCtrlRegs.PIEACK.all = PIEACK_GROUP6 ; // Issue PIE ACK
}
The sdata variable is never incrementer , and in debug mode I can see that he never pass in the SPI_Tx interruption.
If you have any suggestion .
Thank you
Alain