AVR ATtiny1634 - PB3 as Input and Watchdog Timer
Do I have to set this WDTON bit on Hfuse or do I have to do something in my code for activating the watchdog timer as the errata suggests?


You can activate the WDT in your code with...

WDTCSR = _BV(WDIE);

This enables that WDT in interrupt mode. As long as you have interrupts turned off, this should be enough to get your PB3 pin working right.

If want to have interrupts enabled in your code, then you will also need to do something with interrupts that the WDT will start generating on each timeout once enabled. Here is code that will not only enable the WDT in interrupt mode, but will also catch the interrupts with an empty handler....

#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;

EMPTY_INTERRUPT(WDT_vect);

int main(void)
{

    // Enable the WDT in interrupt mode, set the timeout to max (8 seconds)

    WDTCSR = _BV(WDIE) | _BV( WDP3 ) | _BV( WDP0 ) ;

    sei();    

    /* Replace with your application code */
}


Note that we set the WDT timeout to 8 seconds. This is the maximum timeout and will result the fewest superfluous interrupts.