INTCON.7 = 0 before the section to be executed and
INTCON.7 = 1 after the section to be executed worked fine
INTCON.7 = 0 before the section to be executed and
INTCON.7 = 1 after the section to be executed worked fine
Hi ronjodu,
I'm glad you figured it out.
The way I like to put it is ...
The only problem with Interrupts, is that they Interrupt things.
And, any statement that does it's timing in software (SerIn/Out, OWin/out, Debug, Freqout, Pulsin/out, etc) will have that timing disturbed by the interrupts. Synchronous commands like LCDOUT, I2C and ShifIn/Out don't care.
Had you been using a paralel interface to the LCD, it wouldn't have a problem.
However, As you've found out with Serout, 1 easy way is to just turn off GIE before those types of statements. But that can cause you to lose interrupts. I'm sure at some point you'll be doing more than just blinking lights, and the problem will become more evident.
If you use the USART on the 16F876 with HSEROUT, then you won't need to turn off the interrupts while sending serial data, and you won't lose any interrupts.
HTH,
Darrel
I have tried the HSEROUT for the LCD and had trouble making it work. Serout2 was much easier to get working at the time. I guess I'll have to reinvestigate the HSEROUT option again.
Is there an easy way for a beginner to tell which statements are affected by an interrupt and which are not. (trial and error perhaps?)
These PBP statements will be affected by the use of interrupts.
I think I got them all. If anyone sees one I missed, please chime in.DEBUG/IN
DTMFOUT
FREQOUT
NAP
OWIN/OUT
PAUSE/US
POT
PULSIN/OUT
PWM
RCTIME
SERIN/OUT
SLEEP
SOUND
WRITE
WRITECODE
XIN/OUT
<br>
DT
Thanks again, I've included a note in my manual on each statement.
Bookmarks