Texas Instruments MSC1210 manual Microseconds Timer, Milliseconds Timer

Models: MSC1210

1 324
Download 324 pages 20.97 Kb
Page 70
Image 70

System Timers

7.2.1Microseconds Timer

The microseconds timer is used by the MSC1210 in order to establish a 1s clock. This clock, in turn, is used by flash memory to establish timing for flash writes, as well as by the PWM module.

The USEC (FBH) SFR should be set to a value such that the system clock divid- ed by the value of this SFR, plus one, generates a 1s clock. For example, given a system clock of 12.000MHz, USEC should be set to:

12 000 000/1 000 000 = 12 – 1 = 11.

Therefore, for a 12.000MHz system clock, USEC should be set to 11 to generate a 1s clock.

In reality, the USEC SFR may be set to a value that produces a clock that is something other than 1s. This works fine as long as the other two timers that depend on the USEC SFR are adjusted accordingly.

7.2.1.1PWM Clock

The PWM module may use the microseconds timer as its input clock. By clear- ing SPDSEL (PWMCON.3), the input clock for the PWM module will be the mi- crosecond timer. This creates a 1MHz input clock for the PWM module, as- suming the microseconds timer is correctly configured to produce a 1s clock. In this case, the microseconds clock is further divided by the value contained in the PWMHI/PWMLOW SFRs.

7.2.1.2Flash Write Timing

The microseconds clock is further used to establish the flash memory write timing. The flash write timing uses the microsecond clock as an input clock and then fur- ther divides it by the value of FTCON[3:0] to generate a flash write clock. The flash write clock must be between 30s and 40s for flash writing to operate properly.

Specifically, FTCON[3:0] + 1, multiplied by five, multiplied by the frequency of the microsecond clock, should produce an appropriate flash write timer (30s to 40s).

Assuming USEC is set to generate a correct 1s clock, FTCON[3:0] should be set to 5, 6, or 7. If FTCON[3:0] is 6, then (6 + 1) S 5 = 35s, which is right in the middle of the expected range.

7.2.2Milliseconds Timer

The milliseconds timer is used by the MSC1210 in order to establish a millisec- ond clock. This clock, in turn, is used as a base for establishing flash erase tim- ing, the milliseconds interrupt, the seconds interrupt, and to establish timing for the watchdog timer.

7-6

Page 70
Image 70
Texas Instruments MSC1210 manual Microseconds Timer, Milliseconds Timer