Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 08, 2016, 07:10:54 19:10


Login with username, password and session length


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

Posts: 169

Thank You
-Given: 184
-Receive: 100


« on: April 18, 2008, 06:17:47 18: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: 564

Thank You
-Given: 513
-Receive: 358


Put it in, take it out.


WWW
« Reply #1 on: April 18, 2008, 07:44:26 19: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: 169

Thank You
-Given: 184
-Receive: 100


« Reply #2 on: April 18, 2008, 10:01:07 22: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
**
 Warned
Offline Offline

Posts: 68

Thank You
-Given: 32
-Receive: 73



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

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

Posts: 3816

Thank You
-Given: 567
-Receive: 2049


There is no evidence that I muted SoNsIvRi


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

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

Note: If you have no posts other than, I want or reporting a dead link Then you can't complain If I remove your post So Stop Leeching
picavr
Active Member
***
Offline Offline

Posts: 169

Thank You
-Given: 184
-Receive: 100


« Reply #5 on: April 19, 2008, 10:26:51 10: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: 371

Thank You
-Given: 219
-Receive: 567


« Reply #6 on: April 19, 2008, 10:37:04 10: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: 371

Thank You
-Given: 219
-Receive: 567


« Reply #7 on: April 19, 2008, 11:48:05 11: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: 371

Thank You
-Given: 219
-Receive: 567


« Reply #8 on: April 19, 2008, 12:37:43 12: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, 06:20:12 18: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, 06:40:43 06:40 »

buffer overflowed ?
Logged
YellowTiger
Guest
« Reply #11 on: May 19, 2008, 07:17:51 19: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: 437

Thank You
-Given: 140
-Receive: 124



WWW
« Reply #12 on: May 19, 2008, 10:01:25 22: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

A Thousand Miles Journey Start With a Single Step<br />http://www.youtube.com/user/masud58
picavr
Active Member
***
Offline Offline

Posts: 169

Thank You
-Given: 184
-Receive: 100


« Reply #13 on: May 20, 2008, 05:24:24 17: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, 01:34:13 13: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
*
 Muted
Offline Offline

Posts: 7

Thank You
-Given: 4
-Receive: 0


« Reply #15 on: June 29, 2008, 07:10:45 19: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, 05:51:31 17: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, 08:51:28 08: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, 09:22:33 09:22 by kimhuynguyen » Logged
anatom
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 5
-Receive: 0


« Reply #18 on: July 29, 2008, 09:14:42 09: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