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

ccp help..

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







ccp help..
PostPosted: Thu Jul 24, 2008 2:39 am     Reply with quote

is something wrong with my code? i just place a waveform generator in PIN_C1. what i want is to display the no. of pulses that the generator generates. please help..
Code:

#include <18F4525.h>
#device ICD=TRUE
#device PASS_STRINGS = IN_RAM //this is needed so that you can directly use strcmp even if one
                              //parameter is not a variabe
                              //strcmp(mystr,"OK") --> this will still work..

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES INTRC_IO                 //Internal RC Osc, no CLKOUT
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOBROWNOUT               //No brownout reset
#FUSES PUT                      //Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOIESO                     //NO Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES NOPBADEN                 //NO PORTB pins are configured as digital I/O on RESET
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOLPT1OSC                //Timer1 configured for higher power operation
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled

#use delay(clock=8000000)
#use rs232(baud=9600, xmit=PIN_D4, rcv=PIN_D5, stream=PC)
int16 findata=0;

void main(){
int msgNumxx=0;
delay_ms(1000);
setup_ccp2(CCP_CAPTURE_RE);
clear_interrupt(INT_CCP2);
enable_interrupts(INT_CCP2);
delay_ms(500);
do{
   fprintf(PC,"findata = %li\n",findata);
   delay_ms(500);
  }while(1);
}

#int_CCP2
void CCP2_isr()
{
 finData++;
}
Ttelmah
Guest







PostPosted: Thu Jul 24, 2008 4:22 am     Reply with quote

Since this is a related question to an earlier thread you launched, I'd say you should have added this question to the _same thread_. This is better for people in the future, since they can look for a particular problem, and find all the likely solutions in one place,instead of scattered all over the group...

The answer here, is almost certainly CCP2C1. You need this fuse set, to use pin C1, as the CCP input.

Best Wishes
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