Port A often has analog features. Have you tried making it digital?

(Can't view your code of this phone)

Robert