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 CCS Technical Support

Battery operated device

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







Battery operated device
PostPosted: Thu Oct 01, 2009 4:28 pm     Reply with quote

Hi everyone! I'm designing a battery operated circuit for automotive applications.

Everything is working fine! but... now I have a problem with some cars.

Sometimes, the LCD (displaytronic 16x2) hangs up!, the pic continues working ok, but the display dies!

I think the problem is the ignition noise... or something generating a very big spark. I don't understand why the pic doesn't hang up like the LCD, but its driving me crazy.

Some help please!!! Embarassed
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 01, 2009 6:04 pm     Reply with quote

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=32927

Also see this appnote:

Intel AP-125 -- Designing Microcontroller Systems for Electrically Noisy
Environments:
http://ecee.colorado.edu/~mcclurel/iap125.pdf
Agustina
Guest







PostPosted: Thu Oct 01, 2009 10:42 pm     Reply with quote

I think i designed the pcb with a proper filtering...

the power supply:

9v bat
660uH (in series)
schottky diode (in series)
1000uF to ground
100nF to ground
5v regulator
100uF to ground
100nF to ground (close to pic and LCD)
PIC
LCD

MCLR circuit:


5v----10K----100nf (to ground) ---1k---- MCLR

IO ports:

Every input port have a 100nF cap close to the pin, then 10k pullup, then a 1K resistor (except LCD pins).

Thanks!
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Oct 01, 2009 11:41 pm     Reply with quote

Do I understand right, that your circuit is powered by a 9V battery? Then it's very unlikely, that the problem has anything to do with the power supply.

You should rather think about the paths, that make the circuit susceptible to external interferences. You didn't tell about any external wiring, I guess the circuit has some.

Another interesting point is the wiring between PIC and display. What's the length? Does it have a good ground connection, at best multiple ground wires. A popular fault with alphanumeric LCD displays is to short the display frame to a metallic enclosure.

Even if the LCD display content or programming get's corrupted at times, it can be possibly refreshed by the controller. If you're operating the interface bidirectionally, you're most likely able to detect a display corruption by software and trigger a reinitialization. You have this as a last resort, if you can't overcome the interferences...
Agustina
Guest







PostPosted: Fri Oct 02, 2009 8:11 am     Reply with quote

Hi FvM! thanks for your answer.
answers below:

Quote:
Do I understand right, that your circuit is powered by a 9V battery? Then it's very unlikely, that the problem has anything to do with the power supply.

Yes, the circuit is connected to a 9v battery, and have the option to connected it to car's 12v... but the problem was generated on 9v battery opperation.

Quote:
You should rather think about the paths, that make the circuit susceptible to external interferences. You didn't tell about any external wiring, I guess the circuit has some.

Yes, the circuit has an external cable, but the cable is shielded and the shield connected to ground on the microcontroller side.

Quote:

Another interesting point is the wiring between PIC and display. What's the length? Does it have a good ground connection, at best multiple ground wires. A popular fault with alphanumeric LCD displays is to short the display frame to a metallic enclosure.

The length is very short. The LCD is soldered with pins to the PCB. And the traces to that pins are veeeery short.
I use a plastic enclosure, because here i can't get any metal enclosure...


Quote:
Even if the LCD display content or programming get's corrupted at times, it can be possibly refreshed by the controller. If you're operating the interface bidirectionally, you're most likely able to detect a display corruption by software and trigger a reinitialization. You have this as a last resort, if you can't overcome the interferences...

How can i refresh the LCD? i think im using a bidirectional interface. Im using the CCS library to operate the LCD. I use 4 data pins, E, RW and RS.

thanks for your answer!
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Fri Oct 02, 2009 8:48 am     Reply with quote

Just for a test.
Tie all pins from the LCD also to a sp720 chip.
(including LCD chassis gnd and LCD gnd)

Then, as a separate test, tie 9V battery gnd to car gnd.

I bet the problem will go away.

RE: LCD refresh
Most programs have a main while(1) loop. It loops and loops real fast.
So replace all your update LCD messages with a update of two 16 char arrays. Call them int8 LCD1[16] and int8 LCD2[16].
In your main while(1) loop you then re-init the LCD and then lcd_putc the two arrays. That way each time though the loop the LCD is reset and updated with the current 2 lines.


Last edited by treitmey on Fri Oct 02, 2009 2:37 pm; edited 1 time in total
Agustina
Guest







PostPosted: Fri Oct 02, 2009 9:03 am     Reply with quote

Something that I do often is to connect the chassis LCD to logic gnd, is this a bad thing?


I'll try the rest!

I will keep investigating the problem! if you have another suggestion please post!

Bye! Smile
Guest








PostPosted: Fri Oct 02, 2009 9:29 am     Reply with quote

Hi

Maybe you can post the connection from PIC to LCD, or the better the complete schematic.

If not:

Is there unconnected pin on the LCD, what port on the PIC is it connected to. Because some pin is ST look PIC datascheet.

......
Agustina
Guest







PostPosted: Fri Oct 02, 2009 11:41 am     Reply with quote

hi! I don't have the schematics, sorry, I can try to draw it:

B0 -------- enable
B1 -------- rs
B2 -------- rw
B4 -------- D4
B5 -------- D5
B6 --vvv-- D6
B7 --vvv-- D7

B7 and B6 have a 4k7 resistor.

Vee pin is connected to gnd via a 1k resistor.
Vcc and gnd pins have a 100nf cap.

thanks!
Guest








PostPosted: Fri Oct 02, 2009 1:56 pm     Reply with quote

Why the resistor 4k7 on B6/B7? Are you are using them for ISP. Try move the pin for LCD to other free PIC pin.

Have you checked the port B in the datasheet for ST logic level?

What pic are you using?
Agustina
Guest







PostPosted: Fri Oct 02, 2009 2:28 pm     Reply with quote

I'm using a 18F252.

The resistor is for ICSP, but was used on the original design, now the icsp is replaced by a bootloader.
mskala



Joined: 06 Mar 2007
Posts: 100
Location: Massachusetts, USA

View user's profile Send private message

PostPosted: Sat Oct 03, 2009 7:48 am     Reply with quote

If the problem is related to ignition noise (high-frequency), then your cable
shield should be connected to ground at both ends.
Agustina
Guest







PostPosted: Sat Oct 03, 2009 11:32 am     Reply with quote

The thing is that the cable has a simple switch on the end. I can't connect it to ground.

Could some 5v varistors help? If I connect them on the input pin?

Thanks
Agustina
Guest







PostPosted: Sun Nov 15, 2009 12:23 pm     Reply with quote

Anything? please I really need help, I have tried everything.

Thanks!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 15, 2009 2:16 pm     Reply with quote

If you want help, you will have to post links to a schematic and
a photograph of the device (showing the wiring and the construction).
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