I finally found the solution. You cannot clear PORTA
when I removed the code
'PORTA = %01000000 ' Clear PORTA
It worked on the first 'release from reset'. Now all I need is to indivually clear each bit.