Searching \ for 'PSW C compiler and Bank Changing' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=bank
Search entire site for: 'PSW C compiler and Bank Changing'.

Truncated match.
PICList Thread
'PSW C compiler and Bank Changing'
1997\06\07@182701 by Aydin Yesildirek

flavicon
face
I am trying to make my first PIC software work.

Everything looks great if my program memory remains within bank 0
region. If try to add something fancy and use some of the bank 1's
2K memory I am getting wrong bank referencing and my program is
crashing. I have tested different functions separetely first, they
work fine. But when I add them up, using 50% of ROM space this
is crashing my system. I complied everything with PCW C.

Anyone out there have a similar experience your comments will be
greatly appreciated.

aydin

1997\06\07@191344 by Andy Kunz

flavicon
face
At 05:22 PM 6/7/97 +0000, you wrote:
>I am trying to make my first PIC software work.
>
>Everything looks great if my program memory remains within bank 0
>region. If try to add something fancy and use some of the bank 1's
>2K memory I am getting wrong bank referencing and my program is
>crashing. I have tested different functions separetely first, they
>work fine. But when I add them up, using 50% of ROM space this
>is crashing my system. I complied everything with PCW C.
>
>Anyone out there have a similar experience your comments will be
>greatly appreciated.

Check your list file.

I have found this to be _ESSENTIAL_ with the PCW compiler.  Sometimes it
flat out generates the wrong code.

If you can't find it that way, send CCS your source code.  They are usually
pretty good about customer service.

You'll need to let them know what version it is you are using.

And possibly a better description of how it crashes.

Andy

==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"
==================================================================

1997\06\11@023945 by Didier JEANJEAN

flavicon
face
I am using the PCW (V2.273) for a project with a PIC16C74 and I use
approximatelly 80% of the Rom.

The only one problem I have (and then I crash all) is when an interrupt
function is placed in the bank 1.

The TEMPORARY (!!!!) solution I have find is to place the interrupt
function at the start of the code so they will be placed in the begining of
the Rom (bank 0).

If you have the same problem please send an E-mail to CCS so they will
maybe solve the problem quickly.

I have try more recent versions but I find too many bug so I can use this.

Didier (spam_OUTDidier.JeanjeanTakeThisOuTspamontonet.be)

----------
{Quote hidden}

1997\06\11@073251 by Andy Kunz

flavicon
face
>BTW, why is putting the ISR in bank 0 a temporary solution?  I always put
>mine there - and I'm curious as to the benefits or reasons for putting it
>in bank 1.

Mike,

Sometimes you just don't have enough room and you end up having to spend a
lot of extra time (and code) switching between banks.

I did a cable tv converter ('57) once which had 25% of its code being
bank-related, either ROM or RAM banks (it had 48 words of ROM free).
Changed to a '72 (for other reasons) and was able to add a ton of
functionality.  500 words is a lot of code!

And that was 25% after removing redundant stuff and swapping things (RAM,
ROM) around in memory so as to minimize it.

Andy

==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"
==================================================================

1997\06\12@020712 by Didier JEANJEAN

flavicon
face
----------
> From: Mike Smith <.....mikesmith_ozKILLspamspam.....RELAYMAIL.NET>
> To: EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU
> Subject: Re: PSW C compiler and Bank Changing
> Date: mercredi 11 juin 1997 10:13
>
> > From: Didier JEANJEAN <Didier.Jeanjeanspamspam_OUTONTONET.BE>
> > To: @spam@PICLISTKILLspamspamMITVMA.MIT.EDU
> > Subject: Re: PSW C compiler and Bank Changing
> > Date: Wednesday, 11 June 1997 16:00
> >
> > I am using the PCW (V2.273) for a project with a PIC16C74 and I use
> > approximatelly 80% of the Rom.
> >
> > The only one problem I have (and then I crash all) is when an interrupt
> > function is placed in the bank 1.
> >
> > The TEMPORARY (!!!!) solution I have find is to place the interrupt
> > function at the start of the code so they will be placed in the
begining
{Quote hidden}

(it
> was a *lot* earlier this year - February or so).  You can hardly complain
> to CCS about a fault they've rectified - complain instead about the bugs
> that prevent you from using their latest version.
>

Yes you have a very similar problem but not the same because CCS send me a
E-mail about this bug two week ago and they are working to correct this.

Try, like our project, to use 80% of the ROM and 100% of the Ram of a
PIC16C74 and then you will have many problems with the latest and oldest
versions.

> BTW, why is putting the ISR in bank 0 a temporary solution?  I always put
> mine there - and I'm curious as to the benefits or reasons for putting it
> in bank 1.

I didn't choose where I put the code in ROM. Its the compiler which place
the code at the first free place when it compile the code. So if you place
first all the interrupt routine they will be palced in bank 0 but if you
have a big project and you place the interrupt routine at the end of your
source file they will probably be placed in bank 1.

If you do big project you will want to place your interrupt routine
anywhere in the source so it will be more readable or because many people
work on the same project (so any people have its own code).

Didier

1997\06\12@103748 by Mike Smith

flavicon
face
----------
> From: Didier JEANJEAN <KILLspamDidier.JeanjeanKILLspamspamONTONET.BE>
> To: RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU
> Subject: Re: PSW C compiler and Bank Changing
> Date: Wednesday, 11 June 1997 21:39
>

> > I had a similar problem, but it was fixed by a later version.  It was
> > caused by a jump in the isr before the pclath got fixed, from memory.
> (it
> > was a *lot* earlier this year - February or so).  You can hardly
complain
> > to CCS about a fault they've rectified - complain instead about the
bugs
> > that prevent you from using their latest version.
> >
>
> Yes you have a very similar problem but not the same because CCS send me
a
> E-mail about this bug two week ago and they are working to correct this.

Obviously a different one.  Looking back, it was when I used the global isr
to 'roll my own' .  You'd think I could have done the PCLATH myself, but at
that stage the global had a jump instruction at location 4 - meaning if the
int occurred when you were in the second bank, you were hosed. :(

>
> Try, like our project, to use 80% of the ROM and 100% of the Ram of a
> PIC16C74 and then you will have many problems with the latest and oldest
> versions.

In fact I was - but with an old version - I finally ran out of space
entirely though, and took a different route for the project.  (77's not
being available)

> > BTW, why is putting the ISR in bank 0 a temporary solution?  I always
put
> > mine there - and I'm curious as to the benefits or reasons for putting
it
> > in bank 1.
>
> I didn't choose where I put the code in ROM. Its the compiler which place
> the code at the first free place when it compile the code. So if you
place
> first all the interrupt routine they will be palced in bank 0 but if you
> have a big project and you place the interrupt routine at the end of your
> source file they will probably be placed in bank 1.

Yes, sometimes I wish for some kind of directive that'll allow you to
determine location with some degree of precision.  And function pointers.
CCS's printf uses them in one of its forms, why can't the rest of the code?

>
> If you do big project you will want to place your interrupt routine
> anywhere in the source so it will be more readable or because many people
> work on the same project (so any people have its own code).
>

This project was big enough to occupy a '77.  I broke it into lots of .c
and .h files, and used a lot of #includes in the main file.  this at least
enables you to put the isr's at the front.  Thats another item on my wish
list - being able to compile to an obj file, and link/lib it  (Yes, Clyde,
I know HiTech does it, and MPC too I think)

MikeS
<spamBeGonemikesmith_ozspamBeGonespamrelaymail.net>

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...