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 | Accessing flash while running out of ram

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

Accessing flash while running out of ram - liszewski_jason - Oct 26 15:24:00 2004


I am currently writing firmware for a project that uses the
MC9S12DJ256 microcontroller. I am doing all of my developing in RAM
with the NOICE debugger. Right now I am working on firmware updates
that are stored in the flash and then copied from one half of the
flash to the other. Is there any way to run out of RAM and still have
access to flash?

Jason M. Liszewski






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


Re: Accessing flash while running out of ram - Steve Russell - Oct 26 16:37:00 2004

Jason,

If you haven't read Freescale/Motorola AN2400/D, you should. It is a
valuable summary of almost all you need to know about programming flash memory.

It is no problem for a program executing from RAM to access flash
locations. That is the way a lot of flash programming is done.

Typically, you will have the RAM in some location below the flash window at
0x8000 - 0xBFFF. Write the code to run at the RAM location or make it
position independent. To access the flash locations, set the PPAGE
register to the page (NOT array Number) you want, and read or write to the
"corresponding" address in the 0x8000 - 0xBFFF range.

Other than keeping straight where the registers and RAM are, and what the
"corresponding" location in flash is, its pretty straightforward.

The main restriction is that you cannot execute code or read out of a flash
array or block that is being programmed. In the case of the DJ256 there
are 4 arrays, of 64 K bytes each, so that shouldn't be a problem for you,
if you want to execute flash programming code from flash. Just make sure
that you don't try to program the array that you are executing from.

Steve Russell
Nohau Emulators At 01:24 PM 10/26/2004, liszewski_jason wrote: >I am currently writing firmware for a project that uses the
>MC9S12DJ256 microcontroller. I am doing all of my developing in RAM
>with the NOICE debugger. Right now I am working on firmware updates
>that are stored in the flash and then copied from one half of the
>flash to the other. Is there any way to run out of RAM and still have
>access to flash?
>
>Jason M. Liszewski >
>
>Yahoo! Groups Links





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

Re: Accessing flash while running out of ram - jasa.rm - Oct 27 4:04:00 2004


Jason,

also I recommend to look into recently published AN2720: "A Utility
for Programming Single FLASH Array HCS12 MCUs, with Minimum RAM
Overhead" which explains how you can program FLASH via small routine
in Stack memory.

http://www.freescale.com/files/microcontrollers/doc/app_note/AN2720.pd
f

So you can program/change the FLASH locatoins "on the fly", using
only a few bytes of the Stack memory.

Jasa

--- In , Steve Russell <stever@n...> wrote:
> Jason,
>
> If you haven't read Freescale/Motorola AN2400/D, you should. It is
a
> valuable summary of almost all you need to know about programming
flash memory.
>
> It is no problem for a program executing from RAM to access flash
> locations. That is the way a lot of flash programming is done.
>
> Typically, you will have the RAM in some location below the flash
window at
> 0x8000 - 0xBFFF. Write the code to run at the RAM location or make
it
> position independent. To access the flash locations, set the PPAGE
> register to the page (NOT array Number) you want, and read or write
to the
> "corresponding" address in the 0x8000 - 0xBFFF range.
>
> Other than keeping straight where the registers and RAM are, and
what the
> "corresponding" location in flash is, its pretty straightforward.
>
> The main restriction is that you cannot execute code or read out of
a flash
> array or block that is being programmed. In the case of the DJ256
there
> are 4 arrays, of 64 K bytes each, so that shouldn't be a problem
for you,
> if you want to execute flash programming code from flash. Just
make sure
> that you don't try to program the array that you are executing from.
>
> Steve Russell
> Nohau Emulators > At 01:24 PM 10/26/2004, liszewski_jason wrote: > >I am currently writing firmware for a project that uses the
> >MC9S12DJ256 microcontroller. I am doing all of my developing in
RAM
> >with the NOICE debugger. Right now I am working on firmware
updates
> >that are stored in the flash and then copied from one half of the
> >flash to the other. Is there any way to run out of RAM and still
have
> >access to flash?
> >
> >Jason M. Liszewski
> >
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
>





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