Response of a Josephson junction to a stepped voltage pulse