View previous topic :: View next topic |
Author |
Message |
Agustina Guest
|
Battery operated device |
Posted: Thu Oct 01, 2009 4:28 pm |
|
|
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!!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Agustina Guest
|
|
Posted: Thu Oct 01, 2009 10:42 pm |
|
|
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
|
|
Posted: Thu Oct 01, 2009 11:41 pm |
|
|
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
|
|
Posted: Fri Oct 02, 2009 8:11 am |
|
|
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
|
|
Posted: Fri Oct 02, 2009 8:48 am |
|
|
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
|
|
Posted: Fri Oct 02, 2009 9:03 am |
|
|
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! |
|
|
Guest
|
|
Posted: Fri Oct 02, 2009 9:29 am |
|
|
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
|
|
Posted: Fri Oct 02, 2009 11:41 am |
|
|
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
|
|
Posted: Fri Oct 02, 2009 1:56 pm |
|
|
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
|
|
Posted: Fri Oct 02, 2009 2:28 pm |
|
|
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
|
|
Posted: Sat Oct 03, 2009 7:48 am |
|
|
If the problem is related to ignition noise (high-frequency), then your cable
shield should be connected to ground at both ends. |
|
|
Agustina Guest
|
|
Posted: Sat Oct 03, 2009 11:32 am |
|
|
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
|
|
Posted: Sun Nov 15, 2009 12:23 pm |
|
|
Anything? please I really need help, I have tried everything.
Thanks! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Nov 15, 2009 2:16 pm |
|
|
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). |
|
|
|