Panasonic MN103001G/F01K User Manual

Page 241

Advertising
background image

8-bit Timers

10-21

(6) Enable the timer counting operation.

Once TMnCNE is set to "1" in the TMnMD register, the counting operation starts.

Once the counting operation is enabled, an underflow interrupt request is generated at fixed intervals.

In addition, the pin output is inverted each time that this interrupt is generated, and the value that is set in TMnBR

is loaded into TMnBC.

If the value in the TMnBR register is changed while the counting operation is in progress, that value is loaded as the
initial value the next time that an underflow is generated, and then the interrupt cycle changes.

Procedure for ending operation

(1) Stop the timer counting operation.

Set TMnCNE to "0" in the TMnMD register, stopping the counting operation.

(2) Initialize the timer, if necessary.

If TMnLDE is set to "1" in the TMnBR register, the value that is set in TMnMD is loaded into TMnBC as the

initial value, and the timer output is reset. If only the timer is stopped and "1" is not written to TMnLDE, the
status of the binary counter and the pin output are maintained as they were before the counting operation was

stopped. If TMnCNE is set to "1", the count resumes from the state that was in effect immediately before the
counting operation was stopped.

Advertising