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

How make a bounce free code? Help Please

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



Joined: 15 Dec 2003
Posts: 2

View user's profile Send private message

How make a bounce free code? Help Please
PostPosted: Thu Dec 18, 2003 4:20 am     Reply with quote

How make a bounce free by software code in the CCP1 and CCP2 interruptions? Rolling Eyes

here the code

Code:

int8 T;


void Contador (void);
#int_CCP1
void CCP1_isr(void)
{
   T=0;
}

#int_CCP2
void CCP2_isr(void) {

  Contador();

}


void Contador (void)
{

 T=T+1;
 //output_B(T);

}


void main() {

   setup_adc_ports(A_ANALOG);
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_spi(FALSE);
   setup_counters(RTCC_INTERNAL,RTCC_DIV_2);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_ccp1(CCP_CAPTURE_FE);
   setup_ccp2(CCP_CAPTURE_FE);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   enable_interrupts(INT_CCP1);
   enable_interrupts(INT_CCP2);
//   enable_interrupts(INT_EXT);
   enable_interrupts(global);

  output_B(T);

}



any idea? Idea

Question and the other question it's, how work the external interruption in the PIC16F84 in the CCS compiler, I did't work the code for me, help me please with my two newbie questions

Thanks for you answers

Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 18, 2003 4:00 pm     Reply with quote

I'm not sure what your overall project is.
You're trying to use CCP capture mode, but
you have disabled Timer1. So the capture
mode will not work. You should look at some
CCS example files which show how to use the
CCP capture mode. These are:

EX_REACT.C
EX_CCPMP.C
These files are in this folder: c:\Program Files\Picc\Examples

To answer your other question about using INT_EXT with
the 16F84, you should study this example shown in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=17041
Vacio



Joined: 15 Dec 2003
Posts: 2

View user's profile Send private message

PostPosted: Mon Dec 22, 2003 9:03 am     Reply with quote

PCM programmer wrote:
I'm not sure what your overall project is.
You're trying to use CCP capture mode, but
you have disabled Timer1. So the capture
mode will not work. You should look at some
CCS example files which show how to use the
CCP capture mode. These are:

EX_REACT.C
EX_CCPMP.C
These files are in this folder: c:\Program Files\Picc\Examples

To answer your other question about using INT_EXT with
the 16F84, you should study this example shown in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=17041



Thanks Very Much PCM Programmer

I will read the example, and I will back later to the forum Smile
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