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

help me with interrupt

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



Joined: 09 Dec 2010
Posts: 11

View user's profile Send private message Yahoo Messenger

help me with interrupt
PostPosted: Thu Dec 09, 2010 3:18 pm     Reply with quote

Code:

#include <16f877a.h>
#use delay(clock=200000000)
#fuses hs,noprotect,nowdt,nolvp

#byte portb=6

void main(){

set_tris_b(0b00000000);
enable_interrupt(INT_EEPROM);
enable_interrupt(global);

do{
output_high(pin_B1);
delay_ms(2000);
output_low(pin_B1);
delay_ms(2000);
}while(1)
}


what's wrong with my coding ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19516

View user's profile Send private message

PostPosted: Thu Dec 09, 2010 3:57 pm     Reply with quote

You must _never_ enable an interrupt, without the code to handle it being present.
Why on earth, do we seem to have dozens of posters, suddenly trying to use 'interrupts' for things that they are not designed for, without the first idea of reading the data sheet, and some basic books about processor hardware first...
Crying or Very sad
yie23



Joined: 09 Dec 2010
Posts: 11

View user's profile Send private message Yahoo Messenger

PostPosted: Thu Dec 09, 2010 4:01 pm     Reply with quote

im very sorry , but this is my homework .that's why im really need help here . this work's covers 20% of our grade . Sad
Ttelmah



Joined: 11 Mar 2010
Posts: 19516

View user's profile Send private message

PostPosted: Thu Dec 09, 2010 4:07 pm     Reply with quote

Then _you_ need to do the learning.
Sorry, but my niece was handling code better than this at 5 years old. Her biggest problem was spelling the instructions, a custom dictionary to the spelling checker soon solved that.
_Everything_ you need to know, is available on the web, with some research, this is _not_ a schoolroom, it is a group to _help_ people having specific problems with the CCS compiler. Your questions are far more basic than this...
yie23



Joined: 09 Dec 2010
Posts: 11

View user's profile Send private message Yahoo Messenger

PostPosted: Thu Dec 09, 2010 4:10 pm     Reply with quote

Hahaha, ok. Thanks a lot for your comment. It goes straight to my heart. Very Happy
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