Pumpkin, Inc.

Pumpkin User Forums

BANKS in PIC18 definitions and OSLOC..

If you think you've found a bug or other mistake in your Salvo distribution, post it here.

BANKS in PIC18 definitions and OSLOC..

Postby luben » Fri Jan 04, 2002 8:38 am

Hello,

I think that you have a small bug in SALVO 2.2. Or let's say not bug, but a door from where if you're not very consiouse you can wrong the project.

Last week I finished a graphic thermal printer project with PIC16F876/20. Became very smart and reliable, works under Windows and DOS, even prints from DOS 5 types of BAR CODES.

After I finished the project I wanted to move on 18C252 processor. And I lost 4 days before I got why I received multiple errors in project, especially in salvo.h

I just forgot to remove from salvocfg.h the OSLOC.. definition. In 18XXX there is no banking at all, but OSLOC is connected and included to all SALVO definitions. Because there is no checking for target processor around OSLOC big mess could appear.

My suggestion is:
if PIC18 processor or other bankfree processor is defined then all OSLOC should be undefined and redefined like empty strings. This will prevent the user from leaving the highway and to crash in the somewhere. I think that such redefinitions are not big deal and could be done easyly.

As I told you, this is not exactly bug, but a door from where mistakes can pass easy.

Regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: BANKS in PIC18 definitions and OSLOC..

Postby aek » Sat Jan 05, 2002 3:02 am

Hi Luben.

You raise an interesting point ... but here's why OSLOC_XYZ is required on the PIC18 (and on the 8051, and on other processors, too):

On the PIC12/PIC16/PIC17, OSLOC_XYZ is usually used to set the appropriate bank, e.g. bank3. But it's more general than that -- it can be used to set something to be persistent, for example, or persistant bank2, etc. On the PIC17 there's a far qualifier.

On the PIC18, there are no banks, but there are near, persistent, and other qualifiers that can be used. On the 8051 it's xdata, idata, pdata, etc.

Perhaps we should bring it to HI-TECH's attention that PICC-18 accepts PICC's bank qualifiers when it shouldn't ...

I think I was burned by this a while back -- I'll try to add a "porting checklist" to the manual for exactly this sort of problem.

Regards,

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

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

Re: BANKS in PIC18 definitions and OSLOC..

Postby luben » Sat Jan 05, 2002 7:08 am

Hello,

As I told you, this is not exactly bug. But I lost several days finding nonexisting errors in salvo.h - was something like undefined type and missing ; - the error messages didn't bring any sign of the real reason of the mistakes. After I began to seek the missing type I got that in the definition of portpic.h you use OSLOC...

I think that you could avoid this by adding some check in salvo.h or to bring attention message into OSLOC explanation - in both cases the user can avoid my "dead lock".

For sure will be better if HiTech brings error messages for bank definitions. Yes, I see now that this is more HiTech problem then SALVO.

Hope we'll enjoy soon the SALVO2.3.

Regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron