CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Interrupt problem because of glcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bolubeyi



Joined: 27 Apr 2012
Posts: 15
Location: TURKEY

View user's profile Send private message

Interrupt problem because of glcd
PostPosted: Thu Mar 07, 2013 9:16 am     Reply with quote

Hi, i use 240x128 GLCD with T6963C lib and 2 phase asenkron engine(motor). drive engine phase shift method so i use (ccp3) capture interrupt. When write the glcd, my microcontroller (18f67k22) is not going the interrupt. For this reason motor does not operate normally. What can i do? I need some advice.

Compiler give this warning Interrupt disabled during call to prevent re-entrancy ( glcd function).
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Mar 07, 2013 10:19 am     Reply with quote

It sounds as if you are calling the glcd function inside one of the interrupts, and also outside in the main code. If so, don't.

Double reasons:
1) LCD functions are slow. You always want to get out of interrupts ASAP.
2) The PIC does not support 're-entrancy' (where a function is called inside itself). Hence if you have the LCD function called inside an interrupt handler and outside, the compiler has to make sure that the version in the interrupt is never called while the external version is running. So has to disable interrupts whenever the external routine is called.

If you have an interrupt that wants to display messages, then write these to a buffer, and have the main code check if anything is in this, and write the massage to the LCD if so.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group