English
Language : 

SAM7X128_14 Datasheet, PDF (226/662 Pages) ATMEL Corporation – ARM-based Flash MCU
27.5
I/O Lines Programming Example
The programing example as shown in Table 27-1 below is used to define the following configuration.
 4-bit output port on I/O lines 0 to 3, (should be written in a single write operation), open-drain, with pull-up resistor
 Four output signals on I/O lines 4 to 7 (to drive LEDs for example), driven high and low, no pull-up resistor
 Four input signals on I/O lines 8 to 11 (to read push-button states for example), with pull-up resistors, glitch filters
and input change interrupts
 Four input signals on I/O line 12 to 15 to read an external device status (polled, thus no input change interrupt), no
pull-up resistor, no glitch filter
 I/O lines 16 to 19 assigned to peripheral A functions with pull-up resistor
 I/O lines 20 to 23 assigned to peripheral B functions, no pull-up resistor
 I/O line 24 to 27 assigned to peripheral A with Input Change Interrupt and pull-up resistor
Table 27-1. Programming Example
Register
PIO_PER
PIO_PDR
PIO_OER
PIO_ODR
PIO_IFER
PIO_IFDR
PIO_SODR
PIO_CODR
PIO_IER
PIO_IDR
PIO_MDER
PIO_MDDR
PIO_PUDR
PIO_PUER
PIO_ASR
PIO_BSR
PIO_OWER
PIO_OWDR
Value to be Written
0x0000 FFFF
0x0FFF 0000
0x0000 00FF
0x0FFF FF00
0x0000 0F00
0x0FFF F0FF
0x0000 0000
0x0FFF FFFF
0x0F00 0F00
0x00FF F0FF
0x0000 000F
0x0FFF FFF0
0x00F0 00F0
0x0F0F FF0F
0x0F0F 0000
0x00F0 0000
0x0000 000F
0x0FFF FFF0
SAM7X Series [DATASHEET]
6120K–ATARM–11-Feb-14
226