Ok problem solved!

It was the ansel register that was not set properly so portA.5 was set as analog and hence not responding to a digital command.

Thank you again.

Alberto