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

Re: writing new application

Postby Hemanth » Tue May 24, 2005 2:02 am

Hi Aek,
it is not necessary for me to run the same code, i want to blink an LED using 12F629 with salvo RTOS, if u have any other program code it is sufficient, i'll glide through the rest, i want initial start up... once i understand what r the files that i have to include and what are the changes i have to make in the files, that is sufficient for me...

thanks and regards,
Hemanth

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

Re: writing new application

Postby Hemanth » Tue May 24, 2005 8:27 am

Hi Aek,
Are you there??
Hemanth
 
Posts: 10
Joined: Thu Apr 21, 2005 11:00 pm
Location: Bangalore, Karnataka, India

Re: writing new application

Postby aek » Wed May 25, 2005 1:39 am

I'm working on it ... please be patient.

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

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

Re: writing new application

Postby aek » Wed May 25, 2005 7:16 am

Hello Hemanth.

I have created your project and having it running in the MPLAB SIM.

Here are the details:

Source Files: Salvo's mem.c and test_12F629.c (below).
Header Files: salvocfg.h (below)
Object Files: (none)
Library Files: Salvo's sfp40aab.lib

test_12F629.c:

code:
#include <pic.h>
#include "salvo.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 */

#define Init() do { T0CS = 0;
PSA = 0;
PS2 = 1;
PS1 = 0;
PS0 = 1;
T0IE = 1;
} while (0)

unsigned int counter;

_OSLabel(TaskBlink1)
_OSLabel(TaskCount1)


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();
}
}

#define TMR_RELOAD 156

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


salvocfg.h:

code:
#define OSUSE_LIBRARY				TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSB
#define OSEVENTS 1
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
#define OSTASKS 2

MPLAB v6.40 + PICCv8.01PL3 Build Resuts:

code:
Deleting intermediary files... done.
Executing: "C:HT-PICinpicc.exe" -C -E"test_12F629.cce" "test_12F629.c" -O"test_12F629.obj" -I"c:salvo ut u1sysa"
-I"c:salvoinc" -Q -MPLAB -12F629
Serial number: HCPIC-xxxxx
Licensed to : ANDREW KALMAN
Executing: "C:HT-PICinpicc.exe" -C -E"mem.cce" "mem.c" -O"mem.obj" -I"c:salvo ut u1sysa" -I"c:salvoinc" -Q -MPLAB -12F629
Serial number: HCPIC-xxxxx
Licensed to : ANDREW KALMAN
Executing: "C:HT-PICinpicc.exe" -E"testF629.lde" "C:salvo ut u1sysa est_12F629.obj" "C:salvosrcmem.obj"
"C:salvolibhtpiccsfp40aab.lib" -O"testF629.cof" -O"testF629.hex" -Q -MPLAB -12F629
Serial number: HCPIC-xxxxx
Licensed to : ANDREW KALMAN

Memory Usage Map:

Program ROM $0000 - $0057 $0058 ( 88) words
Program ROM $0212 - $03FE $01ED ( 493) words
$0245 ( 581) words total Program ROM

Bank 0 RAM $0020 - $002D $000E ( 14) bytes
Bank 0 RAM $0045 - $004D $0009 ( 9) bytes
$0017 ( 23) bytes total Bank 0 RAM

Bank 1 RAM $002E - $0044 $0017 ( 23) bytes total Bank 1 RAM


Program statistics:

Total ROM used 581 words (56.8%)
Total RAM used 46 bytes (71.9%)

Loaded C:salvo ut u1sysa estF629.cof
BUILD SUCCEEDED: Wed May 25 08:09:59 2005


I happened to build the project in salvo ut u1sysa, so the include paths for the project are c:salvo ut u1sysa;c:salvoinc. Naturally, you should build your own project in a different directory.

Note that I did not use main.h -- I defined Init() in test_12F629.c.

Note also that when you use an a-config library (e.g. sfp40aab.lib), OSLIBRARY_CONFIG must be set to OSA in the salvocfg.h. Also, a-config libraries support events (and delays), and so OSEVENTS must be > 0.

I can email you the complete project, etc. if you send an email to support at Pumpkin Inc dot com.

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

[This message has been edited by aek (edited May 25, 2005).]

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

Re: writing new application

Postby aek » Wed May 25, 2005 7:22 am

Oh, one more thing in case you missed it -- you need to download and install the .zip patch to Salvo Lite for PICmicro(R) MCUs -- it contains a new set of sfp40a??.lib libraries that you must use. We made new libraries for the 'F84, but since the 'F629 uses the same Salvo library, you'll need to use them, too.

Regards,

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

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

Re: writing new application

Postby aek » Tue May 31, 2005 6:32 am

Hello Hemanth.

Were you able to get it working?

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

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

Re: writing new application

Postby Hemanth » Wed Jun 01, 2005 8:12 am

Hi Aek,

I was on leave for some days, so i could not test, i'll do it today and send the result..

Thank you very much,
Hemanth

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

Re: writing new application

Postby Phil W » Thu Jun 02, 2005 3:28 am

It sounds like you've included salvo.h in another header file, which you have included in your source file. Thus causing salvo.h to be included twice.

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

Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia

Re: writing new application

Postby Hemanth » Thu Jun 02, 2005 4:21 am

Hi Aek,
i tried with the same code and the configurations you have provided, but i am getting the same set of errors as before..

i extracted the new .lib files into the lib folder and built.. but i am getting same errors.
can you please send me the files whatever you have used to build..
my email ID is hemanth.kumaraswamy@ge.com
this is going to be great help for me..

thanks and regards,
Hemanth

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: _OSeligQP (C:salvosrcmem.obj)
Error[000] C:salvo utlink LEDmem.obj 8 : multiply defined symbol: _OStimerTicks (C:salvosrcmem.obj)

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

Re: writing new application

Postby Hemanth » Sat Jun 04, 2005 1:57 am

Hi Phil, Aek,
i have created a folder called blinkled, and stored in salvo's tut folder. the other folders in this are tut1, tut2, tut3...
i have copied all the related files like salvo.h,mem.c, salvocfg.h in this folder. can i do like this? but i tried configuring the files from both paths, first i linked to the files from this folder then i tried to link with the files where they r stored, ie., mem.c from src folder etc., is there any thing that the salvo related files to be placed in particular folder..?
please help..

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

PreviousNext

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron