On Thu, 16 Oct 1997 10:11:50 +0100 Brian Jones writes: >work AOK in prototype (although RB1-3 had slightly larger resistors) >but now when I reset by grounding MCLR sometimes the LCD doesn't >reset properly and I only get one line of display reset (I'm using an >old 16*1 line display which is really a 8*2 display so when I get the >problem I only get half the display). It always seems to reset OK if >I do a hard reset (ie temporarily disconnect battery). If the button on MCLR bounces closed again while the LCD initialize routine is running, the LCD may be in a strange condition the next time the PIC tries to initialize it. I think a proper LCD initialize routine can get out of this though (including a delay before starting to allow the LCD to complete whatever the last init was trying to do). Another possible problem is not having enough delay in parts of the initialize routine so the LCD is getting confused. Bouncing on the MCLR line can be largely avoided by putting a large capacitor across the switch, so the PIC only resets once, well after the button is completely released. >What does enabling PORTB for weak pull-ups mean? This turns on a leak of maybe 100 uA between Vdd and the port pins which are set as inputs. The effect is similar to having a pull-up resistor. Pins which aren't connected will rise to Vdd and are guaranteed to read high. Using this feature, it's possible to implement button inputs as just switches to ground (no resistors). You'll still need a pull-up resistor on MCLR though.