Go to Post I believe you have the right to develope your own opinion. I would suggest it be based on actual experience and facts. - Mike Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 15-12-2003, 07:32
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Problem with interrupts on the PIC

Jim,

Thank you. Your input is basically the same as IFI gave me... My bad for not reading the C compiler manual more closely.

One of the issues is that your pragma fragment, the default code and the Timers White Paper is that all use:

#pragma interrupt InterruptHandlerLow

However, section 2.9.2 of "MPLAB® C18 C COMPILER USER’S GUIDE" indicates that

#pragma interruptlow InterruptHandlerLow

is the correct pragma to use. Otherwise, both high and low will use the same shadow registers and a high priority interrupt will eventually interrupt the low priority and trash your context.

Once again, thanks for your help.

Mike


Larry,

In addition to my comment above, please be sure that you read section 2.9.2 in it's entirety. Specifically, I quote:

"If an interrupt service routine calls another function, the normal functions' temporary data section (which is named .tmpdata) should be saved using a save=section(".tmpdata") qualifier on the interrupt pragma command."

In your case, the pragma in User_Routines_Fast.c needs to be:

#pragma interruptlow InterruptHandlerLow save=section(".tmpdata")

I hope this fixes your glitching problem. It did for me...
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Victor problem Andy Baker Electrical 15 24-06-2003 09:49
Ok one problem cantwell03 Programming 3 13-02-2003 07:28
The problem with scouting... archiver 2001 10 23-06-2002 23:49
Major problem with chipphua motors aka Scott White Motors 18 19-03-2002 19:44


All times are GMT -5. The time now is 10:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi