Pumpkin, Inc.

Pumpkin User Forums

Rebuild Libraries with Different Bank?

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

Rebuild Libraries with Different Bank?

Postby Unregistered User » Fri Jul 19, 2002 8:37 am

Dear Sirs,

We bought Salvo Pro for the PIC.

Now I'd like to change the bank where Salvo variables are located and build my own libraries. I can build the libraries but how can I configure them?

Yours faithfully,

Unregistered User
 
Posts: 36
Joined: Thu Aug 09, 2001 11:00 pm

Re: Rebuild Libraries with Different Bank?

Postby aek » Fri Jul 19, 2002 8:51 am

Hello.

It's pretty easy. I assume you're using PICC and PIC16 PICmicros.

1) In salvoincsalvolib.h, find this piece of code:

code:
/*                                                          */
/* Begin PIC16 library special settings and overrides */
/* */
#elif ( OSTARGET == OSPIC16 )

#define OSCLEAR_WATCHDOG_TIMER() asm(" clrwdt")
#if (_BANKBITS_ == 0)
#define OSLOC_ALL persistent
#else
#define OSLOC_ALL bank1 persistent
#endif


and change the second OSLOC_ALL definition to whatever you want, e.g.
code:
#define OSLOC_ALL                       bank3 persistent

and then rebuild the libraries using make. Note that you can even spread the Salvo variables across multiple banks, e.g.
code:
#define OSLOC_ALL                       bank3 persistent
#define OSLOC_ECB bank2 persistent

will place all of Salvo's variables in bank3, except for the event control blocks, which will be in bank2. With this method, you can have more than 96 bytes (PIC16F877 or equivalent) of Salvo variables.

You'll have to make these changes whenever you update your version of Salvo, not just when you want to build your own custom libraries. That's because salvolib.h is used in each project that requires a library, and any mismatch between the library and the salvolib.h will cause errors when compiling and/or linking.

Regards,

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

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

-------
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