• AVR Freaks

Hot!Upgrading code from XC8 v1.30 to XC8 v2.10

Author
AEOber
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2020/03/16 01:08:46
  • Location: 0
  • Status: offline
2020/03/17 07:44:30 (permalink)
0

Upgrading code from XC8 v1.30 to XC8 v2.10

Hi all,
I am using MPLAB X IDE v5.35.
I am trying to update a project from years ago that works and compiles correctly using XC8 v1.30.
The original project used a 20-pin PIC18F1320, which is now unsupported in the latest compiler and in MCC.
I am considering changing to a PIC18F14K22 which is supported in MCC. I am now trying to get the original code working. I reassigned all the pins to the new PIC's pins using MCC. Everything seems to be working in the code accept for the following:
 
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW ,12);

These commands are only used to initialize communication.  Is there something in MCC that I might be missing? Or is there a library that I have to include? The old program file had the usart.h included but this is not recognized when I compile using XC8 v2.10. 
The old project also included a delay.h file, are the delay functions now generated by MCC?

Many thanks for any help!
MoonPea
#1

5 Replies Related Threads

    katela
    Super Member
    • Total Posts : 1745
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: Upgrading code from XC8 v1.30 to XC8 v2.10 2020/03/18 09:07:50 (permalink)
    +2 (2)
    Those PIC18F peripheral libraries and are no longer supported in XC8 from version v.2.0
    So your code won't work in v2.10.
    But MCC can generate new library codes for you, read this article to learn more: https://microchipdeveloper.com/mcu1101:project-12

    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
    #2
    du00000001
    Just Some Member
    • Total Posts : 3665
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Upgrading code from XC8 v1.30 to XC8 v2.10 2020/03/18 13:05:50 (permalink)
    +2 (2)
    Might be somewhat trickier if the PIC18F1320 is to be used furthermore, but not impossible:
    • Any 8-Bit PIC is expected to be supported by the latest XC8 versions.
    • It's only MCC that's not supporting older derivatives.
    The workaround is to select a similar derivative that is supported, creating a project that is intended for the sole purpose to generate the MCC output. Subsequently you may have to somewhat modify the file generated (depending on the degree of similarity between the supported and the unsupported device). Best practice to copy the generated file(s) to the project to be ported, editing it there. Not as easy as just using MCC, but doable.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    katela
    Super Member
    • Total Posts : 1745
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: Upgrading code from XC8 v1.30 to XC8 v2.10 2020/03/18 13:19:08 (permalink)
    0
    The op said he/she is considering the PIC18F14K22 which is supported by mcc

    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
    #4
    AEOber
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/03/16 01:08:46
    • Location: 0
    • Status: offline
    Re: Upgrading code from XC8 v1.30 to XC8 v2.10 2020/03/18 22:40:30 (permalink)
    +1 (1)
    Hi, 

    Thank you both for the information.
    I have decided to just start from scratch and used the old code as a guide of what needs to be done. Much simpler than trying to force it to work.



    #5
    Hen
    Starting Member
    • Total Posts : 51
    • Reward points : 0
    • Joined: 2018/10/24 04:01:44
    • Location: 0
    • Status: offline
    Re: Upgrading code from XC8 v1.30 to XC8 v2.10 2020/04/05 01:35:56 (permalink)
    0
    Maybe off-topic.
     
    I've reach a void pointer where I'm downgrading my work towards MCC18.
    After alot of time invested and a XC8 PRO license I just cannot get things done my way, probably cause I suck at this...
    I have thrown the K42 chips (which don't work well at all with MCC18) in the write only storage and put the new kid Q43 on the stage.
    Apart from the LFSR instruction which can be avoided all things semes good.
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5