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

toggle ext int edge

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



Joined: 04 Jun 2006
Posts: 35

View user's profile Send private message

toggle ext int edge
PostPosted: Mon Aug 14, 2006 2:33 am     Reply with quote

I can change ext int edge with:

ext_int_edge( H_TO_L );

or

ext_int_edge( L_TO_H);

but i need to make it toogle in a function with no preview edge knowledge..

how can make it happen?

Thank for help!!
Ttelmah
Guest







PostPosted: Mon Aug 14, 2006 2:50 am     Reply with quote

There must be some sort of 'knowledge'. Normally you could (for example), use:
Code:

if (input(PIB_B0)) {
   //signal is high, so I want to interrupt on high to low
   ext_int_edge(H_TO_L);
}
else ext_int_edge(L_TO_H);
//Otherwise interrupt on rising edge.

The decision can be based on whatever you want, but normally the state of the pin would be the most 'logical' decider.

Best Wishes
Ttelmah
Guest







PostPosted: Mon Aug 14, 2006 2:59 am     Reply with quote

Obviously, using the 'PIN', not the 'PIB'...

Best Wishes
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Mon Aug 14, 2006 5:05 am     Reply with quote

You can also use this:

Code:
struct
{
   unsigned char RBIP:1;
   unsigned char INT3P:1;
   unsigned char T0IP:1;
   unsigned char INTEDG3:1;
   unsigned char INTEDG2:1;
   unsigned char INTEDG1:1;
   unsigned char INTEDG0:1;
   unsigned char RBPU:1;
}
INTCON2bits ;
#locate INTCON2bits=0x0FF1 // pic 18f452

void main( void )
{
intcon2bits.intedg1++; // toggle edge
}
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