Darrel,
Thanks for the reply.
After I spent the better part of a day trying to figure out what I was doing wrong in software, I finally realized just what you spotted about the LCD drive signals - double duh on my part! I was about to post that I found the problem, but you beat me to the punch.
In my production code however, I had the comparator mux set up so the offending LCD drive signal was deselected (or so I thought), so I'm a bit puzzled about why it affected the comparator. Anyway, moving E and RS to another port fixed it.
The code snippet that I posted was actually a piece of test code I wrote just for this post to illustrate that just turning on the comparator causes the problem. Obviously I rushed and didn't check some of the other things you spotted. In my actual production code, everything is as you suggest it should be, except the LCD "Dbit" specifier. It actually works with a "1" instead of a "4", so I suspect that anything other that a "0" will work similarly - I'll check.
Thanks for being so thorough. Sometimes another set of eyeballs locks right in on a problem that might have eluded one for hours.
Joe
Bookmarks