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

Int_RA

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



Joined: 30 Nov 2007
Posts: 13

View user's profile Send private message

Int_RA
PostPosted: Thu Jan 31, 2008 1:50 pm     Reply with quote

Hello all,

I've been trying to use the interrupt on change on the port A pins, but the compiler states that it doesnt recognise "#define int_ra".

Im using PCW Compiler versions 4.057.

my code is as follows:

Code:


 #include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)


int8 value = 0;

#INT_RA
void portchange_isr ()
{
 value= input(PIN_A0);
}

void main()
{
   output_low(pin_c5);
   enable_interrupts(GLOBAL);
   enable_interrupts(INT_RA);
 
 while(1)
      {
       if(value == 0)
            {
             output_low(PIN_C5);
            }
       else
            {
             output_high(PIN_C5);
            }
      }     
}




I've used the same code as above for port b, except that I change int_ra to int_rb in both lines and it works fine...

can anyone please advise ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 31, 2008 2:33 pm     Reply with quote

Quote:

I've used the same code as above for port b, except that I change int_ra to int_rb in both lines and it works fine...


Look in the 16F877A.H file. There is a list of available interrupts at the
end of the file.
Quote:
c:\Program Files\picc\Devices\16F877A.h


Download the 16F877A data sheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf
Look at this section, on page 43 in the Acrobat reader:
Quote:
4.1 PORTA and the TRISA Register

Do you see any place where it says that Port A has interrupt-on-change ?
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