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.

32 bit timer on MSP430 F54xx microcontroller ?

Other Parts Discussed in Thread: MSP430F5418

 Can you help me find out if the following is possible on MSP430F5418 and F5419

 

1) Is it possible to create a 32 bit timer by chaining two 16 bit timers on MSP430 ?

2) Are there any limitations to chain the two 16 bit timers to get a single 32 bit timer ?

3) And is there any other way this achieve this objective ?

 

Thanks

Padua

  • 1) Yes. If you really want to do so, you can program one of the CC unit of the first Timer (low order 16 bit) to toggle an OUT pin and use that as the clock for the second Timer (high order 16 bit).

    2) The above method works for Continuous mode. I do not know how to do that in Up mode or Up.Down mode.

    3) It is far better to use Timer-overflow ISR to extend the counting range in software.

  • besides the already mentioned way to chain two timers (check the device datasheet, perhaps there's an internal connection of the output/input signals you can use) or a software overflow counter (which is the most flexible way, but means some small software effort) there are two more options:

    first, the watchdog timer is a 32 bit counter. It can be used in counter mode and you'll get an interrupt if it overflows. Its current value cannot be read, so it can only measure a full 32bit count.

    the other option is the RTC, which can be also used as a 32 bit counter/timer. Here you can also access the current RTC prescaler values (additional 2*8 bit cascaded, which usually break down the 32kHz clock to 1s ticks) and program different intervals. It's just not as straightforward as the normal 16 bit timers. An additional prescaler raises the counter range to up to 56 bit (but then the lower bits are not available for readout - just as the up to 3 bit prescaler for the normal timers).

    You cannot, however, trigger an interrupt at every possible 56bit value, only at selected intervals of the prescalers or at an 8/16/24/32 bit overflow in the 32 bit RTC register. It still is a good option for long-time delays.

     

**Attention** This is a public forum