Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

INIT GLCD 128x64 SED

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
smatjaz

Bascom Member



Joined: 28 Jun 2004
Posts: 62

slovenia.gif
PostPosted: Thu Nov 06, 2014 9:15 pm    Post subject: INIT GLCD 128x64 SED Reply with quote

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:
Code:
initlcd

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
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5199
Location: Holland

blank.gif
PostPosted: Thu Nov 06, 2014 10:16 pm    Post subject: Reply with quote

you can use : !call _set_display
This will init both of the ks108 chips.

_________________
Mark
Back to top
View user's profile Visit poster's website
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 511
Location: Cleveland, OH

usa.gif
PostPosted: Thu Nov 06, 2014 10:27 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
smatjaz

Bascom Member



Joined: 28 Jun 2004
Posts: 62

slovenia.gif
PostPosted: Fri Nov 07, 2014 3:10 pm    Post subject: Reply with quote

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:

Code:
!Call _set_display



Thanks for the help.

Best regards. M.
Back to top
View user's profile
smatjaz

Bascom Member



Joined: 28 Jun 2004
Posts: 62

slovenia.gif
PostPosted: Fri Nov 14, 2014 9:37 pm    Post subject: Reply with quote

Thank You.

It works just as I wanted.

Code:
!Call _set_display


Best regards, M.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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