EEDIV reg

Started by Stewart Prince August 4, 2003
We're using the D60a and have taken our D60 code over directly. All
works fine, including programming of the EEPROM, but I recently read
this section over again and noticed the EEDIV registers. It says for an
8MHZ oscillator frequency, this register pain must have a value of
0X118. What does this register control? We have been erasing and
writing by simply waiting 10 msec. Is something different with the D60a?
Stewart Prince
Professor, Mech Eng
Cal State Northridge



At 08:42 AM 8/4/03 -0700, you wrote:
>We're using the D60a and have taken our D60 code over directly. All
>works fine, including programming of the EEPROM, but I recently read
>this section over again and noticed the EEDIV registers. It says for an
>8MHZ oscillator frequency, this register pain must have a value of
>0X118. What does this register control? We have been erasing and
>writing by simply waiting 10 msec. Is something different with the D60a?

Yes, the EEPROM has an AUTO programming mode which allows a hardware state
machine to program the EEPROM with no involvement from the CPU (after set
up of course). This process requires a constant time base, which is
provided by EEDIVH/L. You can ignore all of this, and continue to use the
old way of delaying 10 ms.

The same is not true for the FLASH. It is very different, and totally
incompatible with the D60 FLASH. I mention this because both the EEPROM
and FLASH differences are detailed in Appendix B of the D60A Technical Data
Manual, Rev 2. Sorry, I don't have a link, but there are also differences
in several other modules, like the ADC, and clock generator, to name a few.

Gary Olmstead
Toucan Technology
Ventura CA



You might refer to AN2400 as it has a very good discussion of both Flash and EEPROM on the HCS12 processors.

Steve Dillier
----- Original Message -----
From: Gary Olmstead
To:
Sent: Monday, August 04, 2003 8:50 PM
Subject: Re: [68HC12] EEDIV reg At 08:42 AM 8/4/03 -0700, you wrote:
>We're using the D60a and have taken our D60 code over directly. All
>works fine, including programming of the EEPROM, but I recently read
>this section over again and noticed the EEDIV registers. It says for an
>8MHZ oscillator frequency, this register pain must have a value of
>0X118. What does this register control? We have been erasing and
>writing by simply waiting 10 msec. Is something different with the D60a?

Yes, the EEPROM has an AUTO programming mode which allows a hardware state
machine to program the EEPROM with no involvement from the CPU (after set
up of course). This process requires a constant time base, which is
provided by EEDIVH/L. You can ignore all of this, and continue to use the
old way of delaying 10 ms.

The same is not true for the FLASH. It is very different, and totally
incompatible with the D60 FLASH. I mention this because both the EEPROM
and FLASH differences are detailed in Appendix B of the D60A Technical Data
Manual, Rev 2. Sorry, I don't have a link, but there are also differences
in several other modules, like the ADC, and clock generator, to name a few.

Gary Olmstead
Toucan Technology
Ventura CA
--------------------



Gary,

This is not correct. the EEDIV register must be programmed with the
proper value whether or not you are using the the 'automatic'
programming feature of the EEPROM. Here's the background, the EEPROM in
the D60A is really Flash, the same as the main memory Flash although it
is designed with a 4 byte erase sector. To allow byte programming of the
'EEPROM' so that D60 software would have to be changed as little as
possible, there is actually 4K of 'EEPROM' in the device and only 1 byte
of each sector is used.

Because the 'EEPROM' is actually Flash, the EEDIV register sets up the
'EEPROM' state machine clock for erasure & programming and MUST be
programmed with the proper value. Note that even when not using the
'automatic' mode, the state machine still performs all of the EE
erase/programming timing. The default value for the EEDIV register is
loaded from the EEPROM shadow row, so if the erase & programming
routines *appear* to be working, it could be that the factory programmed
a default value into the shadow row, but it may not be correct for all
applications.

Bottom line is, an application moving from a D60 to a D60A should be
modified to write the EEDIV register with the proper value for the clock
frequency the application is using.

Regards,
Gordon

>Yes, the EEPROM has an AUTO programming mode which allows a hardware state
>machine to program the EEPROM with no involvement from the CPU (after set
>up of course). This process requires a constant time base, which is
>provided by EEDIVH/L. You can ignore all of this, and continue to use the
>old way of delaying 10 ms.

Gary Olmstead wrote:

>At 08:42 AM 8/4/03 -0700, you wrote: >>We're using the D60a and have taken our D60 code over directly. All
>>works fine, including programming of the EEPROM, but I recently read
>>this section over again and noticed the EEDIV registers. It says for an
>>8MHZ oscillator frequency, this register pain must have a value of
>>0X118. What does this register control? We have been erasing and
>>writing by simply waiting 10 msec. Is something different with the D60a?
>>
>>
>
>Yes, the EEPROM has an AUTO programming mode which allows a hardware state
>machine to program the EEPROM with no involvement from the CPU (after set
>up of course). This process requires a constant time base, which is
>provided by EEDIVH/L. You can ignore all of this, and continue to use the
>old way of delaying 10 ms.
>
>The same is not true for the FLASH. It is very different, and totally
>incompatible with the D60 FLASH. I mention this because both the EEPROM
>and FLASH differences are detailed in Appendix B of the D60A Technical Data
>Manual, Rev 2. Sorry, I don't have a link, but there are also differences
>in several other modules, like the ADC, and clock generator, to name a few.
>
>Gary Olmstead
>Toucan Technology
>Ventura CA >-------------------- >
>">http://docs.yahoo.com/info/terms/ >
>

--
===============================================================
Gordon Doughman Ph: 937-438-6811
Motorola Semiconductor Fax: 937-434-7457
Field Applications Engineer Pager: 800-759-8352 Pin: 1304089
Suite 175
3131 Newmark Drive
Miamisburg, OH 45342

Check out my HC12 book at:
http://www.rtcbooks.com/programming.php




Gordon --

At 11:23 AM 8/8/03 -0400, you wrote:
> Gary,
>
>This is not correct. the EEDIV register must be programmed with the
>proper value whether or not you are using the the 'automatic'
>programming feature of the EEPROM. Here's the background, the EEPROM in

Well, you're the expert, but in my defense, I was relying on section 8.6 of
the D60A Technical Data book, rev 2. It lists the programming steps
required when AUTO is clear, and doesn't say anything at all about EEDIV.
On the other hand, in reading that chapter again, I see that section 8.8
says to program EEDIV "before any EEPROM location can be programmed or
erased." But doesn't say why, nor does it mention the AUTO bit.

>'EEPROM' so that D60 software would have to be changed as little as
>possible, there is actually 4K of 'EEPROM' in the device and only 1 byte
>of each sector is used.
>
I guess silicon must be cheap, if you can do that. I remember when any
company would have been thrilled to offer 4K of EEPROM, and we would have
dealt with the issues of altering existing programs.

>programmed with the proper value. Note that even when not using the
>'automatic' mode, the state machine still performs all of the EE
>erase/programming timing.

The data book makes it sound like not using the AUTO mode is exactly like
the HC11 program mode. Thanks for the clarification.

Gary Olmstead
Toucan Technology
Ventura CA

www.toucantechnology.com



Gordon
I also have been using the direct mode in the D60A with a 10ms
programming and erasing time and it's been working. Just lucky, I
guess. Now I'll program the EEDIV registers and use the auto mode. Is
there a time savings using this technique?
S. Prince
Professor, Mech Eng
CSUN

Gordon Doughman wrote:

> Gary,
>
>This is not correct. the EEDIV register must be programmed with the
>proper value whether or not you are using the the 'automatic'
>programming feature of the EEPROM. Here's the background, the EEPROM in
>the D60A is really Flash, the same as the main memory Flash although it
>is designed with a 4 byte erase sector. To allow byte programming of the
>'EEPROM' so that D60 software would have to be changed as little as
>possible, there is actually 4K of 'EEPROM' in the device and only 1 byte
>of each sector is used.
>
>Because the 'EEPROM' is actually Flash, the EEDIV register sets up the
>'EEPROM' state machine clock for erasure & programming and MUST be
>programmed with the proper value. Note that even when not using the
>'automatic' mode, the state machine still performs all of the EE
>erase/programming timing. The default value for the EEDIV register is
>loaded from the EEPROM shadow row, so if the erase & programming
>routines *appear* to be working, it could be that the factory programmed
>a default value into the shadow row, but it may not be correct for all
>applications.
>
>Bottom line is, an application moving from a D60 to a D60A should be
>modified to write the EEDIV register with the proper value for the clock
>frequency the application is using.
>
>Regards,
>Gordon >
>>Yes, the EEPROM has an AUTO programming mode which allows a hardware state
>>machine to program the EEPROM with no involvement from the CPU (after set
>>up of course). This process requires a constant time base, which is
>>provided by EEDIVH/L. You can ignore all of this, and continue to use the
>>old way of delaying 10 ms.
>>
>>
>
>Gary Olmstead wrote: >
>>At 08:42 AM 8/4/03 -0700, you wrote:
>>
>>
>>
>>
>>>We're using the D60a and have taken our D60 code over directly. All
>>>works fine, including programming of the EEPROM, but I recently read
>>>this section over again and noticed the EEDIV registers. It says for an
>>>8MHZ oscillator frequency, this register pain must have a value of
>>>0X118. What does this register control? We have been erasing and
>>>writing by simply waiting 10 msec. Is something different with the D60a?
>>>
>>>
>>>
>>>
>>Yes, the EEPROM has an AUTO programming mode which allows a hardware state
>>machine to program the EEPROM with no involvement from the CPU (after set
>>up of course). This process requires a constant time base, which is
>>provided by EEDIVH/L. You can ignore all of this, and continue to use the
>>old way of delaying 10 ms.
>>
>>The same is not true for the FLASH. It is very different, and totally
>>incompatible with the D60 FLASH. I mention this because both the EEPROM
>>and FLASH differences are detailed in Appendix B of the D60A Technical Data
>>Manual, Rev 2. Sorry, I don't have a link, but there are also differences
>>in several other modules, like the ADC, and clock generator, to name a few.
>>
>>Gary Olmstead
>>Toucan Technology
>>Ventura CA
>>
>>
>>--------------------
>>
>>
>>
>>">http://docs.yahoo.com/info/terms/
>>
>>
>>
>>
>>
> >


Stewart,

Sorry I didn't answer sooner. I was on vacation & was burried when I
came back. Using the 'Auto' programming mode will result in a much
faster programming time. As the spec states, the EEPROM Maximum
Programming Time with the AUTO Bit Set is 500 uS.

Regards,
Gordon Stewart Prince wrote:

>Gordon
>I also have been using the direct mode in the D60A with a 10ms
>programming and erasing time and it's been working. Just lucky, I
>guess. Now I'll program the EEDIV registers and use the auto mode. Is
>there a time savings using this technique?
>S. Prince
>Professor, Mech Eng
>CSUN
>
>Gordon Doughman wrote: >> Gary,
>>
>>This is not correct. the EEDIV register must be programmed with the
>>proper value whether or not you are using the the 'automatic'
>>programming feature of the EEPROM. Here's the background, the EEPROM in
>>the D60A is really Flash, the same as the main memory Flash although it
>>is designed with a 4 byte erase sector. To allow byte programming of the
>>'EEPROM' so that D60 software would have to be changed as little as
>>possible, there is actually 4K of 'EEPROM' in the device and only 1 byte
>>of each sector is used.
>>
>>Because the 'EEPROM' is actually Flash, the EEDIV register sets up the
>>'EEPROM' state machine clock for erasure & programming and MUST be
>>programmed with the proper value. Note that even when not using the
>>'automatic' mode, the state machine still performs all of the EE
>>erase/programming timing. The default value for the EEDIV register is
>>loaded from the EEPROM shadow row, so if the erase & programming
>>routines *appear* to be working, it could be that the factory programmed
>>a default value into the shadow row, but it may not be correct for all
>>applications.
>>
>>Bottom line is, an application moving from a D60 to a D60A should be
>>modified to write the EEDIV register with the proper value for the clock
>>frequency the application is using.
>>
>>Regards,
>>Gordon
>>
>>
>>
>>
>>>Yes, the EEPROM has an AUTO programming mode which allows a hardware state
>>>machine to program the EEPROM with no involvement from the CPU (after set
>>>up of course). This process requires a constant time base, which is
>>>provided by EEDIVH/L. You can ignore all of this, and continue to use the
>>>old way of delaying 10 ms.
>>>
>>>
>>>
>>Gary Olmstead wrote:
>>
>>
>>
>>
>>>At 08:42 AM 8/4/03 -0700, you wrote:
>>>
>>>
>>>
>>>
>>>
>>>>We're using the D60a and have taken our D60 code over directly. All
>>>>works fine, including programming of the EEPROM, but I recently read
>>>>this section over again and noticed the EEDIV registers. It says for an
>>>>8MHZ oscillator frequency, this register pain must have a value of
>>>>0X118. What does this register control? We have been erasing and
>>>>writing by simply waiting 10 msec. Is something different with the D60a?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>Yes, the EEPROM has an AUTO programming mode which allows a hardware state
>>>machine to program the EEPROM with no involvement from the CPU (after set
>>>up of course). This process requires a constant time base, which is
>>>provided by EEDIVH/L. You can ignore all of this, and continue to use the
>>>old way of delaying 10 ms.
>>>
>>>The same is not true for the FLASH. It is very different, and totally
>>>incompatible with the D60 FLASH. I mention this because both the EEPROM
>>>and FLASH differences are detailed in Appendix B of the D60A Technical Data
>>>Manual, Rev 2. Sorry, I don't have a link, but there are also differences
>>>in several other modules, like the ADC, and clock generator, to name a few.
>>>
>>>Gary Olmstead
>>>Toucan Technology
>>>Ventura CA
>>>
>>>
>>>--------------------
>>>
>>>
>>>
>>>">http://docs.yahoo.com/info/terms/
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
> >
>
>-------------------- >
>">http://docs.yahoo.com/info/terms/ >

--
===============================================================
Gordon Doughman Ph: 937-438-6811
Motorola Semiconductor Fax: 937-434-7457
Field Applications Engineer Pager: 800-759-8352 Pin: 1304089
Suite 175
3131 Newmark Drive
Miamisburg, OH 45342

Check out my HC12 book at:
http://www.rtcbooks.com/programming.php