This document provides an overview of the migration
process from MPLAB® C Compiler for PIC18 MCUs
(formerly, and referred to here as, MPLAB C18) and
MPLAB XC8 C Compiler, so that you may judge the
effort required to convert your project.
이 문서는 제공한다. an overview를 of 이주절차
from C18로 부터
and XC8로부터
so that 넌 아마 판단할것이다. the 효과를 요구되는 to 변경하는데 네 프로젝트를.
MPLAB C18 is nearing end of life. When working with
MPLAB C18 projects, you can continue to use the legacy
compiler, temporarily compile the project in the
MPLAB XC8’s C18 compatibility mode, or migrate the
project to the native MPLAB XC8 settings and syntax.
C18은 가까이있다. 지원종료(=end of life)에.
when 작업할때 with C18프로젝트로, 넌 can 계속to사용할수있다. legacy compiler를,
일시적으로 컴파일하는 the 프로젝트를 in XC8의 C18 호환성에서,
혹은 (can) 이전시킬수있다. the 프로젝트를 to the native XC8세팅s 와 문법들로.
The latter is recommended if the project is to be further
developed.
Technical details of the changes to source code and
options are described in the “MPLAB® C18 to MPLAB
XC8 C Migration Guide” (DS52118). In summary, the
process consists of the following steps:
1. Create a new project
There is no automated process that can convert
existing MPLAB C18 projects.
2. Add in the source files
Only C and assembly source is read by MPLAB
XC8. You must obtain source code for object or
library routines used by your project.
3. Confirm the compiler options
The default compiler (or MPLAB X IDE plugin)
options, will be suitable for most projects.
4. Build, working through warnings and errors
Most incompatible features will trigger errors in
MPLAB XC8, which you can work through.
5. Convert the source code
Source code must have MPLAB XC8 C Compiler
native syntax. Conversion is a manual process,
but most existing code will compile as-is.
To assist the conversion, make use of compiler-defined
preprocessor macros to maintain both original and
modified code. Consider the following observations
when converting the code.
1. ANSI compliant code will require no change
This covers most code.
2. Review code making assumptions about
implementation-defined behavior
Behavior differences are summarized in the
migration document. Both compilers’ user’s
guides describe their implementation-defined
behavior.
3. Device-dependent code largely remains
identical
For both compilers, the special function register
and Configuration bit names are derived from
the same database. Differences may occur
when migrating from early versions of MPLAB
C18. The means of accessing SFRs and
Configuration bits is identical.
In the following situations, the required MPLAB XC8
code might be structured differently than that for
MPLAB C18. Before you try to mimic the MPLAB C18
keywords, consider that MPLAB XC8 may have an
easy way of doing what you need.
1. Pointers are handled differently
MPLAB XC8 does not use pointer memory models,
nor are pointer qualifiers used. You do not
need to write multiple function variants that take
pointer arguments.
2. Interrupt code is defined by one function
Typically, a single keyword creates the interrupt
function and all the context switch code.
3. Use alternative ways to allocate objects
Consider absolute objects or bank qualifiers
before creating user-defined sections.
4. Stack allocation of variables is different
The stack used for variables can only be specified
at the function level. Typically, you do not
need to use any specifiers or options to obtain
the best implementation when using MPLAB
XC8.
5. Linker scripts are not used
The default MPLAB XC8 linker options will be
suitable for most projects. Linker options can be
expanded or adjusted; but, with caution.
6. Preprocessor macros cannot have variable
argument lists
If you use these, you will need to use alternate
macros or a function.
7. Assembly code is not portable
You will need to review any hand-written assembly
code. There are differences in assembly
instruction syntax, assembler directives, and the
general structure of assembly code.
========================================================
▼C18 V3.46버젼 분할압축
mplabc18-v3.46-windows-upgrade-installer.vol1.egg
mplabc18-v3.46-windows-upgrade-installer.vol2.egg
mplabc18-v3.46-windows-upgrade-installer.vol3.egg
mplabc18-v3.46-windows-upgrade-installer.vol4.egg
mplabc18-v3.46-windows-upgrade-installer.vol5.egg
mplabc18-v3.46-windows-upgrade-installer.vol6.egg
mplabc18-v3.46-windows-upgrade-installer.vol7.egg
mplabc18-v3.46-windows-upgrade-installer.vol8.egg