11-4 setup example – Panasonic MN101C77C User Manual

Page 202

Advertising
background image

Chapter 4 I/O Ports

IV - 52

Synchronous Output (Port 7)

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.

4-11-4

Setup Example

Setup Procedure

Description

(1)

Select the synchronous output

event.

FLOAT (x'3F2E')

bp1-0

:SYOEVS1-0 = 00

(2)

Specify the interrupt edge.

IRQ2ICR(x'3FE4')

bp5

: REDG2 = 1

EDGDT(x'3F8F')

bp2

: EDGSEL2 = 0

(3)

Set the initial output data.

P6OUT(x'3F16')

bp7-0

: P6OUT7-0 = x'55'

(4)

Set the synchronous output pin.

P6SYO(x'3F1E')

bp7-0

: P6SYO7-0 = x'FF'

P6DIR(x'3F36')

bp7-0

: P6DIR7-0 = x'FF'

(5)

Set the synchronous output data.

P6OUT(x'3F16')

bp7-0

: P6OUT7-0 = x'AA'

(6)

Event is generated.

Rising edge is generated at P22.

(1)

Set the SYOEVS1-0 flag of the FLOAT register

to "00" to set the synchronous output event to

the IRQ2.

(2)

Set the REDG2 flag of the IRQ2ICR register to

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

rising edge. Set the EDGSEL2 flag of the

EDGDT register "0" to select the

programmable active edge interrupt.

(3)

Set the initial output data "55" to the P6OUT

register. Port 6 outputs "55".

(4)

Set port 6 to synchronous output pin by setting

the P6SYO7-0 flag of the P6SYO register to

"FF". Select the output mode by setting the

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

(5)

Set the synchronous output data "AA" to the

P6OUT register.

(6)

Port 6 outputs "AA" at the rising edge of

IRQ2.

Advertising
This manual is related to the following products: