View previous topic :: View next topic |
Author |
Message |
bolubeyi
Joined: 27 Apr 2012 Posts: 15 Location: TURKEY
|
Interrupt problem because of glcd |
Posted: Thu Mar 07, 2013 9:16 am |
|
|
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: 19535
|
|
Posted: Thu Mar 07, 2013 10:19 am |
|
|
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 |
|
|
|