@dc42 I enabled the pullup resistor for the io0.out pin, (and I found out a bad crimping contact for the X endstop... ^^').
Everthing works fine now. Thank you David.