2.2.2.10 Port Debounce Initialization

The ports of the ATA8510/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 Table 3-86), allowing key debouncing as well as LIN bus debouncing, for example. 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 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. For more information, see sEEPromDebouncing eepDebounce.

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]