MikroElektronika put out this bug workaround for some PIC16s: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Bug ID: #03800000 Submitted by: Donovan Rogall Severity: medium (affects mikroC PRO for PIC v3.80) Status: Fixed, changes will affect following release Description: PIC16 interrupt context saving instructions do not backup higher nibble of STATUS register. Workaround: Instead of using default interrupt routine name: Code: Select all void interrupt() use any other function name, and org the function to interrupt vector address: Code: Select all void interrupt_routine() org 0x04 _________________ mikroElektronika Product Manager =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Allen > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of > Richard R. Pope > Sent: Monday, July 21, 2014 5:58 AM > To: Microcontroller discussion list - Public. > Subject: Re: [Pic] Making a special timer! >=20 > Jan-Erik, > I thought the compiler saved the context info automatically. Yes, I > am using XC8. So I have a complete program that is ready to test. I'll > probably do that tomorrow. The code as I have it compiles with no errors > and I believe that my logic is correct. I should be able to look at > these signals with my scope and I can hook it up to my counters and > display chips. This is looking good. Thanks everyone for all of your > help. It is greatly appreciated. > rich! >=20 > On 7/21/2014 4:48 AM, Jan-Erik Soderholm wrote: > > You have to check your compiler docs. > > > > I'm sure XC8 does. > > > > The MicroC docs (I might not have the latest, if you are > > using MikroC, verify this) says that W, STATUS, FSR, PCLATH > > are saved by the compiler. > > > > My MicrkC docs doesn't say anything about the newer PIC16's, > > but that wasn't of any interest to you anyway, right? :-) > > > > Jan-Erik. > > > > > > > > >=20 > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .