Chapter 5 Prescaler

5-3-2 Setup Example

„Prescaler Setup Example (Timer 0 count clock)

Select the clock of fosc/16 that is output from the prescaler 0, to the count clock of the timer 0. An example setup procedure , with a description of each step is shown below.

 

Setup Procedure

 

 

Description

 

 

 

 

 

(1)

Select the prescaler output.

 

(1)

Select the prescaler output to fosc/16 by the

 

CK0MD (x'3F56')

 

 

TM0PSC1-0, TM0BAS flag of the timer 0

 

bp2-1

: TM0PSC1-0 = 01

 

prescaler selection register (CK0MD).

 

bp0

: TM0BAS

= 0

 

 

(2)

Enable the prescaler output.

(2)

Enable the prescaler counting by setting the

 

PSCMD (x'3F6F')

 

 

PSCEN flag of the prescaler control register

 

bp0

: PSCEN

= 1

 

(PSCMD) to "1".

 

 

 

 

 

 

Enable the prescaler counting by the PSCEN flag of the prescaler control register (PSCMD). The prescaler counting is started after it is enabled.

Start the timer operation after the prescaler is set. Also, the selection of the prescaler output should be set by the timer mode register.

V - 12 Operation

Page 214
Image 214
Panasonic MN101C77C, F77G user manual TM0BAS, Pscen, Pscmd to