DT, that wont work. The output has to reflect the input up to a maximum on time then the output has to be turned off regardless of input state.
Code:
Delay = 1000
Wait4Pulse:
IF !PORTA.0 THEN Wait4Pulse ; Wait for incoming pulse
PORTA.1 = 1 ; Start Output pulse
PAUSEUS Delay ; pause for pulse width *** this will keep the output on for 1000uS, not for the duration of PORTA.0 = 1
PORTA.1 = 0 ; End of Output pulse
Wait4PulseEnd: ; Make sure input pulse is finished
IF PORTA.0 THEN Wait4PulseEnd
GOTO Wait4Pulse
Bookmarks