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.

2 interrupts of 4 ms (approx) and 1 sec using ACLK- 32768 without using RTC in MSP430FR69271

Other Parts Discussed in Thread: MSP430FR69271

Dear All,

I am working on a project using MSP430FR69271.

I want to implement 2 interrupts of  4 ms (approx) and 1 sec using ACLK- 32768  without using RTC.

Kindly advice.

Thanks 

utpal

  • This can be done with timers. What exactly is the problem with your code?
  • With this ACLK, you have ~32 timer ticks per ms.
    The easiest way, with using just one timer, is to have your 1s interrupt tied to the timer overflow (every 65536 ticks when running the timer in CONT mode)
    For the 4ms interrupt, you activate the compare interrupt for CCR0 (has its own interrupt vector). You start with writing 131 to CCR0. In the ISR, you increment this value by another 131 each time, so the next interrupt happens 131 ticks (= 3.9978ms) later.
    You should do an additional check whether the new setting is still below the current timer count, in case you have a large interrupt latency of 4ms. If you for some reason miss this point, you'll have to wait for 2s for the next 4ms interrupt.

**Attention** This is a public forum