Pumpkin, Inc.

Pumpkin User Forums

Salvo + MPLAB-C18 + MPLAB v6.x

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Salvo + MPLAB-C18 + MPLAB v6.x

Postby aek » Wed Jun 11, 2003 11:13 am

Below is an overview of getting Salvo v3.1.0 to work with MPLAB-C18 and MPLAB v6.x.

The next release of Salvo will include projects for MPLAB-C18 and MPLAB v6.x.

******************

Here's what I had to do to get Salvo tutorial tu5 for MPLAB-C18 to work with MPLAB v6.2:

1) From a clean install, create a new project for the 'C452 in salvo ut u5syse called tu5lite(.mcp). Select the device (18C452) and Tools Suite (MPLAB-C18).

2) Add salvo ut u5main.c and salvo ut u1isr.c as source files to the project.

3) Add salvolibsfc18sfa.lib as a library to the project.

4) Add the appropriate linker script to the project.

5) Under Project -> Build Options -> Project -> General, set the Include Path to salvo ut u5syse;salvo ut u1;salvoinc

6) Under Project -> Build Options -> Project -> General, set the Library Path to mcc18lib

7) Under Project -> Build Options -> Project -> General, set the Linker-Script Path to mcc18lkr

8) Under Project -> Build Options -> Project -> MPLAB-C18 -> Macro Definitions, you need to Add three symbols: MAKE_WITH_FREE_LIB, SYSE, and USE_INTERRUPTS. Also, ensure that the Procedural Abstraction optimizationa are disabled (-Opa-).

N.B. The symbols MAKE_WITH_FREE_LIB and SYSE are required for all six tutorial projects tu1-tu6 when using Salvo Lite. The symbol USE_INTERRUPTS is only required / appropriate for tutorials tu5 and tu6.

You should then be able to build the project.

For an alternative chip, e.g. the PIC18F452, normally all you would do is change the device (Configure -> Select Device) and the linker script file. However, If you do so and rebuild, MPLAB-C18 will complain about T0PS3 being improper for the 'F452. What happened is when Salvo v3.1.0 was released, there was a disparity among the various MPLAB-C18 header files. Apparently this has now been fixed, and for a successful build with the 'F452 and tu5 you'll need to change the appropriate line in salvo ut u1main.h:

code:
#if  defined(SYSE)        // MPLAB-C18 uses different nomenclature
#if defined(__18C242) || defined(__18C252) || defined(__18C442)
|| defined(__18C452) || defined(__18F248) || defined(__18F258)
|| defined(__18F448) || defined(__18F458)
#define Init() { T0CONbits.T0CS = 0;
T0CONbits.T0PS0 = 1;
T0CONbits.T0PS1 = 0;
T0CONbits.T0PS2 = 1;
T0CONbits.PSA = 0;
INTCONbits.TMR0IE = 1; }
#elif defined(__18C601) || defined(__18C658) || defined(__18C801)
|| defined(__18C858) || defined(__18F010) || defined(__18F020)
|| defined(__18F242) || defined(__18F252) || defined(__18F442)
|| defined(__18F452)
#define Init() { T0CONbits.T0CS = 0;
T0CONbits.T0PS0 = 1;
T0CONbits.T0PS1 = 0;
T0CONbits.T0PS2 = 1;
T0CONbits.T0PS3 = 0; << change this line to read T0CONbits.PSA = 0;
INTCONbits.TMR0IE = 1; }
#endif

The salient point here in using MPLAB-C18 with MPLAB v6.x is that there is no need (barring the header-file issue I mention above) to edit any of the existing Salvo files for a successful build. Rather, paths need to be set properly (the tutorial projects reference the current project's folder, the salvo ut u1 folder, and salvoinc), source files and Salvo libraries need to be added to the project, and symbols (e.g. SYSE) must be defined for the source files as command-line options that are passed to the compiler.

Regards,


------------------

[This message has been edited by aek (edited June 12, 2003).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Salvo + MPLAB-C18 + MPLAB v6.x

Postby per.norrfors » Mon Jun 30, 2003 2:45 am

Here is what I got if I try to follow your instructions above.

The only thing I can´t setup is the Linker-Script-Path, because it´s greymarked.

Best regards
Per

Deleting intermediary files... done.
Executing: "C:HTSOFTPIC18inpicc18.exe" -Q -MPLAB -C -E"isr.cce" -18C452 "isr.c" -O"isr.obj" -I"salvo ut u5syse" -I"salvo ut u1" -I"salvoinc" -DMAKE_WITH_FREE_LIB -DSYSE -DUSE_INTERRUPTS -G
Warning[000] salvoincsalvo.h 3159 : unknown pragma interrupt
Warning[000] salvoincsalvo.h 3159 : unknown pragma ISRHigh
Warning[000] salvoincsalvo.h 3159 : unknown pragma save=PROD
Warning[000] salvoincsalvo.h 3159 : unknown pragma section
Warning[000] salvoincsalvo.h 3159 : unknown pragma ".tmpdata"
Error[000] C:salvo ut u1isr.c 31 : undefined identifier: INTCONbits
Error[000] C:salvo ut u1isr.c 31 : struct/union required
Error[000] C:salvo ut u1isr.c 31 : struct/union required
Error[000] C:salvo ut u1isr.c 31 : logical type required
Error[000] C:salvo ut u1isr.c 31 : logical type required
Error[000] C:salvo ut u1isr.c 32 : struct/union required
Error[000] C:salvo ut u1isr.c 32 : illegal conversion
Warning[000] C:salvo ut u1isr.c 39 : unknown pragma code
Warning[000] C:salvo ut u1isr.c 39 : unknown pragma IntVectorHigh
Warning[000] C:salvo ut u1isr.c 39 : unknown pragma =
Warning[000] C:salvo ut u1isr.c 39 : unknown pragma 0x08
Error[000] C:salvo ut u1isr.c 43 : undefined identifier: _asm
Error[000] C:salvo ut u1isr.c 43 : ; expected
Halting build on first failure as requested.
BUILD FAILED

per.norrfors
 
Posts: 4
Joined: Sun Jun 29, 2003 11:00 pm

Re: Salvo + MPLAB-C18 + MPLAB v6.x

Postby aek » Mon Jun 30, 2003 10:04 am

Hi Per.

The problem that springs to mind immediately is that you are using a project in SYSE as the basis for your test, but SYSE is for the MPLAB-C18 compiler.

SYSF is for PICC-18, so you need a -DSYSF instead of a -DSYSE.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Salvo + MPLAB-C18 + MPLAB v6.x

Postby aek » Wed Jul 02, 2003 2:02 am

Hi Per.

Using PICC-18, I built a MPLAB v6 project for tutorial 5 (tu5) by following the earlier instructions for MPLAB-C18, with the following exceptions:

i) No need to add a linker script (#4 below)

ii) No need for a library path (#6 below)

iii) No need for a linker script path (#7 below)

iv) Define SYSF instead of SYSE (#8 below)

Build Results are as follows:

code:
Deleting intermediary files... done.
Executing: "C:HTSOFTPIC18inpicc18.exe" -Q -MPLAB -C -E"main.cce" -18C452
"main.c" -O"main.obj" -I"salvo ut u5syse" -I"salvo ut u1" -I"salvoinc"
-DMAKE_WITH_FREE_LIB -DUSE_INTERRUPTS -DSYSF -G
Executing: "C:HTSOFTPIC18inpicc18.exe" -Q -MPLAB -C -E"mem.cce" -18C452
"mem.c" -O"mem.obj" -I"salvo ut u5syse" -I"salvo ut u1" -I"salvoinc"
-DMAKE_WITH_FREE_LIB -DUSE_INTERRUPTS -DSYSF -G
Executing: "C:HTSOFTPIC18inpicc18.exe" -Q -MPLAB -C -E"isr.cce" -18C452
"isr.c" -O"isr.obj" -I"salvo ut u5syse" -I"salvo ut u1" -I"salvoinc"
-DMAKE_WITH_FREE_LIB -DUSE_INTERRUPTS -DSYSF -G
Executing: "C:HTSOFTPIC18inpicc18.exe" -Q -MPLAB -E"tu5lite.lde" -18C452
"C:salvo ut u5main.obj" "C:salvosrcmem.obj" "C:salvo ut u1isr.obj"
"C:salvolibsfp80lab.lib" -O"tu5lite.cof"

Memory Usage Map:

Program ROM $000000 - $000003 $000004 ( 4) bytes
Program ROM $000008 - $00099B $000994 ( 2452) bytes
$000998 ( 2456) bytes total Program ROM

RAM data $0000F4 - $0000FF $00000C ( 12) bytes
RAM data $0005BC - $0005FF $000044 ( 68) bytes
$000050 ( 80) bytes total RAM data

Near RAM $000000 - $00000F $000010 ( 16) bytes total Near RAM


Program statistics:

Total ROM used 2456 bytes (7.5%)
Total RAM used 96 bytes (6.2%) Near RAM used 16 bytes (12.5%)

Loaded C:salvo ut u5sysf u5lite.cof
BUILD SUCCEEDED


I'll zip up the project and post it shortly to the v3.1 Salvo Lite for PICmicro(R) MCUs download area ...

Regards,

------------------

[This message has been edited by aek (edited July 02, 2003).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron