|> I'm am having problems with the rtcc interupt on the '71.
Could you describe the problem in more detail?
1. Make sure you turn on the GIE bit and the T0IE bit in the INTCON register
when your code is prepared to deal with interrupts.
2. Clear the T0IF bit before turning on the enable bits (as in hint 1), or
you may get an immediate unexpected interrupt because the timer may have
already overflowed previously.
3. Make sure your interrupt handler saves and restores W and STATUS properly.
It is tricky to restore without changing STATUS; the SWAPF instruction
must be used. The 16C7x data sheet has suggested code in section 14.6.
Also, you may need to save other registers such as FSR or PCLATH if your
interrupt handler changes them.
4. The interrupt handler must clear the T0IF bit in the INTCON register
before it returns in order to clear the interrupt condition. Otherwise
the interrupt handler will get called continuously.
5. The interrupt handler must use the RETFIE instruction to return, or the
GIE bit will stay clear and you won't get any more interrupts after the
6. If your code ever needs to turn off the GIE bit (global interrupt enable),
make sure you read Microchip application note 576. There can be a problem
if an interrupt happens during the execution of the instruction that turns
It is generally easier to turn off only the specific interrupt
enable bit(s) that you care about, such at T0IE.
7. Make sure interrupts are disabled before you execute any instruction that
directly writes to the PCL register, such as an ADDWF PCL (typically used
in a table look-up). According to application note 556, an interrupt
that happens during the instruction that changes the PCL can return to the
wrong place (the desired address + 1).
I asked about this problem in the recent seminar and the Microchip people
who were present think that this application note may be incorrect and that
the part may handle this situation properly.
Can the Guy that is selling the pic 16c71's on the list give me
a private e-mail please.
Can he also tell me if he has any left to sell and what the
There is no justice.
There is just us.
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...