Public Version
www.ti.com
General-Purpose Interface Basic Programming Model
25.5.5 Debouncing Time
To enable the debounce feature for a pin, the GPIO configuration registers must be programmed as
follows:
1. The GPIO pin must be configured as input in the output-enable register (write 1 to the corresponding
bit of the GPIOi.
register).
2. The deboucing time must be set in the deboucing time register (GPIOi.
The debouncing value register (GPIOi.
) is used to set the debouncing time
for all input lines in GPIO. The value is global for all the ports of one GPIO module, so up to six
different debouncing values are possible. The debounce cell is running with the debounce clock (32
kHz). This register represents the number of the clock cycle(s) (one cycle is 31
m
s long) to be used.
The following formula describes the required input stable time to be propagated to the debounced
output:
Required input line stable = (GPIOi.
[7:0] DEBOUNCVAL bit field value + 1)
x 0.031 ms.
where GPIOi.
[7:0] bit field DEBOUNCVAL value is from 0 to 255.
3. The debouncing feature must be enabled in the debouncing-enable register (write 1 to the
corresponding bit of the GPIOi.
register).
3485
SWPU177N – December 2009 – Revised November 2010
General-Purpose Interface
Copyright © 2009–2010, Texas Instruments Incorporated