3.2.2.10 Port Debounce Initialization

The ports of the ATA8210/15 feature hardware debouncing that can be used to avoid false events coming from bouncing mechanical switches or bus glitches. A common debounce timer is used for all ports. The debouncing can be activated and deactivated independently on every digital I/O port. The debouncing time is configurable in the range of approximately 2 µs to 250 ms. See Debounce Timing Ranges in the DBTC from Related Links. For example, allowing key debouncing as well as LIN bus debouncing. A level change on any port with activated debouncing resets the debounce timer.

There are two modes for debouncing: fast mode and stable mode. In stable mode, a port event is transmitted to the AVR only if the selected ports are stable (unchanged) for the configured debouncing time and the port values are not the same as the values before the first change. In fast mode, a port event is transmitted to the AVR immediately. All the following events are ignored for the configured debouncing time.

If debouncing is selected for any pin, the only allowed sleep mode is “idle”. Other combinations are forbidden.

The firmware initializes the debounce configuration according to the settings in the EEPROM variable eepDebounce. See sEEPromDebouncing eepDebounce from Related Links.

Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
0x0263 DBCR DBTMS DBCS DBMD
0x0264 DBTC DBTC[7:0]
0x0265 DBENB DBENB[7:0]
0x0266 DBENC DBENC[7:0]