ANSELA is an 8-bit register... you set it just like any register, 0-255
If you want RA2 to be analog but all others digital then ANSELA = %00000100
You have something very different... ANSELA = PORTA.2, which will read the value of the port pin and assign it to ANSELA (whatever that results in).
Bookmarks