| |
 |
|
|
Science Forum Index » Electronics - Design Forum » Problem with PIC & LCD display
Page 2 of 2 Goto page Previous 1, 2
|
| Author |
Message |
| Spehro Pefhany |
Posted: Thu May 01, 2008 3:19 pm |
|
|
|
Guest
|
On Thu, 1 May 2008 21:08:07 +0100, Steve H <steveu@spho.demon.co.uk>
wrote:
Quote: In message <gp6k14lkhns618g04kgnh3gdiaiipgsn9p@4ax.com>, Spehro Pefhany
speffSNIP@interlogDOTyou.knowwhat> writes
On Thu, 1 May 2008 17:51:39 +0100, Steve H <steveu@spho.demon.co.uk
wrote:
I'm having a problem with a fairly simple project incorporating a
16F877A PIC and a 4x20 alphanumeric display module. The circuit
interfaces with other logic ICs, though these can be removed from the
circuit to isolate the problem.
The circuit is fed, under test conditions, from a linear 12v power
supply. The 5v regulator on the circuit board is decoupled using 100nf
ceramic capacitors. There is similar decoupling on the PIC itself, and
at other places e.g. decoupling the 5v supply on the connector to the
LCD display. I have also fitted a 100uH coil in the supply to the 5v
regulator to reduce any effects from spurious noise on the supply line.
The problem I'm having difficulty solving is that the display will
intermittently go blank. It will go blank, seemingly when the display is
written to by the PIC, either (a) due to a spike/noise on the mains
supply (this can be intermittently reproduced by repeatedly turning on
and off a piece of mains powered equipment on the same circuit), or (b)
when the 0v rail (not even necessarily close to the LCD display) is
touched by for example a multimeter probe. This is the most consistent
way of producing the fault. The multimeter can be turned off and the
other probe not connected to anything for this to happen. The PIC
doesn't appear to be affected by any of this as it can be shown to still
be operating as expected.
Are you sure it's not resetting?
I'm certain the PIC isn't resetting - the LCD module is going blank but
the PIC continues to function. It appears the intelligent LCD module
locks up/resets itself.
I've experienced similar issues before in my limited experience of
building small projects with PICs. I had issues with a 16F84A resetting
itself when the 0v rail close to the IC was touched with a screwdriver.
Can anybody suggest what vital consideration for circuit design I'm
missing. I'm at a bit of a loss as to what I'm doing wrong.
Thanks.
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers. The unit is part of a gas
sampling multiplexer system.
Is it the solenoids that are mucking things up?
Quote: Currently, a lot of the circuitry is disconnected - there are 3
individual PCBs (etched boards). It's working in a bare-bones sort of
state at the moment, pretty much the PIC and display only
Lash-ups tend to be more sensitive to EMI.
Quote: An earlier version of the device, identical but utilising in place of
the 16F877A/LCD a pair of 16F84As and driving a 2 x 7segment LED
display, has worked in the field flawlessly for 3 years.
Best regards,
Spehro Pefhany
Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com |
|
|
| Back to top |
|
| Steve H |
Posted: Thu May 01, 2008 3:35 pm |
|
|
|
Guest
|
In message <nc9k14l01uogp0gptq4rgqldglvjkn17nt@4ax.com>, Spehro Pefhany
<speffSNIP@interlogDOTyou.knowwhat> writes
Quote: On Thu, 1 May 2008 21:08:07 +0100, Steve H <steveu@spho.demon.co.uk
wrote:
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers. The unit is part of a gas
sampling multiplexer system.
Is it the solenoids that are mucking things up?
No, I should have pointed out that the solenoids are not operating in
the state I'm testing it in. They will be either disconnected or a pair
of them will energise at power-up and remain in that state throughout,
depending on which bits of the unit I have plugged together.
Quote:
Currently, a lot of the circuitry is disconnected - there are 3
individual PCBs (etched boards). It's working in a bare-bones sort of
state at the moment, pretty much the PIC and display only
Lash-ups tend to be more sensitive to EMI.
I know what you mean, though with this project there are 3 boards
connected via ribbon cables. I can disconnect the output logic and
solenoid circuitry by disconnecting the ribbon connectors on the control
board. It is thus a reasonably 'clean' way to run only the control
board.
Quote:
An earlier version of the device, identical but utilising in place of
the 16F877A/LCD a pair of 16F84As and driving a 2 x 7segment LED
display, has worked in the field flawlessly for 3 years.
Best regards,
Spehro Pefhany
Best regards,
Spehro Pefhany
--
Steve H |
|
|
| Back to top |
|
| Eeyore |
Posted: Thu May 01, 2008 3:36 pm |
|
|
|
Guest
|
Steve H wrote:
Quote: I'm having a problem with a fairly simple project incorporating a
16F877A PIC and a 4x20 alphanumeric display module. The circuit
interfaces with other logic ICs, though these can be removed from the
circuit to isolate the problem.
The circuit is fed, under test conditions, from a linear 12v power
supply. The 5v regulator
Is it a low drop-out type ?
Quote: on the circuit board is decoupled using 100nf ceramic capacitors.
On both input and output ?
Quote: There is similar decoupling on the PIC itself, and
at other places e.g. decoupling the 5v supply on the connector to the
LCD display. I have also fitted a 100uH coil in the supply to the 5v
regulator to reduce any effects from spurious noise on the supply line.
The problem I'm having difficulty solving is that the display will
intermittently go blank. It will go blank, seemingly when the display is
written to by the PIC, either (a) due to a spike/noise on the mains
supply (this can be intermittently reproduced by repeatedly turning on
and off a piece of mains powered equipment on the same circuit),
So you have a problem with noise coupling through your power supply.
Quote: or (b) when the 0v rail (not even necessarily close to the LCD display) is
touched by for example a multimeter probe. This is the most consistent
way of producing the fault.
This may conceivably be due to electrostatic discharge.
Quote: The multimeter can be turned off and the
other probe not connected to anything for this to happen. The PIC
doesn't appear to be affected by any of this as it can be shown to still
be operating as expected.
You're SURE it's operating correctly aside from the LCD display ? How have
you determined this ?
Quote: I've experienced similar issues before in my limited experience of
building small projects with PICs. I had issues with a 16F84A resetting
itself when the 0v rail close to the IC was touched with a screwdriver.
Can anybody suggest what vital consideration for circuit design I'm
missing. I'm at a bit of a loss as to what I'm doing wrong.
You should consider adding some 'bulk capacitance - say 100+ uF on the 5V
rail to ground). Also make sure your grounding methodology is 'clean'.
Graham |
|
|
| Back to top |
|
| Eeyore |
Posted: Thu May 01, 2008 3:39 pm |
|
|
|
Guest
|
Steve H wrote:
Quote: The commercial linear PSU, I'm guessing, would have a filtered input.
Why would you guess that ?
Guesswork is often where the problem lies. Just try an AC line filter anyway.
Graham |
|
|
| Back to top |
|
| Eeyore |
Posted: Thu May 01, 2008 3:43 pm |
|
|
|
Guest
|
Steve H wrote:
Quote: Spehro Pefhany writes
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers.
Is the PIC driving the LCD segments directly or does the display have an
onboard controller ?
Another thought btw, add a suitable transorb / TVS across the 5V rails to see
if it helps any. Or even and/or across the 12V input to the 5V regulator.
Graham |
|
|
| Back to top |
|
| Steve H |
Posted: Thu May 01, 2008 4:02 pm |
|
|
|
Guest
|
In message <481A29C7.1B24D010@hotmail.com>, Eeyore
<rabbitsfriendsandrelations@hotmail.com> writes
Quote:
Steve H wrote:
I'm having a problem with a fairly simple project incorporating a
16F877A PIC and a 4x20 alphanumeric display module. The circuit
interfaces with other logic ICs, though these can be removed from the
circuit to isolate the problem.
The circuit is fed, under test conditions, from a linear 12v power
supply. The 5v regulator
Is it a low drop-out type ?
It's a 7805
Quote:
on the circuit board is decoupled using 100nf ceramic capacitors.
On both input and output ?
Yes.
Quote:
There is similar decoupling on the PIC itself, and
at other places e.g. decoupling the 5v supply on the connector to the
LCD display. I have also fitted a 100uH coil in the supply to the 5v
regulator to reduce any effects from spurious noise on the supply line.
The problem I'm having difficulty solving is that the display will
intermittently go blank. It will go blank, seemingly when the display is
written to by the PIC, either (a) due to a spike/noise on the mains
supply (this can be intermittently reproduced by repeatedly turning on
and off a piece of mains powered equipment on the same circuit),
So you have a problem with noise coupling through your power supply.
Quite possibly, yes.
Quote:
or (b) when the 0v rail (not even necessarily close to the LCD display) is
touched by for example a multimeter probe. This is the most consistent
way of producing the fault.
This may conceivably be due to electrostatic discharge.
The multimeter can be turned off and the
other probe not connected to anything for this to happen. The PIC
doesn't appear to be affected by any of this as it can be shown to still
be operating as expected.
You're SURE it's operating correctly aside from the LCD display ? How have
you determined this ?
The operation of an LED backlight via a pin of the PIC is still
functioning in a way it wouldn't do if the PIC had either locked up or
reset, indicating the main body of the program and internal hardware
interrupt routine are still working. The data being written twice a
second to the (now blank) LCD module can also be seen on the scope.
Quote:
I've experienced similar issues before in my limited experience of
building small projects with PICs. I had issues with a 16F84A resetting
itself when the 0v rail close to the IC was touched with a screwdriver.
Can anybody suggest what vital consideration for circuit design I'm
missing. I'm at a bit of a loss as to what I'm doing wrong.
You should consider adding some 'bulk capacitance - say 100+ uF on the 5V
rail to ground). Also make sure your grounding methodology is 'clean'.
There is a 47uf electrolytic between 5v and ground. Other aspects of the
design need to be re-checked.
--
Steve H |
|
|
| Back to top |
|
| Steve H |
Posted: Thu May 01, 2008 4:03 pm |
|
|
|
Guest
|
In message <481A2A6E.CDCEF6A2@hotmail.com>, Eeyore
<rabbitsfriendsandrelations@hotmail.com> writes
Quote:
Steve H wrote:
The commercial linear PSU, I'm guessing, would have a filtered input.
Why would you guess that ?
Guesswork is often where the problem lies. Just try an AC line filter anyway.
You're absolutely correct. There's quite possibly no filter on it at
all.
--
Steve H |
|
|
| Back to top |
|
| Steve H |
Posted: Thu May 01, 2008 4:14 pm |
|
|
|
Guest
|
In message <481A2B69.3F600857@hotmail.com>, Eeyore
<rabbitsfriendsandrelations@hotmail.com> writes
Quote:
Steve H wrote:
Spehro Pefhany writes
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers.
Is the PIC driving the LCD segments directly or does the display have an
onboard controller ?
It's an intelligent display module, requiring 4 data bits and 3 control
lines in addition to the supply. It's updated by the PIC twice a second.
Quote:
Another thought btw, add a suitable transorb / TVS across the 5V rails to see
if it helps any. Or even and/or across the 12V input to the 5V regulator.
Graham
--
Steve H |
|
|
| Back to top |
|
| mpm |
Posted: Thu May 01, 2008 4:23 pm |
|
|
|
Guest
|
On May 1, 6:33�pm, Steve H <ste...@spho.demon.co.uk> wrote:
Hey. Read all the posts....
My experience with character LCD's (in general) is that they are
pretty forgiving and robust. Most folks have trouble getting them
going, especially in 4-bit mode, because they try to read the busy
flag before the device is fully initialized.
So, my advice is: double-check your timings, even though it seems to
"work" as you have it. Doesn't take that long. Start with the
basics...
Another possibility (not sure if already mentioned), check your solder
joints. Could be a bad joint.
Otherwise, yes, I'd have to agree you either have a bum display (have
you tried replacements?), OR there's some glitch on the power rails.
I'm a little curious what your R/S, R/W and E lines are at (or
supposed to be at?) when this problem manifests. If you're not
writing to the display, then trash on the inputs should not even
matter! That leaves only the strobe (again, should not matter in read
mode), and the power rails.
I'm also wondering if the backlight has anything to do with this? I
assume from your write-up that the display will go blank even if the
backlight is not instructed ON.?
One more thing you might try: Slow everything down in software.
Maybe the LCD is working correctly, and it's the PIC that's telling it
to clear in response to whatever it is that you're doing to cause the
problem to appear? In other words, not the display directly, but
indirectly via the PIC.
Insert a couple million NOP's in the strobe routine ought to tell you
that real quick.
Good luck.!!
-mpm |
|
|
| Back to top |
|
| john jardine |
Posted: Thu May 01, 2008 4:36 pm |
|
|
|
Guest
|
"Steve H" <steveu@spho.demon.co.uk> wrote in message
news:U2XXPnJnMiGIFwLP@spho.demon.co.uk...
Quote: In message <gp6k14lkhns618g04kgnh3gdiaiipgsn9p@4ax.com>, Spehro Pefhany
speffSNIP@interlogDOTyou.knowwhat> writes
On Thu, 1 May 2008 17:51:39 +0100, Steve H <steveu@spho.demon.co.uk
wrote:
I'm having a problem with a fairly simple project incorporating a
16F877A PIC and a 4x20 alphanumeric display module. The circuit
interfaces with other logic ICs, though these can be removed from the
circuit to isolate the problem.
The circuit is fed, under test conditions, from a linear 12v power
supply. The 5v regulator on the circuit board is decoupled using 100nf
ceramic capacitors. There is similar decoupling on the PIC itself, and
at other places e.g. decoupling the 5v supply on the connector to the
LCD display. I have also fitted a 100uH coil in the supply to the 5v
regulator to reduce any effects from spurious noise on the supply line.
The problem I'm having difficulty solving is that the display will
intermittently go blank. It will go blank, seemingly when the display is
written to by the PIC, either (a) due to a spike/noise on the mains
supply (this can be intermittently reproduced by repeatedly turning on
and off a piece of mains powered equipment on the same circuit), or (b)
when the 0v rail (not even necessarily close to the LCD display) is
touched by for example a multimeter probe. This is the most consistent
way of producing the fault. The multimeter can be turned off and the
other probe not connected to anything for this to happen. The PIC
doesn't appear to be affected by any of this as it can be shown to still
be operating as expected.
Are you sure it's not resetting?
I'm certain the PIC isn't resetting - the LCD module is going blank but
the PIC continues to function. It appears the intelligent LCD module
locks up/resets itself.
I've experienced similar issues before in my limited experience of
building small projects with PICs. I had issues with a 16F84A resetting
itself when the 0v rail close to the IC was touched with a screwdriver.
Can anybody suggest what vital consideration for circuit design I'm
missing. I'm at a bit of a loss as to what I'm doing wrong.
Thanks.
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers. The unit is part of a gas
sampling multiplexer system.
Currently, a lot of the circuitry is disconnected - there are 3
individual PCBs (etched boards). It's working in a bare-bones sort of
state at the moment, pretty much the PIC and display only
An earlier version of the device, identical but utilising in place of
the 16F877A/LCD a pair of 16F84As and driving a 2 x 7segment LED
display, has worked in the field flawlessly for 3 years.
Best regards,
Spehro Pefhany
--
Steve H
[using '877's]
A few weeks ago had a bad batch of brand new 4 line displays. Same problem
as you're seeing. Sourced from another supplier, fine.
Recently did a display (nibble mode) on the end of 1mtr of 'separate wires'
loom, no problem.
I'd also not trust that reset pin. I usually add 100k and 10uF to allow a
defined external reset some time after power up. The cap also kills any dirt
subsequently turning up at the pin.
Rather then lose benefit of a long reset time I will take the trouble to add
a number of extra hardware components to define the state of critical
control lines during the power up reset period. |
|
|
| Back to top |
|
| Eeyore |
Posted: Thu May 01, 2008 5:10 pm |
|
|
|
Guest
|
Steve H wrote:
Quote: Eeyore writes
Steve H wrote:
The commercial linear PSU, I'm guessing, would have a filtered input.
Why would you guess that ?
Guesswork is often where the problem lies. Just try an AC line filter anyway.
You're absolutely correct. There's quite possibly no filter on it at
all.
I'd be VERY surprised if it did have one.
Graham |
|
|
| Back to top |
|
| Eeyore |
Posted: Thu May 01, 2008 5:12 pm |
|
|
|
Guest
|
Steve H wrote:
Quote: Eeyore wrote:
Steve H wrote:
Spehro Pefhany writes
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers.
Is the PIC driving the LCD segments directly or does the display have an
onboard controller ?
It's an intelligent display module, requiring 4 data bits and 3 control
lines in addition to the supply. It's updated by the PIC twice a second.
Sounds to me like you're 'crashing' the LCD module's internal controller then.
Does it have local decoupling on the power lines at the module end and what have
you done to avoid EMI on the data and control lines ?
Graham |
|
|
| Back to top |
|
| Steve H |
Posted: Thu May 01, 2008 5:33 pm |
|
|
|
Guest
|
In message <481A4045.7FD6E426@hotmail.com>, Eeyore
<rabbitsfriendsandrelations@hotmail.com> writes
Quote:
Steve H wrote:
Eeyore wrote:
Steve H wrote:
Spehro Pefhany writes
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers.
Is the PIC driving the LCD segments directly or does the display have an
onboard controller ?
It's an intelligent display module, requiring 4 data bits and 3 control
lines in addition to the supply. It's updated by the PIC twice a second.
Sounds to me like you're 'crashing' the LCD module's internal controller then.
Does it have local decoupling on the power lines at the module end and
what have
you done to avoid EMI on the data and control lines ?
I added a 100nf cap across the supply at the module end, and also tried
it with a 47uf electrolytic in parallel. The data and control lines are
approx 30cm long, plain wires with no shielding. I'm led to believe this
is a fairly standard arrangement that should work, but am open to
suggestions.
--
Steve H |
|
|
| Back to top |
|
| Eeyore |
Posted: Thu May 01, 2008 6:22 pm |
|
|
|
Guest
|
Steve H wrote:
Quote: Eeyore writes
Steve H wrote:
Eeyore wrote:
Steve H wrote:
Spehro Pefhany writes
What else EXACTLY is this PIC circuit connected to (off board in
particular)? How long is the cable to the LCD display? What kind of
equipment is this? Can you link to a photo? Is it a proper PCB or a
plugboard?
Have no photo to hand and the equipment isn't with me just now. Fully
assembled it comprises the PIC with LCD, 4 control buttons and several
logic inputs/outputs, four of which control 4 to 16-line latches that
switch solenoids via darlington drivers.
Is the PIC driving the LCD segments directly or does the display have an
onboard controller ?
It's an intelligent display module, requiring 4 data bits and 3 control
lines in addition to the supply. It's updated by the PIC twice a second.
Sounds to me like you're 'crashing' the LCD module's internal controller then.
Does it have local decoupling on the power lines at the module end and
what have
you done to avoid EMI on the data and control lines ?
I added a 100nf cap across the supply at the module end, and also tried
it with a 47uf electrolytic in parallel.
Ok.
Quote: The data and control lines are
approx 30cm long, plain wires with no shielding. I'm led to believe this
is a fairly standard arrangement that should work, but am open to
suggestions.
Depends on the environment. Since you have relays switching some kinds of loads you
may need to apply some basic EMI suppresion. Relays can be horribly electrically
noisy. There are some serious implications for pcb (and protoboard) layout there
too.
Graham |
|
|
| Back to top |
|
| rebel |
Posted: Thu May 01, 2008 7:20 pm |
|
|
|
Guest
|
Have you actually tried connecting the 0V rail directly to the GROUND of the
linear PSU? |
|
|
| Back to top |
|
| |
Page 2 of 2 Goto page Previous 1, 2
All times are GMT - 5 Hours
The time now is Sun Jul 20, 2008 5:49 am
|
|