+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Newbie level 3
    Points: 800, Level: 6

    Join Date
    Nov 2010
    Posts
    3
    Helped
    0 / 0
    Points
    800
    Level
    6

    Please correct C source code for frequency meter(pic16f628a)

    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.

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 33,613, Level: 44
    ckshivaram's Avatar
    Join Date
    Apr 2008
    Location
    villingen (Germany) / Bangalore
    Posts
    5,070
    Helped
    2158 / 2158
    Points
    33,613
    Level
    44
    Blog Entries
    1

    Re: Please correct C source code for frequency meter(pic16f628a)

    Your compiler version may be wrong.

    can you take snapshot of errors or put down the error list also
    " It is so simple to be happy,
    but it is so difficult to be simple"



    •   AltAdvertisement

        
       

  3. #3
    Administrator
    Points: 69,512, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2358 / 2358
    Points
    69,512
    Level
    64
    Blog Entries
    4

    Re: Please correct C source code for frequency meter(pic16f628a)

    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 
    Hence the code at the beginning of the file:

    #include
    #include

    __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



    •   AltAdvertisement

        
       

  4. #4
    Newbie level 3
    Points: 800, Level: 6

    Join Date
    Nov 2010
    Posts
    3
    Helped
    0 / 0
    Points
    800
    Level
    6

    Re: Please correct C source code for frequency meter(pic16f628a)

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



  5. #5
    Newbie level 1
    Points: 13, Level: 1

    Join Date
    May 2013
    Posts
    1
    Helped
    0 / 0
    Points
    13
    Level
    1

    Re: Please correct C source code for frequency meter(pic16f628a)

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



--[[ ]]--