Hello,
I am working in a code where I want to use a timeout to send the packet again after this time. I attach my code without timer and I explain what I am trying to do. I want to send the packet again if after one second after sending it the first time I haven't received a response. I try to configure the timer like that:
-----------------------------------------------------------------------------------------------------------------------------------------------------
TB0CCR0 = 255; // Period = 1Mhz/256 = ~4.1Khz (8-bit DAC)
TB0CCTL1 = CLLD_1 + OUTMOD_7; // Use TB0.1 to output Sine Wave
TB0CCTL0 = CCIE; // Enable Interrupt on Period
TB0CCR1 =32768; // Load first sample value
TB0CTL = TBSSEL__SMCLK + MC_1; // Timer uses SMCLK in up mode
--------------------------------------------------------------------------------------------------------------------------------------------------------
and this is the ISR I am using:
---------------------------------------------------------------------------------------------------------------------------------------------------------
// Timer B0 interrupt service routine
#pragma vector=TIMER0_B0_VECTOR
__interrupt void TIMER0_B0_ISR(void)
{
TB0CCR1 = 32768;
timeout=1;
}
---------------------------------------------------------------------------------------------------------------------------------------------------------
It is not working, it's not going into the interrupt. I don't know what I am doing wrong. I don't know in which position of my code I should allocate the configuration of the timer. It shouldn't be difficult but I can't get it working...
Can any of you please suggest me what I should do, or if I should use another timer and where to allocate it? I would like an example or a modification of my code if it's possible.
Thank you in advance
** I am using the TrxEB, MSP430F5438A, CC1120 and the IAR workbench. And I posted this post in the as well, I hope there's no problem.