EmbeddedRelated.com
Forums

Write flash in normal single chip mode?

Started by lenux22 September 1, 2003


Hello, everybody! Is it posible to program or erase Flash in HCS12 (DG128) from code
executed from on-chip RAM in Normal Single Chip Mode?

WBR, lenux



Yes, It is absolutly possible to erase and program flash in normal single mode. But care should be taken to avoid accessing flash block which is being erased or programmed (take care about interrupts for block 0 erase/program)

lenux22 <> wrote:

Hello, everybody! Is it posible to program or erase Flash in HCS12 (DG128) from code
executed from on-chip RAM in Normal Single Chip Mode?

WBR, lenux

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

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



Thank you for answer, but I still have a problem with flash program:

Here is the code:

FCLKDIV = 0x5F; FCNFG = 0x0; FPROT = 0xFF; FSTAT = 0x30; FDATA = 0x0; FADDR = 0x0; FCMD = 0x41; //Mass erase FSTAT = 0x80; c = FSTAT;

This code placed in RAM, and then I perform reset in Normal Single
Chip mode with code dont work. But then I perform reset in Special
Single Chip - all work fine, the mass-erase execute ok!
WBR, lenux
--- In , mohan kumar <mohanss7@y...> wrote: > Yes, It is absolutly possible to erase and program flash in normal
single mode. But care should be taken to avoid accessing flash block
which is being erased or programmed (take care about interrupts for
block 0 erase/program) >


> lenux22 <lenux22@y...> wrote:


>


> Hello, everybody!


>


>


> Is it posible to program or erase Flash in HCS12 (DG128) from code
> executed from on-chip RAM in Normal Single Chip Mode?


>


>


>


>


> WBR, lenux


>





> This code placed in RAM, and then I perform reset in Normal Single
> Chip mode with code dont work. But then I perform reset in Special
> Single Chip - all work fine, the mass-erase execute ok!

I have that problem when I write twice INITRM.

Mariusz