Pumpkin, Inc.

Pumpkin User Forums

pic f84 errors

If you're having difficulty with Salvo's configuration options, post it here.

pic f84 errors

Postby Salvo Tech Support » Tue Aug 21, 2001 4:48 am

Hi Robert.

The problem lies in mismatch between your application and the salvocfg.h you're using.

If you look at salvo utorial u3main.c, you'll notice that it does not use any events (see its salvocfg.h -- OSEVENTS is 0). Your application uses one semaphore, yet your salvocfg.h has OSEVENTS set to 0. What's happening is salvo.h only references OSecbArea (the event control blocks) if OSEVENTS is non-zero, and so a compile-time error occurs.

You probably just need to change the OSEVENTS lines in your salvocfg.h to

code:
#define OSEVENTS 1

and it should compile OK.

Alternatively, you can just use tutorial u4sysasalvocfg.h instead of salvo utorial u3sysasalvocfg.h. Just copy it to your c: emp est2salvocfg.h.

Note that you can use the code tags (see the section on UBB Code in the Forums faq) when posting code snippets. I added the tags to make it more legible.

Thanks for posting so comprehensively -- I would not have found the problem without looking at your salvocfg.h!

[This message has been edited by Salvo Tech Support (edited August 21, 2001).]

--------
Salvo Technical Support
Please request all tech support through the Forums.
Salvo Tech Support
 
Posts: 173
Joined: Sun Nov 19, 2000 12:00 am

Re: pic f84 errors

Postby srhoar » Tue Aug 21, 2001 9:41 am

When I try to compile for the f84 using semaphores I get a error.
undefined identifier: OSecbArea

Command line: "C:HT-PICBINPICC.EXE -G -O -Zg5 -D24 -DMAKE_WITH_FREE_LIB -E -ASMLIST -FAKELOCAL -16C84 -C -fakelocal -Isalvoinclude -Isalvosource -I emp est2 C:TEMPTEST2TEST2.C"

I include sfp40aab.lib

Code:

code:
//Program: Test2.c
//Author: Robert 'Red' Hoar
//Date: 8-15-2001
//Purpose: To run a simple rtos on a pic 16C84.
// Reads in pin RB0 and places it on RB1


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


#define SEM_PINCHANGE OSECBP(1) //semaphore for rb0 change

_OSLabel (ReadPin_Label) //set up unique labels
_OSLabel (WritePin_Label)

bit pin1; //global variable


void ReadPin(void)
{
while(1)
{
TRISB |=0x01; //set up rb0 for input
if (RB0 != pin1)
{
pin1=RB0; //get rb0 value
OSSignalSem(SEM_PINCHANGE); //Signal other processes to run
}
OS_Yield(ReadPin_Label); //stop this process and let others run
}
}

void WritePin(void)
{
while(1)
{
TRISB &=0b11111101; //set rb1 to output
OS_WaitSem(SEM_PINCHANGE,WritePin_Label); /wait on semaphore (pin change)
RB1 = pin1; //write to rb1
OS_Yield(WritePin_Label); //stop this process and let others run
}
}

void main(void)
{

OSInit(); //Initialize OS

OSCreateTask(ReadPin,OSTCBP(1),10); //Create Tasks,unique#1,Priority 10
OSCreateTask(WritePin,OSTCBP(2),10); //Create Tasks,unique#2,Priority 10

OSCreateSem(SEM_PINCHANGE,0); //Create Semaphore


while(1) //do this forever
{
// ReadPin(); //old way of calling function
// WritePin(); //old way of calling function
OSSched(); //new way, just call OS Scheduler
}
}

void OSIdleTaskHook(void)
{
;
}



Salvocfg.h:

code:
/************************************************************ 
Copyright (C) 1995-2001 Pumpkin, Inc. and its
Licensor(s). Freely distributable.

$Source: C:\RCS\D\salvo\tutorial\tu3\sysa\salvocfg.h,v $
$Author: aek $
$Revision: 1.1 $
$Date: 2001-05-29 22:27:00-07 $

Header file for tutorial programs.

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

#if !defined (MAKE_WITH_FREE_LIB) && !defined (MAKE_WITH_STD_LIB)

/* */
/* configuration options for project that's made using the */
/* source files. */
/* */
#define OSBYTES_OF_DELAYS 1
#define OSCOMPILER OSHT_PICC
#define OSENABLE_SEMAPHORES TRUE
#define OSEVENTS 0
#define OSTARGET OSPIC16
#define OSTASKS 2
#define OSLOC_ALL bank1

#else

/* */
/* configuration options for projects that are made using */
/* either the freeware or standard libraries. Multitasking */
/* with delays and events, events services called only */
/* from background. */
/* */
#define OSUSE_LIBRARY TRUE
#ifdef MAKE_WITH_FREE_LIB
#define OSLIBRARY_TYPE OSF
#elif defined(MAKE_WITH_STD_LIB)
#define OSLIBRARY_TYPE OSL
#endif
#define OSLIBRARY_CONFIG OSM
#define OSLIBRARY_VARIANT OSNONE
#define OSEVENTS 0
#define OSTASKS 2
#endif


Build Results:
Building TEST2.HEX...

Compiling TEST2.C:
Command line: "C:HT-PICBINPICC.EXE -G -O -Zg5 -D24 -DMAKE_WITH_FREE_LIB -E -ASMLIST -FAKELOCAL -16C84 -C -fakelocal -Isalvoinclude -Isalvosource -I emp est2 C:TEMPTEST2TEST2.C"
Enter PICC -HELP for help
Error[000 ] c: emp est2 est2.c 29 : undefined identifier: OSecbArea
Error[000 ] c: emp est2 est2.c 29 : pointer required
Error[000 ] c: emp est2 est2.c 29 : pointer required
Warning[000 ] c: emp est2 est2.c 29 : illegal conversion between pointer types
Error[000 ] c: emp est2 est2.c 40 : undefined identifier: OSecbArea
Error[000 ] c: emp est2 est2.c 40 : pointer required
Error[000 ] c: emp est2 est2.c 40 : pointer required
Warning[000 ] c: emp est2 est2.c 40 : illegal conversion between pointer types
Error[000 ] c: emp est2 est2.c 40 : expression syntax
Error[000 ] c: emp est2 est2.c 54 : undefined identifier: OSecbArea
Error[000 ] c: emp est2 est2.c 54 : pointer required
Error[000 ] c: emp est2 est2.c 54 : pointer required
Warning[000 ] c: emp est2 est2.c 54 : illegal conversion between pointer types

MPLAB is unable to find output file "TEST2.OBJ". This may be due to a compile, assemble, or link process failure.

Build failed.

[This message has been edited by Salvo Tech Support (edited August 21, 2001).]

srhoar
 
Posts: 5
Joined: Mon Aug 13, 2001 11:00 pm
Location: arlington,tx,usa

Re: pic f84 errors

Postby srhoar » Wed Aug 22, 2001 2:25 am

Thank you. This really helped. I got everything working fine.

Is there a big change to go down to
pic16C84 vice the pic16F84.

It seems everything compiles fine for the F but not the C

I added the

code:

#define OSPIC16_GIE_BUG TRUE


to salvocfg.h

I get an error:
Command line: "C:HT-PICBINPICC.EXE -G -INTEL -Mtest2.map -16C84 -oTEST2.HEX -fakelocal -Isalvoinclude -Isalvosource TEST2.OBJ C:SALVOLIBRARYSFP40AAB.LIB "
Enter PICC -HELP for help
Error[000 ] : Can't find 0x2 words (0x2 withtotal) for psect code_ptr in segment BANK0
Exit status = 1

[This message has been edited by srhoar (edited August 22, 2001).]

srhoar
 
Posts: 5
Joined: Mon Aug 13, 2001 11:00 pm
Location: arlington,tx,usa

Re: pic f84 errors

Postby aek » Wed Aug 22, 2001 7:26 am

I think you've run out of ROM, though I'm not 100% sure with that error message. The 16F84 has only 1024 instructions in ROM, so fitting a Salvo application in there is a bit of a stretch -- we generally recommend PICs with >= 2K ROM.

But that doesn't help you, does it? So let's see what we can do ...

I see you're using Salvo Lite. That doesn't leave too many opportunities.

1) Your application (at least what's shown below, don't know what it's grown into) doesn't call OS_Delay(). Therefore you don't need any of the delay services. But sfp40Aab.lib has them in there ... Use sfp40Aeb.lib instead (events but no delays). Note that you should have

code:
#define OSLIBRARY_CONFIG  OSE
#define OSLIBRARY_VARIANT OSB

for this "eb" library.

2) Another thing you can do is remove the call to OSInit() ... but you must clear the RAM in bank1 to all 0's at the beginning of main() if you choose to do this, because the compiler won't do it for you. The Salvo variables used in the libraries are declared as persistent, and therefore the usual PICC startup code won't touch them. OSInit() is a lot bigger than PICC's start initializer code, so the code should shrink. You can use the clear_ram() function that PICC provides as startup code. If it's not present in your MPLAB Program Memory window, then add an unused global variable to your program and it will be. I don't know what the parameter list for clear_ram() looks like ...

3) You don't need the OSPIC16_GIE_BUG config option. There's nothing in your main() that uses it, and the library's services are already compiled with it, and AFAIK the F84 doesn't suffer from this problem anyway.

4) A Salvo application compiled for the 16C84 should run on the 16F84, and vice versa. There's no difference in either the Salvo or PICC libraries ...

I compiled the v2.3 salvo utorial u4sysa u4free.pjt for both the 16C84 and the 16F84 and they were the same size, ROM- and RAM-wise. So I don't know or understand why you get a difference between them. How much ROM did it use when it successfully compiled for the 16C84?

[This message has been edited by aek (edited August 22, 2001).]

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

Re: pic f84 errors

Postby aek » Wed Aug 22, 2001 7:27 am

Oh -- if you manually clear out bank1 RAM instead of using OSInit(), the built-in idle task won't run. But you're not using it, so that should be OK.

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

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

Re: pic f84 errors

Postby tbims23822 » Tue Jul 07, 2009 10:45 am

www.drop-shopping.com is a premium website for cheap air jordans shoes and other more really nike air jordan shoes.We have varity of cheap air jordan shoes available for wholesale.Cheap China wholesale shoes including cheap Nike shoes and cheap jordan shoes,nike sneakers,nike sneakers discount,air jordan sneakers,air force sneakers.We supply nike sneakers,jordan sneakers,air jordan sneakers,air force sneakers wholesale.You can buy very cheap jordans shoes including cheap women shoes,cheap nike shoes,cheap running shoes from us.
tbims23822
 

Re: pic f84 errors

Postby tbims23822 » Wed Jul 08, 2009 11:33 am

www.drop-shopping.com is a premium website for cheap air jordans shoes and other more really nike air jordan shoes.We have varity of cheap air jordan shoes available for wholesale.Cheap China wholesale shoes including cheap Nike shoes and cheap jordan shoes,nike sneakers,nike sneakers discount,air jordan sneakers,air force sneakers.We supply nike sneakers,jordan sneakers,air jordan sneakers,air force sneakers wholesale.You can buy very cheap jordans shoes including cheap women shoes,cheap nike shoes,cheap running shoes from us.
tbims23822
 

Re: pic f84 errors

Postby tbims23822 » Wed Jul 08, 2009 11:40 am


www.drop-shopping.com is a premium website for cheap air jordans shoes and other more really nike air jordan shoes.We have varity of cheap air jordan shoes available for wholesale.Cheap China wholesale shoes including cheap Nike shoes and cheap jordan shoes,nike sneakers,nike sneakers discount,air jordan sneakers,air force sneakers.We supply nike sneakers,jordan sneakers,air jordan sneakers,air force sneakers wholesale.You can buy very cheap jordans shoes including cheap women shoes,cheap nike shoes,cheap running shoes from us.
tbims23822
 


Return to Configuration

Who is online

Users browsing this forum: No registered users and 3 guests

cron