Pumpkin User Forums
  PICmicro MCUs
  Salvo + MPLAB-C18 + MPLAB v6.x

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Salvo + MPLAB-C18 + MPLAB v6.x
aek
Moderator
posted July 02, 2003 15:02     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
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:\HTSOFT\PIC18\bin\picc18.exe" -Q -MPLAB -C -E"main.cce" -18C452
"main.c" -O"main.obj" -I"\salvo\tut\tu5\syse" -I"\salvo\tut\tu1" -I"\salvo\inc"
-DMAKE_WITH_FREE_LIB -DUSE_INTERRUPTS -DSYSF -G
Executing: "C:\HTSOFT\PIC18\bin\picc18.exe" -Q -MPLAB -C -E"mem.cce" -18C452
"mem.c" -O"mem.obj" -I"\salvo\tut\tu5\syse" -I"\salvo\tut\tu1" -I"\salvo\inc"
-DMAKE_WITH_FREE_LIB -DUSE_INTERRUPTS -DSYSF -G
Executing: "C:\HTSOFT\PIC18\bin\picc18.exe" -Q -MPLAB -C -E"isr.cce" -18C452
"isr.c" -O"isr.obj" -I"\salvo\tut\tu5\syse" -I"\salvo\tut\tu1" -I"\salvo\inc"
-DMAKE_WITH_FREE_LIB -DUSE_INTERRUPTS -DSYSF -G
Executing: "C:\HTSOFT\PIC18\bin\picc18.exe" -Q -MPLAB -E"tu5lite.lde" -18C452
"C:\salvo\tut\tu5\main.obj" "C:\salvo\src\mem.obj" "C:\salvo\tut\tu1\isr.obj"
"C:\salvo\lib\sfp80lab.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\tut\tu5\sysf\tu5lite.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).]

IP: 63.203.232.106

aek
Moderator
posted June 30, 2003 23:04     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
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.

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

IP: 63.203.232.106

per.norrfors
Junior Member
posted June 30, 2003 03:45     Click Here to See the Profile for per.norrfors     Edit/Delete Message   Reply w/Quote
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:\HTSOFT\PIC18\bin\picc18.exe" -Q -MPLAB -C -E"isr.cce" -18C452 "isr.c" -O"isr.obj" -I"\salvo\tut\tu5\syse" -I"\salvo\tut\tu1" -I"\salvo\inc" -DMAKE_WITH_FREE_LIB -DSYSE -DUSE_INTERRUPTS -G
Warning[000] \salvo\inc\salvo.h 3159 : unknown pragma interrupt
Warning[000] \salvo\inc\salvo.h 3159 : unknown pragma ISRHigh
Warning[000] \salvo\inc\salvo.h 3159 : unknown pragma save=PROD
Warning[000] \salvo\inc\salvo.h 3159 : unknown pragma section
Warning[000] \salvo\inc\salvo.h 3159 : unknown pragma ".tmpdata"
Error[000] C:\salvo\tut\tu1\isr.c 31 : undefined identifier: INTCONbits
Error[000] C:\salvo\tut\tu1\isr.c 31 : struct/union required
Error[000] C:\salvo\tut\tu1\isr.c 31 : struct/union required
Error[000] C:\salvo\tut\tu1\isr.c 31 : logical type required
Error[000] C:\salvo\tut\tu1\isr.c 31 : logical type required
Error[000] C:\salvo\tut\tu1\isr.c 32 : struct/union required
Error[000] C:\salvo\tut\tu1\isr.c 32 : illegal conversion
Warning[000] C:\salvo\tut\tu1\isr.c 39 : unknown pragma code
Warning[000] C:\salvo\tut\tu1\isr.c 39 : unknown pragma IntVectorHigh
Warning[000] C:\salvo\tut\tu1\isr.c 39 : unknown pragma =
Warning[000] C:\salvo\tut\tu1\isr.c 39 : unknown pragma 0x08
Error[000] C:\salvo\tut\tu1\isr.c 43 : undefined identifier: _asm
Error[000] C:\salvo\tut\tu1\isr.c 43 : ; expected
Halting build on first failure as requested.
BUILD FAILED

IP: 217.13.234.18

aek
Moderator
posted June 11, 2003 12:13     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
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\tut\tu5\syse called tu5lite(.mcp). Select the device (18C452) and Tools Suite (MPLAB-C18).

2) Add \salvo\tut\tu5\main.c and \salvo\tut\tu1\isr.c as source files to the project.

3) Add \salvo\lib\sfc18sfa.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\tut\tu5\syse;\salvo\tut\tu1;\salvo\inc

6) Under Project -> Build Options -> Project -> General, set the Library Path to \mcc18\lib

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

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\tut\tu1\main.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\tut\tu1 folder, and \salvo\inc), 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).]

IP: 63.203.232.106

All times are ET

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Pumpkin Home Page

Đ2000-2008 Pumpkin, Inc. All Rights Reserved. Pumpkin and the Pumpkin logo, Salvo and the Salvo logo, The RTOS that runs in tiny places, CubeSat Kit and the CubeSat Kit logo are all trademarks of Pumpkin, Inc. All other trademarks are the properties of their respective owners.


Ultimate Bulletin Board 5.46a