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

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | bulk erasing eeprom

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

bulk erasing eeprom - Anish - May 23 14:13:00 2003

Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I have
written an assembly code for erasing it. I can see thru the debugger
that when my code executes the eeprom is erased and all contents are
FF but when I reset my processor then eeprom contains my previous
data.

Can any one suggest what I can do for permenantly erasing the eeprom.

Anish



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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


Re: bulk erasing eeprom - Dave Perreault - May 23 16:22:00 2003

Anish

Perhaps if you shouw us your setup and code we could offefr some
suggestions.
Regards
Dave Perreault Anish wrote:

>Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I have
>written an assembly code for erasing it. I can see thru the debugger
>that when my code executes the eeprom is erased and all contents are
>FF but when I reset my processor then eeprom contains my previous
>data.
>
>Can any one suggest what I can do for permenantly erasing the eeprom.
>
>Anish >
>--------------------------------------------------------
>To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit
>http://www.motorola.com/mcu



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: bulk erasing eeprom - Anish - May 23 16:49:00 2003

I am using the following code. I

void bulk_erase_eeprom(void)
{
int orig_eeprot,orig_eeprog,i;

orig_eeprot = EEPROT;
orig_eeprog = EEPROG;
EEPROT = 128; /*128 = 80H = 10000000 set all eeprom blocks to be
erased*/
EEPROG = 0; /*clear all bits in eeprog*/
EEPROG = 6; /*set 1stand 2nd bit*/
EEPROG = 7; /*turn on programming voltage */

while (i<100)
i++; /*give some delay*/

EEPROG &= ~(1<<0); /*turn off programming voltage*/
EEPROG &= ~(1<<1);

EEPROG = orig_eeprog;
EEPROT = orig_eeprot;

}

When my program comes to the last two line it restore what was there
previoulsy in the eeprom. my eeprom starts from 0D00-0FFF. Also I
would like to know how to remap my epprom to a different location.

Thanks

Anish
--- In , Dave Perreault <briggsroad@c...> wrote:
> Anish
>
> Perhaps if you shouw us your setup and code we could offefr some
> suggestions.
> Regards
> Dave Perreault > Anish wrote:
>
> >Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I
have
> >written an assembly code for erasing it. I can see thru the
debugger
> >that when my code executes the eeprom is erased and all contents
are
> >FF but when I reset my processor then eeprom contains my previous
> >data.
> >
> >Can any one suggest what I can do for permenantly erasing the
eeprom.
> >
> >Anish
> >
> >
> >
> >--------------------------------------------------------
> >To unsubscribe from this group, send an email to:
> >
> >
> >To learn more about Motorola Microcontrollers, please visit
> >http://www.motorola.com/mcu
> >
> >
> >
> >
> >
> >
> >
>




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

Re: Re: bulk erasing eeprom - Dave Perreault - May 23 21:20:00 2003

Anish

Comments in your code in red.

Regards
Dave Perreault Anish wrote:

>I am using the following code. I
>
>void bulk_erase_eeprom(void)
> {
> int orig_eeprot,orig_eeprog,i;
>
> orig_eeprot = EEPROT;
> orig_eeprog = EEPROG;
> EEPROT = 128; /*128 = 80H = 10000000 set all eeprom blocks to be
>erased*/
> EEPROG = 0; /*clear all bits in eeprog*/
> EEPROG = 6; /*set 1stand 2nd bit*/ You need to write a word to the array at this point to latch the address,
$FFFF->address $D00 is ok

> EEPROG = 7; /*turn on programming voltage */
>
> while (i<100)
> i++; /*give some delay*/
>
> EEPROG &= ~(1<<0); /*turn off programming voltage*/
> EEPROG &= ~(1<<1);
>
The previous line should turn off the erase bit as well in order to
r4ead the array, i.e.
EEPROG &= ~(3<<1); > EEPROG = orig_eeprog;
> EEPROT = orig_eeprot;
>
> }
>
>When my program comes to the last two line it restore what was there
>previoulsy in the eeprom. my eeprom starts from 0D00-0FFF. Also I
>would like to know how to remap my epprom to a different location.
>
>Thanks
>
>Anish >
>--- In , Dave Perreault <briggsroad@c...> wrote: >>Anish
>>
>>Perhaps if you shouw us your setup and code we could offefr some
>>suggestions.
>>Regards
>>Dave Perreault
>>
>>
>>Anish wrote:
>>
>>
>>
>>>Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I
>>>
>>>
>have >>>written an assembly code for erasing it. I can see thru the
>>>
>>>
>debugger >>>that when my code executes the eeprom is erased and all contents
>>>
>>>
>are >>>FF but when I reset my processor then eeprom contains my previous
>>>data.
>>>
>>>Can any one suggest what I can do for permenantly erasing the
>>>
>>>
>eeprom. >>>Anish
>>>
>>>
>>>
>>>--------------------------------------------------------
>>>To unsubscribe from this group, send an email to:
>>>
>>>
>>>To learn more about Motorola Microcontrollers, please visit
>>>http://www.motorola.com/mcu
>>>
>>>
>> >>>
>>>
>>>
>>>
>> >
>--------------------------------------------------------
>To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit
>http://www.motorola.com/mcu [Non-text portions of this message have been removed]


______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: Re: bulk erasing eeprom - Dave Perreault - May 23 21:24:00 2003

Anish

Three other things.

1. You need to turn on the external programming voltage approx. 12 volts.

2. If you are running a slow clock, you need to switch to the on chip RC
oscillator.

3. I have no way of checking if your delay is long enough since it is
clock frequency dependent.

Regards
Dave Perreault
Anish wrote:

>I am using the following code. I
>
>void bulk_erase_eeprom(void)
> {
> int orig_eeprot,orig_eeprog,i;
>
> orig_eeprot = EEPROT;
> orig_eeprog = EEPROG;
> EEPROT = 128; /*128 = 80H = 10000000 set all eeprom blocks to be
>erased*/
> EEPROG = 0; /*clear all bits in eeprog*/
> EEPROG = 6; /*set 1stand 2nd bit*/
> EEPROG = 7; /*turn on programming voltage */
>
> while (i<100)
> i++; /*give some delay*/
>
> EEPROG &= ~(1<<0); /*turn off programming voltage*/
> EEPROG &= ~(1<<1);
>
> EEPROG = orig_eeprog;
> EEPROT = orig_eeprot;
>
> }
>
>When my program comes to the last two line it restore what was there
>previoulsy in the eeprom. my eeprom starts from 0D00-0FFF. Also I
>would like to know how to remap my epprom to a different location.
>
>Thanks
>
>Anish >
>--- In , Dave Perreault <briggsroad@c...> wrote: >>Anish
>>
>>Perhaps if you shouw us your setup and code we could offefr some
>>suggestions.
>>Regards
>>Dave Perreault
>>
>>
>>Anish wrote:
>>
>>
>>
>>>Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I
>>>
>>>
>have >>>written an assembly code for erasing it. I can see thru the
>>>
>>>
>debugger >>>that when my code executes the eeprom is erased and all contents
>>>
>>>
>are >>>FF but when I reset my processor then eeprom contains my previous
>>>data.
>>>
>>>Can any one suggest what I can do for permenantly erasing the
>>>
>>>
>eeprom. >>>Anish
>>>
>>>
>>>
>>>--------------------------------------------------------
>>>To unsubscribe from this group, send an email to:
>>>
>>>
>>>To learn more about Motorola Microcontrollers, please visit
>>>http://www.motorola.com/mcu
>>>
>>>
>> >>>
>>>
>>>
>>>
>> >
>--------------------------------------------------------
>To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit
>http://www.motorola.com/mcu [Non-text portions of this message have been removed]



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: bulk erasing eeprom - Anish - May 27 15:20:00 2003

Thanks,

The EEPROM I am using is not the flash. I think that only the flash
requires external 12V for programming. For the internal EEPROM the
voltage is generated internally.

I can see that the EEPROM is being erased as the values are changed
to FF. But when I reset my processor the original values in the
EEPROM are restored.

Also a new problem when I write data to the EEPROM the first time it
writes fine but when I run the same program again and want my result
in the same location of EEPROM it stores some garbage value(not my
actual result).

I want to know what the problem is with the EEPROM. EEPROM have 10000
read/write cycles so I dont think that is the problem.

The first time it writes but after that it keeps on writing the same
garbage value in that location. Thanks
Anish
University of Alabama Birmingham
--- In , Dave Perreault <briggsroad@c...> wrote:
> Anish
>
> Three other things.
>
> 1. You need to turn on the external programming voltage approx. 12
volts.
>
> 2. If you are running a slow clock, you need to switch to the on
chip RC
> oscillator.
>
> 3. I have no way of checking if your delay is long enough since it
is
> clock frequency dependent.
>
> Regards
> Dave Perreault >
> Anish wrote:
>
> >I am using the following code. I
> >
> >void bulk_erase_eeprom(void)
> > {
> > int orig_eeprot,orig_eeprog,i;
> >
> > orig_eeprot = EEPROT;
> > orig_eeprog = EEPROG;
> > EEPROT = 128; /*128 = 80H = 10000000 set all eeprom blocks to
be
> >erased*/
> > EEPROG = 0; /*clear all bits in eeprog*/
> > EEPROG = 6; /*set 1stand 2nd bit*/
> > EEPROG = 7; /*turn on programming voltage */
> >
> > while (i<100)
> > i++; /*give some delay*/
> >
> > EEPROG &= ~(1<<0); /*turn off programming voltage*/
> > EEPROG &= ~(1<<1);
> >
> > EEPROG = orig_eeprog;
> > EEPROT = orig_eeprot;
> >
> > }
> >
> >When my program comes to the last two line it restore what was
there
> >previoulsy in the eeprom. my eeprom starts from 0D00-0FFF. Also I
> >would like to know how to remap my epprom to a different location.
> >
> >Thanks
> >
> >Anish
> >
> >
> >
> >
> >
> >
> >--- In , Dave Perreault <briggsroad@c...>
wrote:
> >
> >
> >>Anish
> >>
> >>Perhaps if you shouw us your setup and code we could offefr some
> >>suggestions.
> >>Regards
> >>Dave Perreault
> >>
> >>
> >>Anish wrote:
> >>
> >>
> >>
> >>>Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I
> >>>
> >>>
> >have
> >
> >
> >>>written an assembly code for erasing it. I can see thru the
> >>>
> >>>
> >debugger
> >
> >
> >>>that when my code executes the eeprom is erased and all contents
> >>>
> >>>
> >are
> >
> >
> >>>FF but when I reset my processor then eeprom contains my
previous
> >>>data.
> >>>
> >>>Can any one suggest what I can do for permenantly erasing the
> >>>
> >>>
> >eeprom.
> >
> >
> >>>Anish
> >>>
> >>>
> >>>
> >>>--------------------------------------------------------
> >>>To unsubscribe from this group, send an email to:
> >>>
> >>>
> >>>To learn more about Motorola Microcontrollers, please visit
> >>>http://www.motorola.com/mcu
> >>>
> >>>
> >>>
> >
> >
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >--------------------------------------------------------
> >To unsubscribe from this group, send an email to:
> >
> >
> >To learn more about Motorola Microcontrollers, please visit
> >http://www.motorola.com/mcu
> >
> >
> >
> >
> >
> >
> >
> >
> [Non-text portions of this message have been removed]



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: Re: bulk erasing eeprom - Doron Fael - May 27 17:03:00 2003

Anish,

The problem is most likely within your code, and not in the EEPROM.

However, if you suspect the EEPROM, you can try to program it using your
BDM tool.
If it programs well using you BDM tool, then it is you code that doesn't work.
If it doesn't program well using you BDM tool, then you know it is the
EEPROM that doesn't work.

Look in your code especially at the delays used to erase and program the
EEPROM.
Using too short delays will not erase or program the EEPROM, and using too
long delays may fry the EEPROM and make it un-usable.
It is very important to get the delays to within the specified range in the
Motorola data sheets.

Hope this helps,

Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 08:20 PM 5/27/2003 +0000, you wrote:
>Thanks,
>
>The EEPROM I am using is not the flash. I think that only the flash
>requires external 12V for programming. For the internal EEPROM the
>voltage is generated internally.
>
>I can see that the EEPROM is being erased as the values are changed
>to FF. But when I reset my processor the original values in the
>EEPROM are restored.
>
>Also a new problem when I write data to the EEPROM the first time it
>writes fine but when I run the same program again and want my result
>in the same location of EEPROM it stores some garbage value(not my
>actual result).
>
>I want to know what the problem is with the EEPROM. EEPROM have 10000
>read/write cycles so I dont think that is the problem.
>
>The first time it writes but after that it keeps on writing the same
>garbage value in that location. >Thanks
>Anish
>University of Alabama Birmingham >
>--- In , Dave Perreault <briggsroad@c...> wrote:
> > Anish
> >
> > Three other things.
> >
> > 1. You need to turn on the external programming voltage approx. 12
>volts.
> >
> > 2. If you are running a slow clock, you need to switch to the on
>chip RC
> > oscillator.
> >
> > 3. I have no way of checking if your delay is long enough since it
>is
> > clock frequency dependent.
> >
> > Regards
> > Dave Perreault
> >
> >
> >
> > Anish wrote:
> >
> > >I am using the following code. I
> > >
> > >void bulk_erase_eeprom(void)
> > > {
> > > int orig_eeprot,orig_eeprog,i;
> > >
> > > orig_eeprot = EEPROT;
> > > orig_eeprog = EEPROG;
> > > EEPROT = 128; /*128 = 80H = 10000000 set all eeprom blocks to
>be
> > >erased*/
> > > EEPROG = 0; /*clear all bits in eeprog*/
> > > EEPROG = 6; /*set 1stand 2nd bit*/
> > > EEPROG = 7; /*turn on programming voltage */
> > >
> > > while (i<100)
> > > i++; /*give some delay*/
> > >
> > > EEPROG &= ~(1<<0); /*turn off programming voltage*/
> > > EEPROG &= ~(1<<1);
> > >
> > > EEPROG = orig_eeprog;
> > > EEPROT = orig_eeprot;
> > >
> > > }
> > >
> > >When my program comes to the last two line it restore what was
>there
> > >previoulsy in the eeprom. my eeprom starts from 0D00-0FFF. Also I
> > >would like to know how to remap my epprom to a different location.
> > >
> > >Thanks
> > >
> > >Anish
> > >
> > >
> > >
> > >
> > >
> > >
> > >--- In , Dave Perreault <briggsroad@c...>
>wrote:
> > >
> > >
> > >>Anish
> > >>
> > >>Perhaps if you shouw us your setup and code we could offefr some
> > >>suggestions.
> > >>Regards
> > >>Dave Perreault
> > >>
> > >>
> > >>Anish wrote:
> > >>
> > >>
> > >>
> > >>>Hi I am trying to bulk erase the 768 Byte EEPROM in 6812b32. I
> > >>>
> > >>>
> > >have
> > >
> > >
> > >>>written an assembly code for erasing it. I can see thru the
> > >>>
> > >>>
> > >debugger
> > >
> > >
> > >>>that when my code executes the eeprom is erased and all contents
> > >>>
> > >>>
> > >are
> > >
> > >
> > >>>FF but when I reset my processor then eeprom contains my
>previous
> > >>>data.
> > >>>
> > >>>Can any one suggest what I can do for permenantly erasing the
> > >>>
> > >>>
> > >eeprom.
> > >
> > >
> > >>>Anish
> > >>
[Non-text portions of this message have been removed]




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

Using IAR Compiler for MC9s12DP256 - mohan kumar - May 30 23:01:00 2003


Hi,

Is there any way to avoid having Interrupt Vector Table information in the output file generated using IAR workbench.?

I tried to delete the INTVEC segment in the linker file but, the linker always looks for this segment and generates a error. Is there any way to over ride it?

Any help in this regard is highly appreciated.

Thanks in advance,

Regards,

Mohan S S
---------------------------------





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

Re: Using IAR Compiler for MC9s12DP256 - Dick Webb - Jun 2 11:54:00 2003



You need to copy cstartup.s33 from its original installation folder to the
current project folder, if you haven't already done so. Scan down thru the
copied file until you find the section labeled COMMON INTVEC. I have
modified this section myself to reduce the size of the vector segment from
the IAR default of $80 to what my 812A4 uses, which is $40 (the RMB changes
from 0x7E to 0x3E). While this is not exactly what you want to do the
information should be extendable. Perhaps all you need to do is comment out
this section of the file. Another idea would be to reduce the size to zero,
or maybe one. Just make sure you add your modified cstartup.s33 file to the
project, and at the bottom of your .xcl file, where it currently says
"cl6812" add "-C " (note the space after the upper case C) to the beginning
of that line so that the linker will use your modified startup instead of
the default one. Hope this helps.

-- DW ----- Original Message -----
From: mohan kumar <mailto:>
To:
Sent: Saturday, May 31, 2003 12:01 AM
Subject: [68HC12] Using IAR Compiler for MC9s12DP256 Hi,

Is there any way to avoid having Interrupt Vector Table information in the
output file generated using IAR workbench.?

I tried to delete the INTVEC segment in the linker file but, the linker
always looks for this segment and generates a error. Is there any way to
over ride it?

Any help in this regard is highly appreciated.

Thanks in advance,

Regards,

Mohan S S
---------------------------------
Yahoo! Groups Sponsor ADVERTISEMENT

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu > . [Non-text portions of this message have been removed]





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

Re: Using IAR Compiler for MC9s12DP256 - mohan kumar - Jun 4 21:46:00 2003

Hi Webb.

Thank you for your information. The second option, "-C " did the trick and made things easier for me. Thnak you.

Regards
Mohan S S

Dick Webb <> wrote: You need to copy cstartup.s33 from its original installation folder to the
current project folder, if you haven't already done so. Scan down thru the
copied file until you find the section labeled COMMON INTVEC. I have
modified this section myself to reduce the size of the vector segment from
the IAR default of $80 to what my 812A4 uses, which is $40 (the RMB changes
from 0x7E to 0x3E). While this is not exactly what you want to do the
information should be extendable. Perhaps all you need to do is comment out
this section of the file. Another idea would be to reduce the size to zero,
or maybe one. Just make sure you add your modified cstartup.s33 file to the
project, and at the bottom of your .xcl file, where it currently says
"cl6812" add "-C " (note the space after the upper case C) to the beginning
of that line so that the linker will use your modified startup instead of
the default one. Hope this helps.

-- DW ----- Original Message -----
From: mohan kumar <mailto:>
To:
Sent: Saturday, May 31, 2003 12:01 AM
Subject: [68HC12] Using IAR Compiler for MC9s12DP256 Hi,

Is there any way to avoid having Interrupt Vector Table information in the
output file generated using IAR workbench.?

I tried to delete the INTVEC segment in the linker file but, the linker
always looks for this segment and generates a error. Is there any way to
over ride it?

Any help in this regard is highly appreciated.

Thanks in advance,

Regards,

Mohan S S
---------------------------------
Yahoo! Groups Sponsor ADVERTISEMENT

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu > . [Non-text portions of this message have been removed] Yahoo! Groups SponsorADVERTISEMENT

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ---------------------------------


______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: Using IAR Compiler for MC9s12DP256 - mohan kumar - Jun 4 21:46:00 2003

Hi Webb.

Thank you for your information. The second option, "-C " did the trick and made things easier for me. Thnak you.

Regards
Mohan S S

Dick Webb <> wrote: You need to copy cstartup.s33 from its original installation folder to the
current project folder, if you haven't already done so. Scan down thru the
copied file until you find the section labeled COMMON INTVEC. I have
modified this section myself to reduce the size of the vector segment from
the IAR default of $80 to what my 812A4 uses, which is $40 (the RMB changes
from 0x7E to 0x3E). While this is not exactly what you want to do the
information should be extendable. Perhaps all you need to do is comment out
this section of the file. Another idea would be to reduce the size to zero,
or maybe one. Just make sure you add your modified cstartup.s33 file to the
project, and at the bottom of your .xcl file, where it currently says
"cl6812" add "-C " (note the space after the upper case C) to the beginning
of that line so that the linker will use your modified startup instead of
the default one. Hope this helps.

-- DW ----- Original Message -----
From: mohan kumar <mailto:>
To:
Sent: Saturday, May 31, 2003 12:01 AM
Subject: [68HC12] Using IAR Compiler for MC9s12DP256 Hi,

Is there any way to avoid having Interrupt Vector Table information in the
output file generated using IAR workbench.?

I tried to delete the INTVEC segment in the linker file but, the linker
always looks for this segment and generates a error. Is there any way to
over ride it?

Any help in this regard is highly appreciated.

Thanks in advance,

Regards,

Mohan S S
---------------------------------
Yahoo! Groups Sponsor ADVERTISEMENT

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu > . [Non-text portions of this message have been removed] Yahoo! Groups SponsorADVERTISEMENT

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ---------------------------------




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