Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

Discussion Groups | 68HC12 | Re: Another problem

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Another problem - montserret_maxime - Feb 7 13:49:00 2006

Hi everybody,

I have to put an application and a bootloader in flash.
The bootloader is located from 0xE000 to 0xFFFF (non banked page)
The application is located form 0xC000 to 0xDFFF for ISR and
initialized data (variables and constants).
The page from 0x4000 is reserved.
But I have not enough place to put ISR code and initialized data from
0xC000 to 0xDFFF.

I've tried to put constants into banked page but it's not working, it
doesn't crash but the application dosn't work very well. I think that
values of constants are not good.

Have you got an idea to put this constants into baked page ???

Many thanks in advance.
	


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Another problem - Michal Konieczny - Feb 7 14:35:00 2006

> I've tried to put constants into banked page but it's not working, it
> doesn't crash but the application dosn't work very well. I think that
> values of constants are not good.
> 
> Have you got an idea to put this constants into baked page ???

I suppose it dependes on the compiler, but here's another approach: some 
time ago when I wrote the code for banked MCS51 using IAR compiler, I 
had lots of static constants in banked pages that couldn't fit in single 
small non-banked page: in my case they were quite big calibration and 
linearization tables, and I had one special dedicated routine in 
non-banked memory that was able to retrieve value from any table from 
banked space using just index value for particular table. This routine 
directly manipulated the page selection and addressing to properly get 
to requested value at given offset into the table, regardless of the 
compiler idea of banking.
But if you need lots of scalar values, then that's of no use ...

-- 
Michal Konieczny
mk@mk@....



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Another problem - Steve Melnikoff - Feb 8 5:20:00 2006

An alternative approach is to put your constants in a specified page, 
and then place any function which uses those constants in the same 
page.

You'll need to edit the linker file to define these spaces, and then 
put pragmas in your code to ensure that the code and constants are 
stored there.

As a halfway-measure, you can have a single function in that page 
which copies the requested constant into RAM on demand, making the 
data available to any function that requires it, wherever that 
function may be stored.

Steve Melnikoff.

--- In 68HC12@68HC..., Michal Konieczny <0xmk@...> wrote:
>
> > I've tried to put constants into banked page but it's not 
working, it
> > doesn't crash but the application dosn't work very well. I think 
that
> > values of constants are not good.
> > 
> > Have you got an idea to put this constants into baked page ???
> 
> I suppose it dependes on the compiler, but here's another approach: 
some 
> time ago when I wrote the code for banked MCS51 using IAR compiler, 
I 
> had lots of static constants in banked pages that couldn't fit in 
single 
> small non-banked page: in my case they were quite big calibration 
and 
> linearization tables, and I had one special dedicated routine in 
> non-banked memory that was able to retrieve value from any table 
from 
> banked space using just index value for particular table. This 
routine 
> directly manipulated the page selection and addressing to properly 
get 
> to requested value at given offset into the table, regardless of 
the 
> compiler idea of banking.
> But if you need lots of scalar values, then that's of no use ...
> 
> -- 
> Michal Konieczny
> mk@...
>
	


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Another problem - Gilles Blanquin - Feb 8 6:16:00 2006

Hi Maxime.

FYI:

CodeWarrior provides C library runtimes to access banked/flashed data.

Indeed, accessing banked data while running banked code should be done by 
an unbanked runtime, as the PPAGE gets "shared" by data and code (not 
especially in the same page, so you can imagine the code execution failure 
when changing PPAGE).

If you plan to use banked (const) data, I propose you to see the delivered 
project in CodeWarrior V3.1 for HC(S)12 :

Stationery\HCS12\Board
Support\cml12s-dp256\cml12s-dp256_banked_data_code_and_const.mcp
	Regards,
Gilles
	At 06:49 PM 2/7/2006, you wrote:
>Hi everybody,
>
>I have to put an application and a bootloader in flash.
>The bootloader is located from 0xE000 to 0xFFFF (non banked page)
>The application is located form 0xC000 to 0xDFFF for ISR and
>initialized data (variables and constants).
>The page from 0x4000 is reserved.
>But I have not enough place to put ISR code and initialized data from
>0xC000 to 0xDFFF.
>
>I've tried to put constants into banked page but it's not working, it
>doesn't crash but the application dosn't work very well. I think that
>values of constants are not good.
>
>Have you got an idea to put this constants into baked page ???
>
>Many thanks in advance.
>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
	


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Another problem - montserret_maxime - Feb 8 6:39:00 2006

Thanks a lot everybody for your help.

I put the const data in the same page than the code functions which
uses this data. And it's working.

See you later.
	--- In 68HC12@68HC..., Gilles Blanquin <gilles.blanquin@...>
wrote:
>
> 
> Hi Maxime.
> 
> FYI:
> 
> CodeWarrior provides C library runtimes to access banked/flashed data.
> 
> Indeed, accessing banked data while running banked code should be
done by 
> an unbanked runtime, as the PPAGE gets "shared" by data and code (not 
> especially in the same page, so you can imagine the code execution
failure 
> when changing PPAGE).
> 
> If you plan to use banked (const) data, I propose you to see the
delivered 
> project in CodeWarrior V3.1 for HC(S)12 :
> 
> Stationery\HCS12\Board
> Support\cml12s-dp256\cml12s-dp256_banked_data_code_and_const.mcp
> 
> 
> Regards,
> Gilles
> 
> 
> At 06:49 PM 2/7/2006, you wrote:
> >Hi everybody,
> >
> >I have to put an application and a bootloader in flash.
> >The bootloader is located from 0xE000 to 0xFFFF (non banked page)
> >The application is located form 0xC000 to 0xDFFF for ISR and
> >initialized data (variables and constants).
> >The page from 0x4000 is reserved.
> >But I have not enough place to put ISR code and initialized data from
> >0xC000 to 0xDFFF.
> >
> >I've tried to put constants into banked page but it's not working, it
> >doesn't crash but the application dosn't work very well. I think that
> >values of constants are not good.
> >
> >Have you got an idea to put this constants into baked page ???
> >
> >Many thanks in advance.
> >
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
>
	


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Another problem - Jefferson Smith - Feb 8 10:33:00 2006

--- In 68HC12@68HC..., Michal Konieczny <0xmk@...> wrote:

> linearization tables, and I had one special dedicated routine in 
> non-banked memory that was able to retrieve value from any table from 
> banked space using just index value for particular table. This routine 

I got another idea similar to this, but doesn't require directly
manipulating PPAGE. If a certain type of data is stored in a specific
bank, you could place the retreive function in that bank. So when you
call the fuction, maybe
getPhoneNum(index, &val)
then it will jump to "getPhoneNum" in the same bank where the numbers
are stored, copy the number stored at that index, and then rtc. This
could be simpler for many cases.
	


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )