beautypg.com

1 port pin example 1: driving outputs on port 0, 2 port pin example 2: receiving inputs on port 1 – Maxim Integrated MAXQ622 User Manual

Page 111

background image

MAXQ612/MAXQ622 User’s Guide

Maxim Integrated

6-9

Bits 5:0: Input/Output Direction for Port 5. The bits in this register control the input/output direction for port pins P5 .0
to P5 .7 . When PD5 .n is set to 0, the corresponding port pin (P5 .n) acts as an input with characteristics determined by
PO5 .n . When PD5 .n is set to 1, the port pin acts as an output, driving the output state given by PO5 .n .

Bits 7:0: Input/Output Direction for Port 6. The bits in this register control the input/output direction for port pins P6 .0
to P6 .7 . When PD6 .n is set to 0, the corresponding port pin (P6 .n) acts as an input with characteristics determined by
PO6 .n . When PD6 .n is set to 1, the port pin acts as an output, driving the output state given by PO6 .n .

6.1.1 Port Pin Example 1: Driving Outputs on Port 0

move PO0, #000h ; Set all outputs low
move PD0, #0FFh ; Set all P0 pins to output mode

6.1.2 Port Pin Example 2: Receiving Inputs on Port 1

move PO1, #0FFh ; Set weak pullups ON on all pins
move PD1, #000h ; Set all P1 pins to input mode
nop

; Wait for external source to drive P1 pins

move Acc, PI1

; Get input values from P1 (will return FF if

; no other source drives the pins low)

Register Name

PD5

Register Description

Port 5 Direction Register

Register Address

M1[11h]

Register Name

PD6

Register Description

Port 6 Direction Register

Register Address

M1[12h]

Bit #

7

6

5

4

3

2

1

0

Name

PD5 .7

PD5 .6

PD5 .5

PD5 .4

PD5 .3

PD5 .2

PD5 .1

PD5 .0

Reset

s

s

s

s

s

s

s

s

Access

rw

rw

rw

rw

rw

rw

rw

rw

Bit #

7

6

5

4

3

2

1

0

Name

PD6 .7

PD6 .6

PD6 .5

PD6 .4

PD6 .3

PD6 .2

PD6 .1

PD6 .0

Reset

s

s

s

s

s

s

s

s

Access

rw

rw

rw

rw

rw

rw

rw

rw

This manual is related to the following products: