BCM1250/BCM1125/BCM1125H
User Manual
10/21/02
B r o a d c o m C o r p o r a t i o n
Page
396
Section 13: GPIO
Document
1250_1125-UM100CB-R
S e c t i o n 1 3 : G P I O
I
NTRODUCTION
The part has a number of pins that are available for general use as inputs, outputs or interrupt inputs. These
pins are controlled entirely by software. In addition, there are a number of pins allocated to other peripherals
that may be used as general pins if the peripheral is not required.
T
HE
GPIO P
INS
The GPIO pins can be configured for use as either inputs or outputs, and can be set to raise an interrupt. A
single GPIO pin is shown in
.
Figure 82: Single GPIO Pin Diagram
The
gpio_direction
register sets the direction of each pin individually, bits in it should be set to enable the
output buffer. When used as outputs (shown in the bottom of the figure) the CPU sets and clears bits in the
output latch by writing 1s to the
gpio_pin_set
or
gpio_pin_clr
registers, and the pin will change state. The
output register retains its state even when the line is configured as an input, so if an "open collector" output is
required the output register only needs to be set low once and the direction of the pin can be changed from
output (to pull low) to input (to float).
The input path is always active. An optional inverter is enabled by setting the corresponding bit in the
gpio_input_invert
register. The 100MHz reference clock is used to synchronize the signal to the internal logic
and to provide filtering against glitches. By default the line has to change state for about 60ns before being
recognized (a 60ns glitch filter), but the filter may be increased to provide a 1 ms glitch filter. The state of the
gpio pin (after inversion and the glitch filtering) is readable from the
gpio_read
register.
GlitchFilter
60 ns
or 1 ms
S
R
gpio_input_invert[n]
gpio_int_type[n=0,2,4,6,8,10,12,14]
gpio_int [n]
Bit [n] set in write to gpio_clr_edge
gpio_read [n]
Bit [n] set in write to gpio_pin_set
Bit [n] set in write to gpio_pin_clr
gpio_direction[n] set
and pin used
for GPIO
Pin
Rising
Edge
Detect
clr
0
1
gpio_glitch[n]
0 - 60 ns filter
1 - 1ms filter
gpio_int_type[n+1]
gpio_int_type[n=0,2,4,6,8,10,12,14] or ~ gpio_int_type[n=1,3,5,7,9,11,13,15]