The idea was correct, just the port was wrong. PIND
is to be used instead of PORTD
, and it makes sense: it's the input port register, from which the T0 value is taken.
$repeat 1000
PIND=0xFF // Set PORTD high
#800000 // wait 50ms
PIND=0x00 // Set PORTD low
#800000 // wait 50ms
$endrep