User manual
LPCXpresso Experiment Kit - User’s Guide
Page 39
Copyright 2013 © Embedded Artists AB
Keep the previously mounted LED. Get a push-button (representing SW2) and a 330 ohm resistor
(representing R31) from the components bag. Note that there are two types of push-buttons; for pcb
mounting and for breadboard mounting. It is the latter that shall be used now. Mount the push-button
and resistor on the breadboard and connect to the LPCXpresso LPC111x board, as illustrated in
Figure 13.
Figure 13 – Breadboard Connections for SW2 and LED
It is common that microcontroller input pins have built-in pull-up resistors. If the input is not driven the
input is high. Sometimes the behavior of the pins is very programmable, for example if pull-up or pull-
down resistors and input hysteresis shall be enabled. In this experiment a pull-up resistor must be
enabled on the input pin. When pressing the push-button it will actively pull the input pin to ground.
Else the internal pull-up resistor will pull the input high.
It is important to check the datasheet how strong the pull-up resistors are so that the external signal
can pull the pin low and vice versa that the built-in pull-up resistor can pull an inactive signal high.
The series resistor is for protection if the (supposedly) input pin is an output. If that output is pulled high
by the microcontroller and the push-button is pressed, the output could be damaged due to excessive
current flowing to ground if a series resistor does not limit the current. The situation is not an imaginary
situation. Suppose there already is an application running on the microcontroller from a previous
experiment. That application might very well use the pin as an output. Before the correct application
has been downloaded the damaged can happen. Therefore it is a good practice to add series resistors
to all signals that can drive a microcontroller pin - the key in this case, which can drive the signal low.
Pin PIO1_5 is controlled by register IOCON_PIO1_5 (check chapter 7 -
LPC1100/LPC1100C/LPC1100L series: I/O configuration in the LPC111x user’s manual). In the
description for this register we can see that there are three alternative pin functions:
- PIO1_5, a general purpose input/output, port #1, pin #5