You must switch PortA to digital-I/O, after a Reset it will be only analog-in !
Just see the docs !