Panasonic MN101C77C, F77G user manual TM0IE

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 232
Image 232

Chapter 6 8-bit Timers

 

Setup Procedure

 

 

Description

 

 

 

 

 

(7)

Enable the interrupt.

 

(7)

Set the TM0IE flag of the TM0ICR register to

 

TM0ICR (x'3FE9')

 

 

"1" to enable the interrupt.

 

bp1

:TM0IE

= 1

 

 

(8)

Start the timer operation.

 

(8)

Set the TM0EN flag of the TM0MD register to

 

TM0MD (x'3F54')

 

 

"1" to start the timer 0.

 

bp3

:TM0EN

= 1

 

 

 

 

 

 

 

 

The TM0BC starts to count up from 'x00'. When the TM0BC reaches the setting value of the TM0OC register, the timer 0 interrupt request flag is set at the next count clock, then the value of the TM0BC becomes x'00' and restart to count up.

When the TMnEN flag of the TMnMD register is changed at the same time to other bit, binary counter may start to count up by the switching operation.

If fx is selected as the count clock source, when the binary counter is read at operation, uncertain value on counting up may be read. To prevent this, select the synchronous fx as the count clock source.

In this case the timer n counter counts up in synchronization with system clock, therefore the correct value is always read.

But, if the synchronous fx is selected as the count clock source, CPU mode cannot return from STOP/HALT mode.

VI - 18 8-bit Timer Count

Page 232
Image 232
Panasonic MN101C77C, F77G user manual TM0IE