I am driving the Vdd for my GLCD with a pin on my PIC16F1519 at 5V and switching Vee (Vo) with another pin. Both pins are PortE, which also has MCLR on it. I go through a start-up sequence and shut-down sequence for Vdd and Vee (Vo).
Without the GLCD attached, the switching works perfectly. With the GLCD attached (PortB for data; PortD for controls), the sequence works fine at start-up. At shut down, Vdd hangs at approvimately 2.88V and Vo goes slightly positive. An indicator LED on RD1 (PortD,1) works as expected. I have tried PortA for the pins, with similar results, except at shut down there was a lot of noise on the Vdd line. PortE is Schmitt trigger; PortA is not. The GLCD "program" is just the initialization routine from Pommie. If I reset with MCLR, everything works just as I wanted.
Here is the code for turn-off:
The manipulation to LatE was added to avoid read-modify-write problems. I also tried doing a corresponding move instruction with PortE. Those failed attempts were based on a short article by Michael Rigby-Jones on PicList. Basically, his message is that "mov" instructions do not go through the read-modify-right sequence.
What puzzles me most is the 2.88V seen on the Vdd after shutdown. That voltage was measured with an oscilloscope and is steady. My next step is to add a P-mosfet switch between the MCU pin for Vdd and the GLCD.
BTW, movlb is a new instruction to switch banks in the enhanced mid-range series.
Regards,
John
Without the GLCD attached, the switching works perfectly. With the GLCD attached (PortB for data; PortD for controls), the sequence works fine at start-up. At shut down, Vdd hangs at approvimately 2.88V and Vo goes slightly positive. An indicator LED on RD1 (PortD,1) works as expected. I have tried PortA for the pins, with similar results, except at shut down there was a lot of noise on the Vdd line. PortE is Schmitt trigger; PortA is not. The GLCD "program" is just the initialization routine from Pommie. If I reset with MCLR, everything works just as I wanted.
Here is the code for turn-off:
Code:
Turn_OFF
BCF b_Toggle
BCF b_ON_OFF ;clear ON flag
BSF b_LCD_Vo ;turn off MAX851_high = off
DelayCy (100*msecs) ;wait for Vo to rise
DelayCy (100*msecs) ;366mS needed at -4.139V
DelayCy (100*msecs)
DelayCy (100*msecs)
BCF b_LCD_VDD ;turn off display VDD
BCF b_LED ;turn off indicator LED, safe to disconnect
banksel latE
movlw 0x09
movwf latE
movlb 0x00
GOTO LCD_Power ;
The manipulation to LatE was added to avoid read-modify-write problems. I also tried doing a corresponding move instruction with PortE. Those failed attempts were based on a short article by Michael Rigby-Jones on PicList. Basically, his message is that "mov" instructions do not go through the read-modify-right sequence.
What puzzles me most is the 2.88V seen on the Vdd after shutdown. That voltage was measured with an oscilloscope and is steady. My next step is to add a P-mosfet switch between the MCU pin for Vdd and the GLCD.
BTW, movlb is a new instruction to switch banks in the enhanced mid-range series.
Regards,
John
Last edited: