Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Please correct C source code for frequency meter(pic16f628a)

Status
Not open for further replies.

ajit123456

Newbie level 3
Joined
Nov 11, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
Hi, I recently downloaded source code in C for frequency meter using pic16f628a.
But when compiling it in MPLAb v8.60 & HITECH C compiler, it shows no. of errors & warnings. Please anyone correct the C code. I'm new in pic project.
 

Attachments

  • Frequency-Counter.zip
    281.1 KB · Views: 138

Hi,

The reason for the numerous errors is due part by the fact the C file was written for the HITECH PIC compiler, however the delay.c file was not included. So you'll have to write your own delay routines.The MPLAB requires a different header file, something like:

Code:
#include <p16f628a.h>

Hence the code at the beginning of the file:

#include <pic.h>
#include <delay.c>

__CONFIG(WDTDIS&PWRTEN&LVPDIS&XT);

By the way including another 'c' file is bad form, you should always write a header file with the function prototypes and include that instead. MPLAB also uses a different CONFIG macro.

If you desire to compile the code in MPLAB or HITECH you'll need to make some changes. I'll download the zip file and make the correction for MPLAB later tonight or tomorrow, as soon as I have the time.

Ciao
 

Thanks guys for your response.
Here is the screenshot of errors.
 

Attachments

  • errors.rar
    51.8 KB · Views: 101

Hi, do you have the correct code for the frequency meter for the pic16f628a? could you send it to me?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top