Panasonic MN101C77C, F77G user manual Setup Example, Source of the binary counter

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 292
Image 292

Chapter 7 16-bit Timer

7-8-2 Setup Example

„Synchronous Output Setup Example (Timer 7)

Setup example that latched data of port 6 is output constantly (100 µs) by using timer 7 from the synchro- nous output pin is shown below. The clock source of timer 7 is selected fs/4 (at fosc=8 MHz).

An example setup procedure, with a description of each step is shown below.

Setup Procedure

 

 

Description

 

 

 

(1) Stop the counter.

 

(1) Set the TM7EN flag of the timer 7 mode

TM7MD1 (x'3F78')

 

register 1 (TM7MD1) to "0" to stop timer 7

bp4

: TM7EN

= 0

counting.

(2) Select the synchronous output

(2) Set the SYOEVS1-0 flag of the pin control

event.

 

 

register (FLOAT) to "01" to set the

FLOAT (x'3F2E')

 

synchronous output event to the timer 7

bp1-0

: SYOEVS1-0 = 01

interrupt.

(3) Set the synchronous output pin.

(3) Set the port 6 synchronous output control

P6SYO (x'3F1E')

= x'FF'

register (P6SYO) to x'FF' to set the

P6DIR(x'3F36')

= x'FF'

synchronous output pin.

 

 

 

(P67 to P60 : Synchronous output pin)

 

 

 

Set the port 6 direction control register

 

 

 

(P6DIR) to x'FF' to set port 6 to output pin.

 

 

 

If it needs, pull-up resistor should be added.

 

 

 

[

Chapter 4 I/O Ports ]

(4) Select the condition of timer clear.

(4) Set the TM7BCR flag of the TM7MD2 register

TM7MD2 (x'3F79')

 

to "1" to select the compare match as a clear

bp5

: TM7BCR

= 1

source of the binary counter.

(5) Select the count clock source.

(5) Select fs as a clock source by the TM7CK1-0

TM7MD1 (x'3F78')

 

flag of the TM7MD 1 register.

bp1-0

: TM7CK1-0 = 01

Also, select a 1/4 dividing as a clock source by

bp3-2

: TM7PS1-0 = 10

the TM7PS1-0 flag.

(6) Set the synchronous output event

(6) Set the synchronous output event generation

generation cycle.

 

cycle to the timer 7 preset register 1

TM7PR1 (x'3F75',x'3F74')=x'0063'

(TM7PR1). To be 10 kHz by dividing 1 MHz,

 

 

 

set as follows ;

 

 

 

 

100 - 1 = 99 (x'0063')

 

 

 

At that time, the same value is loaded to the

 

 

 

timer 7 compare register 1 (TM7OC1), and

 

 

 

TM7BC is initialized to x'0000'.

 

 

 

 

 

VII - 32 16-bit Timer Synchronous Output

Page 292
Image 292
Panasonic MN101C77C, F77G user manual Setup Example, Source of the binary counter