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 CCS Technical Support

Cannot use Interrupt-on-change PIC16F1459

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



Joined: 20 Nov 2012
Posts: 2

View user's profile Send private message

Cannot use Interrupt-on-change PIC16F1459
PostPosted: Mon Jul 27, 2015 3:35 am     Reply with quote

Hello,

I'm working a program on PIC16F1459 and i need to use interrupt on change.
Can please somebody help me why when i compile my program there is an error message: Invalid pre-processor directive on the line #INT_RB6_L2H. When i try to use other interrupts(example: INT_TIMER0) there is no error.

Thank you in advance. Confused
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Jul 27, 2015 8:13 am     Reply with quote

No, it's a case of not quite understanding the chip, and how CCS handles it.

There is _not_ an interrupt 'INT_RB6_L2H'. There is a single #INT_RB (for all changes on port B), which can be programmed to only happen on pin RB6 changing from low to high.

So they are used like:
Code:

#INT_RB  //The handler is always just INT_RB
void  RB_isr(void)
{

}

void main()
{

   enable_interrupts(INT_RB6_L2H); //enable INT_RB to only sense RB6 low to high
   enable_interrupts(GLOBAL);


You can't use the 'configuration' names, as names for the interrupt handler.

Separately, you may also have to manually clear the IOCBF register. This depends on the age of the compiler. The current ones do this for you, older versions in some cases do not. A search here will find code for this.
kokabt



Joined: 20 Nov 2012
Posts: 2

View user's profile Send private message

PostPosted: Mon Jul 27, 2015 8:55 am     Reply with quote

Thank you Ttelmah,

now I understand. Your way works excellent.
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