Philips LPC213 Series User Manual page 83

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
8.5.3 Writing to IOSET/IOCLR .vs. IOPIN
Write to IOSET/IOCLR register allows easy change of port's selected output pin(s) to
high/low level at a time. Only pin/bit(s) in IOSET/IOCLR written with 1 will be set to
high/low level, while those written as 0 will remain unaffected. However, by just writing to
either IOSET or IOCLR register it is not possible to instantaneously output arbitrary binary
data containing mixture of 0s and 1s on a GPIO port.
Write to IOPIN register enables instantaneous output of a desired content on a parallel
GPIO. Binary data written into the IOPIN register will affect all output configured pins of
that parallel port: 0s in the IOPIN will produce low level pin outputs and 1s in IOPIN will
produce high level pin outputs. In order to change output of only a group of port's pins,
application must logically AND readout from the IOPIN with mask containing 0s in bits
corresponding to pins that will be changed, and 1s for all others. Finally, this result has to
be logically ORred with the desired content and stored back into the IOPIN register.
Example 2 from above illustrates output of 0xA5 on PORT0 pins 15 to 8 while preserving
all other PORT0 output pins as they were before.
User manual
Rev. 01 — 24 June 2005
UM10120
Chapter 8: GPIO
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
83

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2131Lpc2132Lpc2134Lpc2136Lpc2138

Table of Contents