Direct reading of a PORTD bit

I take it by "wiggling" you mean "toggling" :slight_smile: ie 1 becomes 0 and 0 becomes 1

You can do this with an AND operation, because only 1 and 1 = 1 , so as soon as you get a 0 in there, the output will always be 0, it will never flip back to 1 again.

You need an XOR operation eg

PORTD ^= BV(5);

Will flip Bit 5