Hello,
I would like to send an SPI sequence to an another board in different time Intervalls.
To do that I'm using Dave 4.3.2, the Timer APP and the Interrupt APP.
I connected the time event to the interrupt and changed the SPI receiving and transmitting settings to direct.
I tried different possibilities. The timer without the SPI works. As soon as I add the SPI TRansmit it doesn't anymore.
Is it possible to start an SPI Transmit in an Interrupt?
Here are the seetings and the code :
Attachment 2703
Attachment 2704
the code for the timer interrupt:
I thought about not putting the SPI in the timer event ans trigger the SPI transmit every time the timer finishes. It is also a possibility. I would like though to understand why it is not working in this setting. I tried placing break points to see what
happens. But it is not going through the values
thanks for the Help.
I would like to send an SPI sequence to an another board in different time Intervalls.
To do that I'm using Dave 4.3.2, the Timer APP and the Interrupt APP.
I connected the time event to the interrupt and changed the SPI receiving and transmitting settings to direct.
I tried different possibilities. The timer without the SPI works. As soon as I add the SPI TRansmit it doesn't anymore.
Is it possible to start an SPI Transmit in an Interrupt?
Here are the seetings and the code :
Attachment 2703
Attachment 2704
the code for the timer interrupt:
Code:
void Time_Interval_Event(void)
{
/* Acknowledge Period Match interrupt generated on TIMER_CCU_1 */
TIMER_ClearEvent(&TIMER_0);
/* When we Arrive at the end of the send values we repeat*/
if (index_count == NumValues){
index_count = 0;
}
/* if the new time starts, send the signal */
if (Timer_Tick_Count == 0){
SPI_MASTER_TransmitWord(&SPI_MASTER_0,IArr[index_count]);// send the wanted current Value
}
Timer_Tick_Count++;
/* when the current time step ends, reset the tick count, change the maximum tick count to the new value and move to the next current value */
if (Timer_Tick_Count == Max_Tick_Count ){
Timer_Tick_Count = 0;
index_count++;
Max_Tick_Count = idxMAXValues[index_count];
//new Max_Tick_Count value
}
/*disable CS to latch data */
TIMER_Start(&TIMER_0);
}
I thought about not putting the SPI in the timer event ans trigger the SPI transmit every time the timer finishes. It is also a possibility. I would like though to understand why it is not working in this setting. I tried placing break points to see what
happens. But it is not going through the values
thanks for the Help.