Panasonic MN101C77C, F77G user manual Setup Example, IRQ2

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 202
Image 202

Chapter 4 I/O Ports

4-11-4 Setup Example

A setup example of the port 6 synchronous output by the external interrupt 2 (IRQ2) is shown as follows. As it is operated, the initial output data of port 6 is "55", the synchronous output data is "AA", and the rising edge of the IRQ2 is selected at the synchronous event.

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

 

Setup Procedure

Description

 

 

 

(1)

Select the synchronous output

(1) Set the SYOEVS1-0 flag of the FLOAT register

 

event.

 

to "00" to set the synchronous output event to

 

FLOAT (x'3F2E')

the IRQ2.

 

bp1-0

:SYOEVS1-0 = 00

 

(2)

Specify the interrupt edge.

(2) Set the REDG2 flag of the IRQ2ICR register to

 

IRQ2ICR(x'3FE4')

"1" to set the active edge of the IRQ2 at the

 

bp5

: REDG2 = 1

rising edge. Set the EDGSEL2 flag of the

 

EDGDT(x'3F8F')

EDGDT register "0" to select the

 

bp2

: EDGSEL2 = 0

programmable active edge interrupt.

(3)

Set the initial output data.

(3) Set the initial output data "55" to the P6OUT

 

P6OUT(x'3F16')

register. Port 6 outputs "55".

 

bp7-0

: P6OUT7-0 = x'55'

 

(4)

Set the synchronous output pin.

(4) Set port 6 to synchronous output pin by setting

 

P6SYO(x'3F1E')

the P6SYO7-0 flag of the P6SYO register to

 

bp7-0

: P6SYO7-0 = x'FF'

"FF". Select the output mode by setting the

 

P6DIR(x'3F36')

P6DIR7-0 flag of the P6DIR register to "FF".

 

bp7-0

: P6DIR7-0 = x'FF'

 

(5)

Set the synchronous output data.

(5) Set the synchronous output data "AA" to the

 

P6OUT(x'3F16')

P6OUT register.

 

bp7-0

: P6OUT7-0 = x'AA'

 

(6)

Event is generated.

(6) Port 6 outputs "AA" at the rising edge of

 

Rising edge is generated at P22.

IRQ2.

 

 

 

 

IV - 52 Synchronous Output (Port 7)

Page 202
Image 202
Panasonic MN101C77C, F77G user manual Setup Example, IRQ2