3-4 setup example – Panasonic MN101C77C User Manual

Page 365

Advertising
background image

XI - 39

Chapter 11 Serial Interface 0, 1

Operation

11-3-4

Setup Example

„

Transmission / Reception Setup Example

The setup example for clock synchronous serial communication with serial 0 is shown. Table 11-3-16

shows the conditions at transmission / reception.

Table 11-3-16 Setup Examples for Synchronous Serial Interface Transmission / Reception

Setup Procedure

Description

(1)

Select the prescaler operation.

PSCMD (x'3F6F')

bp0 : PSCEN = 1

(2)

Select the clock source.

SC0CKS (x'3F97')

bp2-0 : SC0PSC2-0 = 100

(3)

Select the used pin.

SC0ODC (x'3F96')

bp7 : SC0SEL = 0

(4)

Control the pin type.

SC0ODC (x'3F96')

bp1-0 : SC0ODC1-0 = 11

P0PLU (x'3F40')

bp5, 3 : P0PLU5, 3 = 1, 1

(5)

Control the pin direction.

P0DIR (x'3F30')

bp5-3 : P0DIR5-3 = 101

(1)

Set the PSCEN flag of the PSCMD register to

"1" to select "prescaler operation".

(2)

Select the clcok source by the SC0CKS

register.

Set bp4-0 to "0100" to select "fs/2".

(2)

Set the SC0SEL flag of the SC0ODC register to

"0" to set I/O used pin to A (port 0).

(4)

Set the SC0ODC1-0 flag of the SC0ODC

register to "11" to select "N-ch open drain" to

the SBO/SBT pin. Set the P0PLU5, 3 flag of

the P0PLU register to "1" to add pull-up

resistor.

5)

Set the P0DIR5-3 flag of the port 0 pin

direction control register (P0DIR) to "101" to set

P03, P05 "output mode", and to set P04 "input

mode".

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

Setup item

s et to

Setup item

s et to

SBI / SBO pin

Independent

Clock s ource

fs /2

(with 3 channels )

Trans fer bit count

8 bits

Us ed pin

A (port 0)

Start condition

none

Clock s ource 1/8 dividing

divided by 8

Firs t transfer bit

MSB

SBT / SBO pin style

Nch open-drain

Input clock edge

falling edge

SBT pin pull-up res is tor

Added

Output clock edge

rising edge

SBO pin pull-up resis tor

Added

Clock

Internal clock

Serial 1 com m unication

Enable

com plete interrupt

Advertising
This manual is related to the following products: