Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

interrupt confuse lcd

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
hamedhamedi

Bascom Member



Joined: 12 Feb 2012
Posts: 70

PostPosted: Tue Mar 24, 2015 8:55 am    Post subject: interrupt confuse lcd Reply with quote

Hi

I use lcd nokia3310 with Mr Mirshv code that is in froum,share your code topic.

when i enable the interrupt 5 and 6 on atmega128, the lcd show incorrect position of character ond/or and character.

i have same problem on SED lcd when interrupt occur.

i think when interrupt trigger,after coming back from interrupt service routine, the program flow in data section (that symbol of a font saved)does not come back to the place jumped before interrupt.

i also check the software stack and hardware stack and framesize and set them at a very high value of 128,but problem exist.

what should i do?

Thanks.

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
Dibor

Bascom Member



Joined: 04 Dec 2004
Posts: 125
Location: ISRAEL

israel.gif
PostPosted: Tue Mar 24, 2015 11:38 am    Post subject: Reply with quote

Hi.
Disable Interrupts before sending anything to LCD and Enable them after that.

Regards.
Back to top
View user's profile MSN Messenger
hamedhamedi

Bascom Member



Joined: 12 Feb 2012
Posts: 70

PostPosted: Tue Mar 24, 2015 12:09 pm    Post subject: Reply with quote

thanks

interrupt timing is critical.
and also i do not want to lose any interrupt.

any other idea?

Regards
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4970
Location: Holland

blank.gif
PostPosted: Tue Mar 24, 2015 2:26 pm    Post subject: Reply with quote

there can be 2 reasons (that i can think of): the ISR is not saving registers that are used by the driver. in that case, use the SAVEALL switch.
Or the LCD works with nibbles, and it does not like the time between the 2 nibbles caused by the interrupt. In that case you need to turn off these ints before using the LCD. Or alter the driver so it turns off/on interrupts.

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

Bascom Member



Joined: 12 Feb 2012
Posts: 70

PostPosted: Tue Mar 24, 2015 8:15 pm    Post subject: Reply with quote

thank you Albertsm

fine.solved by save all.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR 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