Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 02:20:14 02:20


Login with username, password and session length


Pages: [1]
Print
Author Topic: problem with strange text on lcd  (Read 4182 times)
0 Members and 1 Guest are viewing this topic.
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« on: April 18, 2008, 05:17:47 17:17 »

i have a problem with a lcd (44780 compatible)
some times i see a strange text on my 2*16 lcd (when  i activate a power contactor)
when i renitialise my mcu the problem  go and it return when i activate a power contactor
the solution is to reinitialise the lcd without restarting the mcu
i use bascom avr ,i know there are "initlcd" but the mcu restart with.
my hardware connetion is good (rw ,gnd)



a part of my program:
$regfile = "m32def.dat"
    $crystal = 4000000
$hwstack = 32                                               
$swstack = 10                                               
$framesize = 40
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.5 , Db6 = Portd.4 , Db7 = Portd.3 , E = Portd.7 , Rs =

Portc.0
Config Lcd = 16 * 2
Cursor Off Noblink
Cls
Logged
FriskyFerret
Hero Member
*****
Offline Offline

Posts: 560

Thank You
-Given: 513
-Receive: 360


Put it in, take it out.


WWW
« Reply #1 on: April 18, 2008, 06:44:26 18:44 »

In the real hardware or in the simulator? The picture you provided is of a Proteus schematic.
Logged

Dancing pants and leotards, that's what I'm talkin' about!
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #2 on: April 18, 2008, 09:01:07 21:01 »

in the real hardware and no problem in simulation (proteuse)

Posted on: April 18, 2008, 09:59:13 21:59 - Automerged

i think it s affaecting by the action on the power contactor ,i need a software solution
Logged
MGLSOFT
Junior Member
**
Offline Offline

Posts: 69

Thank You
-Given: 32
-Receive: 73



« Reply #3 on: April 19, 2008, 12:05:28 00:05 »

  The remaining 4 pin DB0-DB3, you need to connect them to GND ...  Wink Wink
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4647

Thank You
-Given: 826
-Receive: 4207


There is no evidence that I muted SoNsIvRi


« Reply #4 on: April 19, 2008, 12:53:22 00:53 »

what is full ciruit , what power supression are you using. on the pic control lines.
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #5 on: April 19, 2008, 09:26:51 09:26 »

i use an atmega32 interfaced with a  diode and uln2003 and relay 12v 1RT directely attached with a coil of contactor (12 KW).
i know the problem is with the electrostatic an electromagnetic,and it affect only the lcd but the mcu and the hardwere it goode without interruption.
the rc filter and the snober circuit cant resolve the problem because it s not permanant .
i need a subroutine to initialise the lcd without the mcu
the instruction included in bascomavr is very long in time (>100ms).
i need a short subroutine (<30ms) for example .
sory for my bad english
Logged
zuisti
Senior Member
****
Offline Offline

Posts: 409

Thank You
-Given: 242
-Receive: 780


« Reply #6 on: April 19, 2008, 09:37:04 09:37 »

in the real hardware and no problem in simulation (proteuse)

Posted on: April 18, 2008, 09:59:13 21:59 - Automerged

i think it s affaecting by the action on the power contactor ,i need a software solution

Hi picavr,

Maybe your power supply is too slow about its power on time. Use a big (min. 200 ms) delay routine at the begin of the program (before  all others).
And yes, the 4 pins DB0-DB3 you need to connect to GND as MGLSOFT wrote above.

I don't know the LCD inic flow of your compiler, does it using the proper delays between the lcd inic statements?
For example the first three reset instructions are needed 15 - 15 ms delay. You can it measure  in Proteus debug assembly source window (use breakpoints).
zuisti
Logged
zuisti
Senior Member
****
Offline Offline

Posts: 409

Thank You
-Given: 242
-Receive: 780


« Reply #7 on: April 19, 2008, 10:48:05 10:48 »

Hi picavr,

Using a long (in its time) routine as the initlcd in IT time: it's a wrong practice, do not make this! Never!

I say again, use a long delay routine at the begin, before the first initlcd. Try it!
Post also your program code, or the whole Proteus project to get the proper help from us.

zuisti
PS.
You got a lot of helps from many members above, why do not use the "thank you" button?
Logged
zuisti
Senior Member
****
Offline Offline

Posts: 409

Thank You
-Given: 242
-Receive: 780


« Reply #8 on: April 19, 2008, 11:37:43 11:37 »

Hi picavr,

You don't posted any code, so I cannot help to you.
However...
Seems your initlcd routine doesn't work with your LCD (maybe it doesn't contain an internal reset circuit?).
I see you have the hd44780.pdf but I strongly recommended to apply a long delay first and after this send three reset commands (0x3) to the lcd.
I attached here an example Proteus project written by me (it's for PIC, it uses also the Busy flag, the source is in assembly but well commented). The expected lcd inic steps are useful also for you I think. Study it!

OK, an initlcd eats long time but it runs at begin and only once. If it's not enough, (maybe) your code is wrong elsewhere.
And again: do not use the init lcd routine under IT!

Without any code and schematic I cannot help more to you.
Good luck.
zuisti
   
Logged
hhh4h
Guest
« Reply #9 on: April 20, 2008, 05:20:12 17:20 »

Make sure you have bypass caps on the power rail.  Power  glitches are the toughest to find and the easiest to fix
Logged
afreakmachine
Guest
« Reply #10 on: May 18, 2008, 05:40:43 05:40 »

buffer overflowed ?
Logged
YellowTiger
Guest
« Reply #11 on: May 19, 2008, 06:17:51 18:17 »

... bypass caps on the power rail.
+1!
And make (flat) cable to the LCD module as short as possible! (ASAP Grin)
Logged
sohel
Senior Member
****
Offline Offline

Posts: 442

Thank You
-Given: 167
-Receive: 149



« Reply #12 on: May 19, 2008, 09:01:25 21:01 »

Hmm,

i have make a lot of lcd based programme. from my exprince i can say---

1. first check ur lcd connector if u use base connector which may be non contucting by dust.

2. and check ur lcd  body should not contuct ur casing, use non contucting seperating.

3. for 16*2 lcd u should clear lcd for both line at a time ( also when u write text for 2nd line).(software)

4. u should check busy bit(d7). (looping)

5. use wdt if u think ur main programme halt.

6. if u use interrupt then aske me. by the way i am not avr lover, i would like pic.

7. its upto u. Grin

7.
Logged
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #13 on: May 20, 2008, 04:24:24 16:24 »

i use the wdt ,but i said ,i have the solution and it work fine now,i made a short timming validation ,and its the best solution in the industrial area.
i use the pic mcu since 1999,but i think the avr mcu is the best in the pro application,now i use the atmega32 16p,and it work fine,very speed with a little price.
think for all members.
Logged
LabBoy
Guest
« Reply #14 on: May 23, 2008, 12:34:13 12:34 »

Hi picavr.

you can protect the spice signal by put low pass filter in power supply that show below.
              +---------+
o---------|  10mH    |-----------+-----------------o  +VCC
              +---------+                |
                     L                     === 0.1uF
                                            === C
                                              |
 o-------------------------------+-----------------o  GND   
Logged
daydreamer
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 9
-Receive: 0


« Reply #15 on: June 29, 2008, 06:10:45 18:10 »

 Hi try 100uF/16 on Lcd  5V to ground and Use 100E 0.1uf snubber across contactor coil
Logged
LEAS
Junior Member
**
Offline Offline

Posts: 77

Thank You
-Given: 9
-Receive: 19


« Reply #16 on: July 13, 2008, 04:51:31 16:51 »

May be error occured during data to simbol or another conversion in program? Time delay may be so different between real LCD and model ? May be LCD damaged ? I has situation in 4-bit LCD mode in Proteus: real construction don't work in ISIS.
Logged
kimhuynguyen
Newbie
*
Offline Offline

Posts: 15

Thank You
-Given: 13
-Receive: 26


« Reply #17 on: July 29, 2008, 07:51:28 07:51 »

If you use BASCOM, the possibility that you should remove compiler directive $sim,
it's only use for Simulation.

Before you burn in to your Flash, remember to remove it, and compile again.
« Last Edit: July 29, 2008, 08:22:33 08:22 by kimhuynguyen » Logged
anatom
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 5
-Receive: 0


« Reply #18 on: July 29, 2008, 08:14:42 08:14 »

Check the reset line on LCD. Maybe u should use a capacitor...?
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC