configure pin and interrupt