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

interruption

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



Joined: 28 May 2012
Posts: 24
Location: france

View user's profile Send private message AIM Address

interruption
PostPosted: Mon May 28, 2012 8:15 am     Reply with quote

Hello
I try to make a break with two micro switches.
The program compiles fine but no detection. The LED does not light either.
why??
My program:

I put all my interruptions, see bold character

}
}[/b]

Thank you very much.


Last edited by will on Thu May 31, 2012 5:02 am; edited 2 times in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19327

View user's profile Send private message

PostPosted: Mon May 28, 2012 8:22 am     Reply with quote

Three things:

if (droit)==0) {

Needs to be

if (input(droit)==0) {

Second, you are not enabling INT_RB.

Third, you are 'pushing' the interrupt speed for your timer. Technically you could be interrupting about every 285 instructions. Depending on what is in 'mot_generation_pwm', you may not have any time to actually do much else.....

Best Wishes
will



Joined: 28 May 2012
Posts: 24
Location: france

View user's profile Send private message AIM Address

PostPosted: Mon May 28, 2012 8:30 am     Reply with quote

thanks
Quote:

Second, you are not enabling INT_RB.

why?
I do not understand, what should I do?
jeremiah



Joined: 20 Jul 2010
Posts: 1321

View user's profile Send private message

PostPosted: Mon May 28, 2012 7:23 pm     Reply with quote

you have an interrupt service routine setup for RB but never turn it on with enable_interrupts() like you do the other interrupt.
will



Joined: 28 May 2012
Posts: 24
Location: france

View user's profile Send private message AIM Address

PostPosted: Tue May 29, 2012 4:56 am     Reply with quote

thank you
like this? but it does not work.
Code:




Last edited by will on Thu May 31, 2012 5:02 am; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9161
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue May 29, 2012 5:32 am     Reply with quote

You've really only shown us part of your code.
You do have a main ?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue May 29, 2012 5:36 am     Reply with quote

Read the CCS forum guide.

Learn to use the code buttons.

Post a SHORT but complete compilable version of you code that we can test.

Give us some idea of your schematic.

Mike
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