CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Hardware or Software (setup) Problem?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

Hardware or Software (setup) Problem?
PostPosted: Sun Dec 26, 2010 9:27 pm     Reply with quote

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
temtronic



Joined: 01 Jul 2010
Posts: 9170
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Dec 26, 2010 9:41 pm     Reply with quote

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?
scottc



Joined: 16 Aug 2010
Posts: 95

View user's profile Send private message

PostPosted: Mon Dec 27, 2010 2:19 am     Reply with quote

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
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Mon Dec 27, 2010 6:55 pm     Reply with quote

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
temtronic



Joined: 01 Jul 2010
Posts: 9170
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 27, 2010 7:32 pm     Reply with quote

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.....
scottc



Joined: 16 Aug 2010
Posts: 95

View user's profile Send private message

PostPosted: Mon Dec 27, 2010 7:51 pm     Reply with quote

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
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Mon Dec 27, 2010 8:07 pm     Reply with quote

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
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Tue Dec 28, 2010 8:59 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group