Do Interrupt vectors & EEPROM overlap in normal, single chip mode?

Started by December 17, 2003
Hello,

I am new to working on the 68HC12. I am going through some of the
documentation provided by motorola on this controller and I ran into
a spot where in it was not clear if the interrupt vectors & the
EEPROM overlap in normal, single chip mode? If the EEPROM and
the interrupt vectors both reside at $F000 $FFFF then does setting
the interrupt vectors override the code in the EEPROM?

On a related note, when the controller is reset what is the first
instruction that gets executed?

thanks in advance for your inputs and feedback

with regards and seasons greetings
-DJ



DJ,

The interrupt vectors should be configured by you as the software designer
to be included as part of the code to reside in memory resource that
occupies the range $FF00 - $FFFF.

What memory resource is found by default at this address range after Reset
depends on the HC12/HCS12 derivative you will use and on the operating mode
you choose.

Most HC12 and HCS12 will have the internal Flash occupy this address range
after Reset, meaning the Flash will typically hold the vector table.

On the 68HC812A4, the EEPROM occupy this address range after Reset to
Single-Chip modes.

On Resets to expanded mode, external memory usually occupies this address
range.

>On a related note, when the controller is reset what is the first
>instruction that gets executed?

There are 3 Reset vectors at $FFFE, $FFFC and at $FFFA.

The most common is at $FFFE.

After most Resets, the CPU fetch the word content of address $FFFE - the
Reset vector. It then uses the read word to specify the address where the
code should start to be fetched and executed from - so the first executed
instruction will be in this address.

To give an example with numbers - lets assume the Reset vector at address
$FFFE holds the word value $4000. The first instruction to be executed will
therefore be at address $4000.

In a similar way the HC12 uses address $FFFA as the Reset vector in case of
a COP Watchdog Reset, and address $FFFC as the Reset vector in case of a
Clock Monitor Reset.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 03:30 18/12/2003 +0000, you wrote:
>Hello,
>
>I am new to working on the 68HC12. I am going through some of the
>documentation provided by motorola on this controller and I ran into
>a spot where in it was not clear if the interrupt vectors & the
>EEPROM overlap in normal, single chip mode? If the EEPROM and
>the interrupt vectors both reside at $F000 $FFFF then does setting
>the interrupt vectors override the code in the EEPROM?
>
>On a related note, when the controller is reset what is the first
>instruction that gets executed?
>
>thanks in advance for your inputs and feedback
>
>with regards and seasons greetings
>-DJ





Hi Doron,

Thanks for your response. So, if the micro controller is in normal,
single chip mode (and according ot motorola documentation and to
the best of understanding the interrupt vector table and the EEPROM
addresses overlap) when I set a specific address for a given
interrupt then this value get's stored in the EEPROM and consequently
when I reset the microcontroller, the interrupt vector is not lost
and the microcontroller will start executing at the address that I
set before I resent the microcontroller. Correct?

From a nother perspective, the vector table does eat up some of the
space of the on chip EEPROM then. So even through the controller has
4K of EEPROM only 3.8K (odds) of it can really be used to hold my
actual application. Am I correct in this assumption?

thanks

with regards
-DJ --- In , Doron Fael <doronf@n...> wrote:
> DJ,
>
> The interrupt vectors should be configured by you as the software
designer
> to be included as part of the code to reside in memory resource
that
> occupies the range $FF00 - $FFFF.
>
> What memory resource is found by default at this address range
after Reset
> depends on the HC12/HCS12 derivative you will use and on the
operating mode
> you choose.
>
> Most HC12 and HCS12 will have the internal Flash occupy this
address range
> after Reset, meaning the Flash will typically hold the vector table.
>
> On the 68HC812A4, the EEPROM occupy this address range after Reset
to
> Single-Chip modes.
>
> On Resets to expanded mode, external memory usually occupies this
address
> range.
>
> >On a related note, when the controller is reset what is the first
> >instruction that gets executed?
>
> There are 3 Reset vectors at $FFFE, $FFFC and at $FFFA.
>
> The most common is at $FFFE.
>
> After most Resets, the CPU fetch the word content of address $FFFE -
the
> Reset vector. It then uses the read word to specify the address
where the
> code should start to be fetched and executed from - so the first
executed
> instruction will be in this address.
>
> To give an example with numbers - lets assume the Reset vector at
address
> $FFFE holds the word value $4000. The first instruction to be
executed will
> therefore be at address $4000.
>
> In a similar way the HC12 uses address $FFFA as the Reset vector in
case of
> a COP Watchdog Reset, and address $FFFC as the Reset vector in case
of a
> Clock Monitor Reset.
>
> Hope this helps,
> Doron
> Nohau Corporation
> HC12 In-Circuit Emulators
> www.nohau.com/emul12pc.html
>
> At 03:30 18/12/2003 +0000, you wrote:
> >Hello,
> >
> >I am new to working on the 68HC12. I am going through some of the
> >documentation provided by motorola on this controller and I ran
into
> >a spot where in it was not clear if the interrupt vectors & the
> >EEPROM overlap in normal, single chip mode? If the EEPROM and
> >the interrupt vectors both reside at $F000 $FFFF then does setting
> >the interrupt vectors override the code in the EEPROM?
> >
> >On a related note, when the controller is reset what is the first
> >instruction that gets executed?
> >
> >thanks in advance for your inputs and feedback
> >
> >with regards and seasons greetings
> >-DJ >





Hi DJ, >Thanks for your response. So, if the micro controller is in normal,
>single chip mode (and according ot motorola documentation and to
>the best of understanding the interrupt vector table and the EEPROM
>addresses overlap) when I set a specific address for a given
>interrupt then this value get's stored in the EEPROM and consequently
>when I reset the microcontroller, the interrupt vector is not lost
>and the microcontroller will start executing at the address that I
>set before I resent the microcontroller. Correct?


Yes. That is correct. > From a nother perspective, the vector table does eat up some of the
>space of the on chip EEPROM then. So even through the controller has
>4K of EEPROM only 3.8K (odds) of it can really be used to hold my
>actual application. Am I correct in this assumption?


I assume you use the 68HC812A4 since you are talking about EEPROM and not
Flash.

The vector table on the 68HC812A4 takes $80 bytes at address range $FF80 -
$FFFF. You therefore have roughly 3.9K EEPROM left for the rest of your
other code, or alternatively need to use expanded mode and add FLASH memory
external to the 68HC812A4.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html