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

Interrupt on change on PIC16F1827

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



Joined: 25 Apr 2007
Posts: 14

View user's profile Send private message

Interrupt on change on PIC16F1827
PostPosted: Tue Jun 30, 2015 2:07 pm     Reply with quote

I'm struggling to make IOC work; it seems to me that the 16F1827.h file is not complete, since it doesn't show any settings for setting the individual 8 bits of the port for this function which is a feature on this chip.
I'm working with PCWH 4.099.
Can you provide assistance to solve this issue?

Thanks a lot. Very Happy
Ttelmah



Joined: 11 Mar 2010
Posts: 19467

View user's profile Send private message

PostPosted: Tue Jun 30, 2015 2:28 pm     Reply with quote

In part, compiler age.
Later compiler do contain the code to set the edges, and which bits are enabled, and to vector to separate handlers if required. However even on the later compilers you need to manually clear the extra status bits for the individual bits.

Easiest answer, just define the registers yourself IOCBP, and IOCBN for the positive edges and negative edges respectively, and IOCBF for which interrupt has actually triggered. The interrupt on change routine will be called for all set bits, and you then test which one has triggered, and clear it's status bit.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jun 30, 2015 2:58 pm     Reply with quote

Quote:
I'm working with PCWH 4.099

See this thread for sample code:
http://www.ccsinfo.com/forum/viewtopic.php?t=46331
Your PIC doesn't have the input threshold registers so disregard that part.
ricperez



Joined: 25 Apr 2007
Posts: 14

View user's profile Send private message

Problem solved
PostPosted: Wed Jul 01, 2015 3:01 pm     Reply with quote

Very Happy
To those who sent recommendations, thanks a lot. I combined your proposed solutions and my code is running smoothly now!

This forum is great because of you people Laughing
Ttelmah



Joined: 11 Mar 2010
Posts: 19467

View user's profile Send private message

PostPosted: Thu Jul 02, 2015 1:24 am     Reply with quote

Well done. Smile
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