ANSEL = %00000000 ' Disable Analogue Inputs
I had the same problem the first time I used a 16F88
Oops, just realise that you NEED analogue inputs but disable the ones that are on the Port B pins that you are using
Use ANSEL=%00000001 ' Enable AN0 only
By default the analgue inputs are enabled. To update your LCD display the PortB data register is read, modified and written back to. Because B6 (your relay pin) by default is AN5, this is read as a ZERO rather than the ONE you set it to in your code. This means that when you initially set it it works OK but as soon as the LCD is updated again it gets rewritten as ZERO.
HTH





Bookmarks