Hi,
How to get 30 seconds delay using timer in MSP430FR5969
ACLK source = VLOCLK;
Max. Prescalar factor = 32;
Max. Timer division factor = 8;
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.
Hi,
How to get 30 seconds delay using timer in MSP430FR5969
ACLK source = VLOCLK;
Max. Prescalar factor = 32;
Max. Timer division factor = 8;
Try using ID_3 (/8), TA0EX0=7 (/8). Supposing VLOCLK=10kHz, set CCR0=10k/8/8*30=4687.
That said, VLOCLK is unlikely to be 10kHz (range 6-14kHz [Ref data sheet (SLAS704F) Table 5-7]), so you may have to play with that value a little.
[Edit: Fixed datasheet reference]
Yes. Its working.
So, from timer settings, I have verified that the System Clock is clock divided by Input Divider for 2 circuits(TA0CTL0 |= ID_3; along with TA0EX0 |= 0x07;)
Is there any change in Clock System input Divider?
TA0CCR0 = 4100; //VLO = 8.7KHz; (8700/8/8)*30;
TA0EX0 = 0x07;
TA0CCTL0 = CCIE; // Timer interrupts enable
TA0CTL = TASSEL_1 + ID_3 + MC_1 + TACLR; // Timer0_A
This is my code. I found that, 30 accuracy is obtained for 8.7KHz w.r.t calculation mentioned above. But in datasheet, typical VLO frequency is 9.4 KHz. How to get accurate results with typical frequency.
The VLO is notoriously inaccurate (but it's cheap!).
One thing you can do is measure its speed based on a known reference, e.g. SMCLK or crystal (LFXT) and use that to compute the delay constant.
There are Application Notes about this for the F2 and FR2 series -- one uses SMCLK and the other the RTC. Code is available via a link in the PDF.
https://www.ti.com/lit/an/slaa340a/slaa340a.pdf
https://www.ti.com/lit/an/slaa693a/slaa693a.pdf
Keep in mind the temperature drift in Table 5-7. Also, on some devices it changes when you go into LPM3 [I've forgotten where I saw this] so measure it in the mode you'll be using.
**Attention** This is a public forum