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

PROBLEM WITH RB INTERRUPT

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







PROBLEM WITH RB INTERRUPT
PostPosted: Fri Nov 13, 2009 4:38 am     Reply with quote

Hi all

I am having a problem with this code using RB interrupt.

#include <16F877A.h>

#FUSES XT, NOWDT, LVP, NOPUT, NOPROTECT, BROWNOUT

#use delay(clock=4000000)

#INT_RB
void RB_isr ( )
{

output_d(INPUT_B());

}


void main()
{
set_tris_b(0xff);
set_tris_d(0x00);
enable_interrupts(INT_RB);
enable_interrupts(GLOBAL);
do { } while(True);

}

When I run it using Isis simulator it works fine but on the actual circuit it doesn't. I tried a simple program on my circuit and it works, so I assume my connections are fine.

Is there something missing in the code?
Please help me ...
May
Guest







PostPosted: Fri Nov 13, 2009 4:54 am     Reply with quote

I'm really sorry I didn't use the "Code" feature. I couldn't edit my post.
sorry again.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Nov 13, 2009 5:35 am     Reply with quote

The code seems correct except for one detail. You should never enable LVP, when the respective programming pins are used as I/O.
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