View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
Hardware or Software (setup) Problem? |
Posted: Sun Dec 26, 2010 9:27 pm |
|
|
18F6627
3.249
I'm using a MIC2514 http://www.micrel.com/_PDF/mic2514.pdf as a high side switch to power on and off a serial LCD module. I'm using pin F0 to drive the MOSFET (switch). When I set the pin to low the MOSFET doesn't shut completely off. On a 3.3V supply, I end up with about 1.9V when off. I have noticed that when the PIC is in RESET the MOSFET is completely off.
I have tried several driving configurations with no avail. Direct, pulled down, etc.
Can anyone offer any ideas?
Thanks,
John |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9170 Location: Greensville,Ontario
|
|
Posted: Sun Dec 26, 2010 9:41 pm |
|
|
Silly things that come to mind, that you've probably already thought of..
1) does the switch work without the PIC. IE , +3 in turns on LCD, gnd, powers it down...
2) some internal peripheral NOT disabled in your code,maybe due to an included file, or wrong definition ??
3) does it work with just an LED or two instead of the LCD ?? Might be a 'quirk' of the LCD module? |
|
![](templates/subSilver/images/spacer.gif) |
scottc
Joined: 16 Aug 2010 Posts: 95
|
|
Posted: Mon Dec 27, 2010 2:19 am |
|
|
Is the pin on the pic really Low when its set low. What sort of
DC voltage is on the pin.
I have never used that part, but have used the following part for
LCD backlight switching among other things. FDS8817NZ
If the Micrel part is on a PCB, lift the input pin and jumper it
to ground. Does the LCD light up ?. If it does then the part is toast.
Thanks Scott |
|
![](templates/subSilver/images/spacer.gif) |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Mon Dec 27, 2010 6:55 pm |
|
|
The Plot Thickens....
First, a little more information. The LCD is a serial enabled module that has a PIC piggyback board that drives it. So, the module only has three connections: Pwr, Gnd and Data. I use this setup primarily to save pins on my PIC and also for debugging output while developing.
As I was working through Scott and Temtronic's suggestions and noticed a few things. The switch worked normally for the LED. The 'failure' of the 'switch' always happened at the same time after power-up, about 260mS. Then it hit me, I bet the switch fails when the software UART is setup and the DATA line goes high. That was it.
So, for some reason, when the input on the piggyback PIC is driven high when off, it causes the switch to fail.
That begs two questions.
1. Hardware wise, what is happening on the piggyback PIC by driving a pin high when it is off?
2. How do I enable and disable the software UART at run time to only allow the data line to idle high after the LCD is turned on?
Thanks guys for the help,
John |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9170 Location: Greensville,Ontario
|
|
Posted: Mon Dec 27, 2010 7:32 pm |
|
|
Sounds like the PIC on the LCD module is going into 'lala land' by not powering up properly, maybe 'backdriven' by the serial input pin before the Vcc line is stabilized?
Might try adding a 10mfd cap on the LCD Vcc line ?
Sequence the VCC and data lines to the LCD module with a small time delay ? Maybe high on data(idle), wait 1/2 second, powerup LCD, wait 1 second, then see if all is OK?
Consult the LCD module info for power sequencing, power requirements?
Hmm..any LED backlighting on the module?
Is your power supply got enough 'guts'? I like 1 Amp minimum,1000mfd cap to keep it stable.
Let us know what happens..... |
|
![](templates/subSilver/images/spacer.gif) |
scottc
Joined: 16 Aug 2010 Posts: 95
|
|
Posted: Mon Dec 27, 2010 7:51 pm |
|
|
I wonder are port enabled Pullups enabled on the pic ?
try port_a_pullups(FALSE);
where a is the port number that the pin to the switch is on.
If thats not it, I would try setting the pin to a value of 0 at the
start of main.
Does pin F0 share any other function like an A to D ?
Thanks Scott |
|
![](templates/subSilver/images/spacer.gif) |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Mon Dec 27, 2010 8:07 pm |
|
|
I haven't confirmed it yet, but I'm thinking that the voltage I'm seeing on the Pwr pin is probably not coming via the switch. I bet it is being fed through the PIC via the Data pin idling high.
I had thought there might have been pullups and that may have been part of the problem. But, it appears port B is the only one that has pull ups.
I think the solution is to:
Have the Data pin low whenever the LCD is powered down and the sequencing needs to be:
Powerup LCD
Enable software UART (allow Data to idle high)
Use LCD
Disable software UART
Powerdown LCD
John |
|
![](templates/subSilver/images/spacer.gif) |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Tue Dec 28, 2010 8:59 am |
|
|
I am trying to figure out the best way to keep the TX line from idling high when not using a software UART. I'm not with the hardware right now so I can't test my ideas.
I could declare two different streams, one with INVERT and call that stream to force the TX low. But would it persist until I called the next non-inverted stream?
Or, can I just output_low() the TX pin when not using the software UART?
Thanks,
John |
|
![](templates/subSilver/images/spacer.gif) |
|