Pumpkin, Inc.

Pumpkin User Forums

writing new application

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®).

writing new application

Postby Hemanth » Fri May 20, 2005 2:33 am

Hello All,
i m using MPLAB V6.40 with HITEC PICC.
i configured the compiler and compiled tu4 tutorial. it compiled successfully.
the tutorial is for PIC16F877 micon. i want to use PIC12F629 micon. what changes do i have to make in that project (tu4) such that i can compile it successfully.
i changed the PORT part and configured the device as 12F629 in MPLAB IDE, but i m getting a bunch of errors.
can any one please hep me in this....?
Hemanth
 
Posts: 10
Joined: Thu Apr 21, 2005 11:00 pm
Location: Bangalore, Karnataka, India

Re: writing new application

Postby Hemanth » Fri May 20, 2005 2:53 am

the program is like this..

/*********************************************

this progam is used to blink LED at GPIO5 with 12F629 micon

***********************************************************************/
#include <salvo.h>
#include <pic.h>
#include "main.h"

#define GREEN_LED GPIO5 /* for green LED */
#define RED_LED GPIO4 /* for red LED */
#define TASK_COUNT_P OSTCBP(1) /* task #1 */
#define TASK_BLINK_P OSTCBP(2) /*task #2 */

#define PRIO_COUNT 10 /* task priorities - low */
#define PRIO_BLINK 2 /* task priorities - high */

unsigned int counter;

_OSLabel(TaskCount1)
_OSLabel(TaskBlink1)


void TaskCount(void)
{
for(;
{
counter++;
OS_Yield(TaskCount1);
}
}

void TaskBlink(void)
{
TRISIO=0x08;// set pin 2,3 to output pin 4 to input

GREEN_LED=1;
RED_LED=1;

for(;
{
GREEN_LED ^= 0x01;
OS_Delay(50, TaskBlink1);
}

}


void main(void)
{
Init();

OSInit();

OSCreateTask(TaskCount, TASK_COUNT_P, PRIO_COUNT);
OSCreateTask(TaskBlink, TASK_BLINK_P, PRIO_BLINK);

counter=0;
OSEi();

for(;
OSSched();

}

/*******************************************************************
Interrupt service routine

*********************************************************************/
#include <salvo.h>

#define TMR_RELOAD 156

void interrupt IntVector(void)
{
if(T0IE && T0IF)
{
T0IF =0;
TMR0 -= TMR_RELOAD;
OSTimer();
}
}

Hemanth
 
Posts: 10
Joined: Thu Apr 21, 2005 11:00 pm
Location: Bangalore, Karnataka, India

Re: writing new application

Postby aek » Fri May 20, 2005 5:04 am

quote:
what changes do i have to make in that project (tu4) such that i can compile it successfully.
You'll need to change the Salvo library that you link to ... Table 2 in http://www.pumpkininc.com/content/doc/manual/rm-picc.pdf is normally the table to look at. It does not list the 12F629, so what you must do is look at the Build Results window in MPLAB for a simple PICC project that uses the 12F629, and note the "letter code" that is used in the PICC library. Then, use a Salvo library with the same letter code.

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

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

Re: writing new application

Postby aek » Fri May 20, 2005 5:33 am

To find the PICC "chip code", do this:
code:
picc.exe -chipinfo

You'll see that the 12F629 has a code of 40a.

So, use a Salvo library with the 40a code (like sfp40aab.lib) for use with the 12F629.

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

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

Re: writing new application

Postby aek » Sat May 21, 2005 12:41 am

There is never a need to modify mem.c.

You'll have to uninstall Salvo and re-install it to ensure that you have the original mem.c.

Path problems are solved by adding additional include paths as buil options to the MPLAB project ...

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

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

Re: writing new application

Postby Hemanth » Sat May 21, 2005 2:06 am

Hi Aek,
i tried including the mem.c in source files list..
then it started to flag, cannot open "salvo.h". i modified mem.c and executed, now it is identifying salvo.h and other related headers, but it is giving the same bunch of errors but path from where the error popping is slightly different..

i'll put just few lines of what error i m getting, may be it might help to analyse the exact cause..

this is first three lines..

Error[000] C:salvo utlink LEDmem.obj 8 : multiply defined symbol: _OScTcbP (C:salvosrcmem.obj)
Error[000] C:salvo utlink LEDmem.obj 8 : multiply defined symbol: _OStcbArea (C:salvosrcmem.obj)
Error[000] C:salvo utlink LEDmem.obj 8 : multiply defined symbol: _OSelig


this is first 4 lines due to .lib

Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4F4 (0x4F2+2), size 1, value 0xAE)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4F6 (0x4F2+4), size 1, value 0xAD)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4F8 (0x4F2+6), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression

- hemanth

Hemanth
 
Posts: 10
Joined: Thu Apr 21, 2005 11:00 pm
Location: Bangalore, Karnataka, India

Re: writing new application

Postby Hemanth » Sat May 21, 2005 11:07 am

Hello Aek,
i tried whatever you suggested, but i m getting bunch of errors as below..

i tried configuring to 16F628 and changed the necessary code (just the port in this case) and linked the necessary lib file ie.,40caa and compiled still i m getting the errors..
please help me regarding this..

Error[000] : undefined symbols:
Error[000] : _OStcbArea (C:salvo utlink LEDmain.obj)
Error[000] : _OScTcbP (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] : _OSeligQP (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] : _OSlostTicks (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] : _OSdelayQP (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] : _OSsigQinP (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] : _OStimerTicks (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] : _OSsigQoutP (C:salvolibhtpiccsfp40aaa.lib: init.obj)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4F4 (0x4F2+2), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4F6 (0x4F2+4), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4F8 (0x4F2+6), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4FA (0x4F2+8), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4FC (0x4F2+10), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x4FE (0x4F2+12), size 1, value 0x81)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x500 (0x4F2+14), size 1, value 0x82)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x502 (0x4F2+16), size 1, value 0x83)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x504 (0x4F2+18), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(init.obj) 13 : Fixup overflow in expression (loc 0x506 (0x4F2+20), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(inittask.obj) 19 : Fixup overflow in expression (loc 0x5D2 (0x582+80), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x6E6 (0x6DC+10), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x6E8 (0x6DC+12), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x6F0 (0x6DC+20), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x6F2 (0x6DC+22), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x6FA (0x6DC+30), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x70E (0x6DC+50), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x716 (0x6DC+58), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x71A (0x6DC+62), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x726 (0x6DC+74), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Fixup overflow in expression (loc 0x72E (0x6DC+82), size 1, value 0x80)
Error[000] C:salvolibhtpiccsfp40aaa.lib(sched.obj) 18 : Too many errors
BUILD FAILED: Sat May 21 12:30:55 2005

Hemanth
 
Posts: 10
Joined: Thu Apr 21, 2005 11:00 pm
Location: Bangalore, Karnataka, India

Re: writing new application

Postby aek » Sat May 21, 2005 11:56 am

Hello.

The undefined symbols mean that you do not have salvosrcmem.c in your project. What happens after you add it to your project?

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

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

Re: writing new application

Postby Hemantha » Sun May 22, 2005 12:25 am

Hi Aek,
i uninstalled salvo and tried to build, but still same problem..

in the MPLAB project i m using the following files:

source files: blinkled.c (this is the main program, code is given at the begining of this topic) isr.c (interrupt service routine)
mem.c (attached from src folder in salvo)

header files: salvo.h and salvocfg.h

and in library files: sfp40aaa.lib

can you please copy these into your system and find out it is working or not..?

thanks and regards,
Hemanth

Hemantha
 
Posts: 1
Joined: Sat May 21, 2005 11:00 pm
Location: Bangalore, Karnataka, India

Re: writing new application

Postby aek » Mon May 23, 2005 11:26 am

OK, I'll check it out and get back to you ...

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

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

Next

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 3 guests

cron