Thanks for the answers, that was it. The problem was that the ANSEL register was set to disable the digital input buffer, which caused all reads of that pin to return '0'. What threw me off was that I was thinking of the toggle command is an output function, & since the state of the ANSEL register has no affect on digital output functions, I thought I was OK with that setting. But toggle is really both an output & an input function in that it has to read the state of the pin to be able to change it to the opposite state.
Actually, after considering what SUNFLOWER said, it's not obvious that the toggle command necessarily has to have an input (read) function to it, but evidently it does work that way.
Bookmarks