CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

HIGH_INTS=true and HIGH interrupt keyword

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

HIGH_INTS=true and HIGH interrupt keyword
PostPosted: Thu May 22, 2008 7:22 am     Reply with quote

Hello, perhaps it is normal behaviour or it may be a bug within my compiler (3.242):
If i use "#device HIGH_INTS=true", I also have to put "HIGH" keyword in one interrupt definition - example "#int_CCP1 HIGH".
If I dont specify any interrupt routine to be "HIGH", the PIC behaves weird. Basically, data sent over the serial line gets corrupted, unless I use smthng like this:
Code:
disable_interrupts(INT_CCP1);
printf("%lu %lu\r",AverageCounter,freq);
enable_interrupts(INT_CCP1);


Just to let you guys know about this issue,
cheers
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Thu May 22, 2008 8:37 am     Reply with quote

Yes, I had that same issue with 3.249 - copied part of a project with "#device HIGH_INTS=true", but didn't have any high ints. Took a good while to find (actually, ccs found this for me).

Don't know if the problem persists in V4.xxx

Ken
Ttelmah
Guest







PostPosted: Thu May 22, 2008 9:07 am     Reply with quote

It is worth remembering, that if interrupt priority is turned 'on' (which is what the high_ints keyword does), _some_ interrupts are automatically 'high', so (on most chips) the 'INT_EXT' interrupt will always be HIGH, once this is set. Now, CCS normally handles this OK, but only builds the actual 'handler', when a high priority interrupt is 'met'. Without this, the RB interrupt will vector into an undefined area below the normal handler code, and will _really_ screw things up!.... This is part of the reason why they have the option in the device statement, rather than just enabling high priority interrupts 'automatically' if the fast, or high keywords are met. There are a whole sequence of possible problems, when changes like this are triggered without the right code being present.
Really (common with a lot of the CCS stuff), the manual ought to make it much more plain that this option should _only_ be enabled if you are using high priority interrupts.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group