ampm var portb.7
trisb=%11111110
Making "ampm" an input.

But then you are writing to "ampm" as an output.


ampm=1