Hi guys .I'm trying to modify the program that i find in here
https://sites.google.com/site/ehutonline/home/pic-microcontroller/C18-Libraries-Examples/input-c
so it can work on pic18f97j60 using the ECCP3 because it is the only one available .
but i get this Errors and warnings
C:\Users\lakis\Desktop\ECCP\test.c:58:Error [1105] symbol 'EC3_EVERY_FALL_EDGE' has not been defined
C:\Users\lakis\Desktop\ECCP\test.c:58:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:76:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:80:Error [1105] symbol 'EC3_EVERY_RISE_EDGE' has not been defined
C:\Users\lakis\Desktop\ECCP\test.c:80:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:96:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:122:Error [1105] symbol 'EC3_EVERY_RISE_EDGE' has not been defined
C:\Users\lakis\Desktop\ECCP\test.c:124:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:165:Warning [2058] call of function without prototype
that is my code until now
does any one no how to solve that problem.
https://sites.google.com/site/ehutonline/home/pic-microcontroller/C18-Libraries-Examples/input-c
so it can work on pic18f97j60 using the ECCP3 because it is the only one available .
but i get this Errors and warnings
C:\Users\lakis\Desktop\ECCP\test.c:58:Error [1105] symbol 'EC3_EVERY_FALL_EDGE' has not been defined
C:\Users\lakis\Desktop\ECCP\test.c:58:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:76:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:80:Error [1105] symbol 'EC3_EVERY_RISE_EDGE' has not been defined
C:\Users\lakis\Desktop\ECCP\test.c:80:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:96:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:122:Error [1105] symbol 'EC3_EVERY_RISE_EDGE' has not been defined
C:\Users\lakis\Desktop\ECCP\test.c:124:Warning [2058] call of function without prototype
C:\Users\lakis\Desktop\ECCP\test.c:165:Warning [2058] call of function without prototype
that is my code until now
Code:
#include<p18f97j60.h>// Include files and definitions for the Processor
#include<capture.h>//Include function definitions for the Capture library
#include<timers.h>// Include function definitions for Timer Library
#include<stdlib.h>// Include function definitions for string manupulation Library
#pragma config WDT=OFF//
#pragma config DEBUG = ON
#pragma config XINST= OFF
#pragma config FOSC=HS
unsigned int result,hightime,totaltime,dutycycle;//Variables used
unsigned char start=1;
unsigned char highlow,end;
char str[5];
void Send(void);// Function for sending data to serial port
void chk_isr(void);// ISR Handler
void hi_prioriint(void)// ISR Routine
{
_asm
GOTO chk_isr
_endasm
}
#pragma interrupt chk_isr
void chk_isr(void)
{
if(PIR3bits.CCP3IF)
{
if(start==1)
{
WriteTimer1(00);//Start timer 1 for maximum count
OpenECapture3( CAPTURE_INT_ON & //Initialize CCP for HtoL
EC3_EVERY_FALL_EDGE );
start=0;
highlow=1;
PIR3bits.CCP3IF=0;// Enable interrupt again
}
else
{
if(highlow==1)
{
hightime = ReadECapture3();// Read contents of capture registers
OpenCaEpture3( CAPTURE_INT_ON & //Initialize CCP for LtoH
EC3_EVERY_RISE_EDGE );
highlow=0;
end=1;
PIR3bits.CCP3IF=0;
}
else
if(end==1)
{
totaltime=ReadECapture3();// Read contents of Capture registers
CloseTimer1();// Close timer 1
Send();// Send the measured time values to the serial port
}
}
}
}
void main(void)
{
//OSCCON=0x60;//Internal 4MHz oscillator
ADCON1=0x7f;//Make all pins Digital
//Initiazlize the capture moudule(ccp) for LtoH
OpenECapture3( EC3_EVERY_RISE_EDGE
& CAPTURE_INT_ON );
OpenTimer1( TIMER_INT_OFF &//configure Timer1 for ccp
T1_16BIT_RW &// Can also use Timer3
T1_SOURCE_INT & // Timer1 clock source is internal
T12_SOURCE_CCP &// Make Timer1 source for CCP module
T1_PS_1_1);// No prescaler for timer1
//Initialize USART for tx high time,total time
INTCONbits.GIEH=1;// Enable all interrupts
while(1);// wait here
}
void Send(void)// For sending the times
{
ultoa(hightime,str);// convert integer in to string
ultoa(totaltime,str);// convert integer in to string
CloseECapture3();//
INTCONbits.GIE=0;//Disbale interrupts
while(1);// wait here
}
does any one no how to solve that problem.