Therefore, to avoid any chance of R-M-W artifacts on the INTCON register, Salvo for PICmicro(R) MCUs users should replace a portion of salvoincportpicc.h with:
code:The same change should also be made to salvoincportiar18.h./* interrupt control depends on OSPIC18_INTERRUPT_MASK. Don't */
/* use RMW instructions (e.g. INTCON |= mask) because Timer0 */
/* and/or INT0 bits may be lost if set during the RMW cycle. */
#if ( OSPIC18_INTERRUPT_MASK == 0xC0 ) ||
( OSPIC18_INTERRUPT_MASK == 0x80 ) ||
( OSPIC18_INTERRUPT_MASK == 0x40 ) ||
( OSPIC18_INTERRUPT_MASK == 0x00 )
#if !defined(OSDi)
#if (OSPIC18_INTERRUPT_MASK == 0xC0)
#define OSDi() do { GIE = FALSE; PEIE = FALSE;
} while (0)
#elif (OSPIC18_INTERRUPT_MASK == 0x80)
#define OSDi() do { GIE = FALSE;
} while (0)
#elif (OSPIC18_INTERRUPT_MASK == 0x40)
#define OSDi() do { PEIE = FALSE;
} while (0)
#elif (OSPIC18_INTERRUPT_MASK == 0x00)
#define OSDi()
#endif
#endif#if !defined(OSEi)
#if (OSPIC18_INTERRUPT_MASK == 0xC0)
#define OSEi() do { GIE = TRUE; PEIE = TRUE;
} while (0)
#elif (OSPIC18_INTERRUPT_MASK == 0x80)
#define OSEi() do { GIE = TRUE;
} while (0)
#elif (OSPIC18_INTERRUPT_MASK == 0x40)
#define OSEi() do { PEIE = TRUE;
} while (0)
#elif (OSPIC18_INTERRUPT_MASK == 0x00)
#define OSEi()
#endif
#endif
#else
#error portpicc.h: Invalid OSPIC18_INTERRUPT_MASK value.
#endif
------------------
--------
Salvo Technical Support
Please request all tech support through the Forums.
[This message has been edited by Salvo Tech Support (edited November 23, 2005).]
[This message has been edited by aek (edited June 15, 2006).]