• AVR Freaks

Hot!XC8 Beginning problem

Author
gunzelg
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2004/04/26 05:34:00
  • Status: offline
2019/04/04 03:02:59 (permalink)
0

XC8 Beginning problem

Hello
i have a new project, where i want to use the PIC16F18875. For that I bought the Curiosity HPC board, where this PIC is already on it. I installed the actual MPLAB X and the XC8-Compiler. Than I made a new project for thie PIC. The IDE generates some files. One of it is interupt.c. When i now try to make this project, than I get errors from this file:
 

void interrupt isr()
{
   
}


 
/////
        
Can somebody tell me, what is wrong with the interupt.c-File?
 
    regards
    Gerhard
 
#1

10 Replies Related Threads

    rodims
    Super Member
    • Total Posts : 1478
    • Reward points : 0
    • Joined: 2009/02/10 11:08:59
    • Location: 51.9627, 7.6262
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 03:22:38 (permalink)
    +1 (1)
    errors ?
    #2
    mbrowning
    Just a Member
    • Total Posts : 1315
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 03:27:03 (permalink)
    +1 (1)
    What xc8 version and what mode (c90 or c99)? Syntax changed some with the new c99 mode which is default so maybe try changing to c90 mode which is compatible with older versions.

    Oh well - there's always next year
    #3
    gunzelg
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2004/04/26 05:34:00
    • Status: offline
    Re: XC8 Beginning problem 2019/04/04 03:32:55 (permalink)
    0
    Sorry,
    here the error report:
    make[2]: Entering directory 'C:/Users/gun/MPLABXProjects/pic16_4mp1.X'
    "C:\Program Files\Microchip\xc8\v2.05\bin\xc8-cc.exe"  -mcpu=16F18875 -c  -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -Wa,-a -DXPRJ_XC8_PIC16F18875=XC8_PIC16F18875  -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto     -o build/XC8_PIC16F18875/production/interrupts.p1 interrupts.c
    make[2]: *** [build/XC8_PIC16F18875/production/interrupts.p1] Error 1
    make[1]: *** [.build-conf] Error 2
    make: *** [.build-impl] Error 2
    interrupts.c:24:6: error: variable has incomplete type 'void'
    void interrupt isr()
         ^
    interrupts.c:24:15: error: expected ';' after top level declarator
    void interrupt isr()
                  ^
                  ;
    2 errors generated.
    (908) exit status = 1
    nbproject/Makefile-XC8_PIC16F18875.mk:146: recipe for target 'build/XC8_PIC16F18875/production/interrupts.p1' failed
    make[2]: Leaving directory 'C:/Users/gun/MPLABXProjects/pic16_4mp1.X'
    nbproject/Makefile-XC8_PIC16F18875.mk:90: recipe for target '.build-conf' failed
    make[1]: Leaving directory 'C:/Users/gun/MPLABXProjects/pic16_4mp1.X'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

    BUILD FAILED (exit value 2, total time: 455ms)
     
    regards
    #4
    gunzelg
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2004/04/26 05:34:00
    • Status: offline
    Re: XC8 Beginning problem 2019/04/04 03:34:55 (permalink)
    0
    And xc8-Version is 2.05;
    (c90 or c99)? I dont know. Where do i find that?
    Sorry. My last experiances with MPLAB are more than10 years old. And there have been many changes since that time....
    Gerhard
    #5
    pcbbc
    Super Member
    • Total Posts : 905
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 03:43:45 (permalink)
    0
    I beleive the c99 syntax with the 2.00 compiler is now...
    void __interrupt isr()
    {
       
    }

    See 2.05 changes.
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 17236
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 05:37:24 (permalink)
    +1 (1)
    The default is C99. If you want C90 (like 10 years ago) is in the project settings under compiler
    #7
    qhb
    Superb Member
    • Total Posts : 9966
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 05:49:01 (permalink)
    +1 (1)
    pcbbc
    I beleive the c99 syntax with the 2.00 compiler is now...
    void __interrupt isr()
    {   
    }


    Close, it's actually
    void __interrupt() isr()
    {   
    }

    #8
    katela
    Super Member
    • Total Posts : 1228
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 07:27:35 (permalink)
    +1 (1)
    gunzelg
    And xc8-Version is 2.05;
    (c90 or c99)? I dont know. Where do i find that?
    Gerhard

     
    XC8 global options properties: http://microchipdeveloper.com/xc8:moving-to-xc8-2-0
    New Interrupt Syntax in MPLAB® XC8: https://youtu.be/srUf-BkmS4k
     

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #9
    NKurzman
    A Guy on the Net
    • Total Posts : 17236
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: XC8 Beginning problem 2019/04/04 10:30:51 (permalink)
    0
    Being you have a mis-Match.  What Version of MCC are you Using? Are You using the Compiler that You Version of MCC Recommends?
    #10
    gunzelg
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2004/04/26 05:34:00
    • Status: offline
    Re: XC8 Beginning problem 2019/04/10 05:17:33 (permalink)
    0
    Hello
    thanks, Interrupt works now (thanks to qhb)
    "In former times everything was better", I could think. The old MPLAB 7.50 was much easier to handle. The new Mplab X seems to be very powerful, but also confusing and intransparent. The use of MCC is also confusing. I think its my last project using MPLAB before i am retired.
    regards
    Gerhard
    #11
    Jump to:
    © 2019 APG vNext Commercial Version 4.5