View previous topic :: View next topic |
Author |
Message |
smatjaz
Joined: 28 Jun 2004 Posts: 62
|
Posted: Thu Nov 06, 2014 9:15 pm Post subject: INIT GLCD 128x64 SED |
|
|
Hello.
I have a circuit (ATXMEGA128A3U) with a graphical display 128x64 - glcdks108.lib. The device includes a relay - the pump. When switching relay, it sometimes happens that the display freezes. The circuit operates normally.
I need to re-initialize the display during operation of the program.
I tried using the command:
but does not work.
I reset Portc5 (RESET - GLCD) for a short time. Half of the display works fine and the other half is off.
Code: | Config Graphlcd = 128 * 64sed, dataport = Porta, Controlport = Portc, Ce = 7, CE2 = 6, Cd = 3, d = 4, 5 = Reset, Enable = 2, Mode = 8 |
Code: | Reset portc.5
Wait 1
Set portc.5
Initlcd
Cls |
I also tried this
Code: | $asm
icall _Init_lcd
icall _Init_display
icall _set_display
$end Asm |
but without success.
Does anyone could tell me how during the operation of the program to re-initialize the graphical LCD display?
Best regards, M.
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Nov 06, 2014 10:16 pm Post subject: |
|
|
you can use : !call _set_display
This will init both of the ks108 chips. _________________ Mark |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 584 Location: Cleveland, OH
|
Posted: Thu Nov 06, 2014 10:27 pm Post subject: |
|
|
Also, it is desirable to find the cause for the erratic LCD operation and fix the underlying cause, when possible.
In this case does the relay have a reverse biased diode across the coil, (or another snubber circuit)?
It sounds like the relay is likely generating a voltage spike when it is turned off, and that is interfering with the LCD, and perhaps with the uC itself.
Do you have AVcc tied to V+, (optionally through an LC filter)?
Do you have a by-pass cap, e.g. 0.1 uF, across each Vcc/Ground and AVcc/Ground pin pair, mounted very close to the micro itself?
If the LCD is at a fair distance from the micro, or if the Relay is at a fair distance from the micro, then additionally their wiring can act as antenna and pick up EMI from the relay coil, from the contact arc, and perhaps from the load the relay is switching on and off.
JC |
|
Back to top |
|
|
smatjaz
Joined: 28 Jun 2004 Posts: 62
|
Posted: Fri Nov 07, 2014 3:10 pm Post subject: |
|
|
Hello.
The circuit has, together with the display, approximately 8cm long wires.
This is probably the cause of the problem.
On the connector pins I added a 10K resistor strip. System works better, but still periodically display freezes.
I will try with command:
Thanks for the help.
Best regards. M. |
|
Back to top |
|
|
smatjaz
Joined: 28 Jun 2004 Posts: 62
|
Posted: Fri Nov 14, 2014 9:37 pm Post subject: |
|
|
Thank You.
It works just as I wanted.
Best regards, M. |
|
Back to top |
|
|
|
|
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 You cannot attach files in this forum You cannot download files in this forum
|
|