Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
Extern RAM with MC9S12DP256B - ventre ludovic - Mar 21 12:41:00 2005
hello,
I am working with MC9S12DP256B and i would like to
communicate with Extern RAM.
If somebody know how is it possible Please? Tell me
Sincerly
Ludo
PS: I'm sorry for my english
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
|

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - Stephen Trier - Mar 25 15:45:00 2005
Ludo,
Bienvenue à la liste HC12!
(Welcome to the HC12 list!)
Interfacing external RAM to the 9S12D series is quite difficult.
These parts are designed for single-chip operation. The external bus
is an afterthought useful primarily for emulator vendors.
Doron Fael has written a bit about what the bus interface requires.
There are particular problems, such as negative setup times, that make the
design quite challenging. You might like to take a look in the archives
for messages from Doron in the last few months. Not coincidentally,
Doron is an emulator engineer.
If you just need storage, and can accept slow access, you can hang the
RAM off port pins and implement the bus signals in software.
Stephen
--
Stephen Trier
Technical Development Lab
Cleveland FES Center
|

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - ludo...@... - Mar 29 5:42:00 2005
Stephen,
I have configured my regiter
PORTK = 0xFF
DDRK = 0xFF
MISC = 0x02
PEAR=0x0C
MODE=0xE0
EBICTL= 0x01
but nothing is occuring.
Thanks
Ludo
>
>
> Ludo,
>
>Bienvenue à la liste HC12!
>(Welcome to the HC12 list!)
>
>Interfacing external RAM to the 9S12D series is quite difficult.
>These parts are designed for single-chip operation. The external bus
>is an afterthought useful primarily for emulator vendors.
>
>Doron Fael has written a bit about what the bus interface requires.
>There are particular problems, such as negative setup times, that make the
>design quite challenging. You might like to take a look in the archives
>for messages from Doron in the last few months. Not coincidentally,
>Doron is an emulator engineer.
>
>If you just need storage, and can accept slow access, you can hang the
>RAM off port pins and implement the bus signals in software.
>
>Stephen
>
>--
>Stephen Trier
>Technical Development Lab
>Cleveland FES Center

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - Stephen Trier - Mar 29 16:20:00 2005
Ludo,
Do you have an oscilloscope? If so, write a little program to generate
activity on the RAM (reading or writing one location over and over, for
example), and look at the bus activity with the oscilloscope to see what
is happening. Start by looking at the control signals: ECLK and R/W on
the HC12, and the corresponding /CE (or /CS), /OE, and /WE pins on the
RAM chip. If you're convinced those are correct, you can trace out the
data and address bus activity.
I have never attempted to add external RAM to the 9S12D series, so I
cannot tell you if those register settings are appropriate. Perhaps
someone else on the list can help with that.
Stephen
--
Stephen Trier
Technical Development Lab
Cleveland FES Center
sct@sct@...

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - ventre ludovic - Mar 30 2:52:00 2005
Stephen,
I have an oscilloscope. Iam working with Noice
Debugger and i launch my program.
I am seeing in the oscilloscope the /CS(it's 16bits)of
my Ram and the ECLK signal and the Adress bus and data
Bus (DB15-DB0) , the result is the following:
it 's happening something on the the Adress bus and
data Bus (DB4) nothing is happening.
The /cs signals are correct but the ECLk clock is
arriving late when the data is alredy on the bus. I
don't understand, normally the adress or the data
could be lacthed at the ECLK failing edge.
when i am in noice debugger, My program start in
$4000 but it's anything. However, when i 'am touching
my arrows on my keyboard, in the oscilloscope i 'have
my signal which are moving as the noice is reaiding
in external memory.
how i can write in my'external RAm? What is it the
instruction to write into the RAM?
Thanks you for your help.
Ludo
--- Stephen Trier <sct@sct@...> wrote:
---------------------------------
Ludo,
Do you have an oscilloscope? If so, write a little
program to generate
activity on the RAM (reading or writing one location
over and over, for
example), and look at the bus activity with the
oscilloscope to see what
is happening. Start by looking at the control
signals: ECLK and R/W on
the HC12, and the corresponding /CE (or /CS), /OE, and
/WE pins on the
RAM chip. If you're convinced those are correct, you
can trace out the
data and address bus activity.
I have never attempted to add external RAM to the
9S12D series, so I
cannot tell you if those register settings are
appropriate. Perhaps
someone else on the list can help with that.
Stephen
--
Stephen Trier
Technical Development Lab
Cleveland FES Center
sct@sct@...
Yahoo! Groups Sponsor ADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
______________________________
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: Extern RAM with MC9S12DP256B - Doron Fael - Mar 30 6:25:00 2005
Ludo,
Here are a few notes on your configuration:
>MISC = 0x02
This will turn off the internal Flash. Do you really want to turn it off. I
think it is more likely you want to configure MISC to 0x03 or 0x01 to keep
the Flash turned on, to allow your code to execute out of the internal Flash.
Also, this MISC settings is for 0 wait-states access to the external RAM. I
suggest to set at least 1 wait-state to begin with, and only later try to
reduce to no-wait-states.
>MODE=0xE0
Do you connect any of the PORTK pins as address signals for the external
RAM? If so you need to set the EMK bit of the MODE register. This will
configure PORTK so it is used as the extended address outputs, and the ECS
signal.
>PEAR=0x0C
>EBICTL= 0x01
These settings for the PEAR and EBICTL registers are good.
Apart from this, your problem can very likely be in the hardware side of
the external bus interface. As Stphen indicated earlier, the HCS12 bus is
really not user freindly.
You should probably read carefully an application note I wrote on the
subject, which is available on the Nohau web-site (under the below link, in
the HC12 Application notes area)
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 04:42 29/03/2005 -0500, you wrote:
>Stephen,
>
>I have configured my regiter
>PORTK = 0xFF
>DDRK = 0xFF
>MISC = 0x02
>PEAR=0x0C
>MODE=0xE0
>EBICTL= 0x01
>
>but nothing is occuring.
>
>Thanks
>Ludo
>
> >
> >
> >
> > Ludo,
> >
> >Bienvenue à la liste HC12!
> >(Welcome to the HC12 list!)
> >
> >Interfacing external RAM to the 9S12D series is quite difficult.
> >These parts are designed for single-chip operation. The external bus
> >is an afterthought useful primarily for emulator vendors.
> >
> >Doron Fael has written a bit about what the bus interface requires.
> >There are particular problems, such as negative setup times, that make the
> >design quite challenging. You might like to take a look in the archives
> >for messages from Doron in the last few months. Not coincidentally,
> >Doron is an emulator engineer.
> >
> >If you just need storage, and can accept slow access, you can hang the
> >RAM off port pins and implement the bus signals in software.
> >
> >Stephen
> >
> >--
> >Stephen Trier
> >Technical Development Lab
> >Cleveland FES Center
[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: Extern RAM with MC9S12DP256B - ventre ludovic - Mar 30 8:33:00 2005
Doron ,
i would use external memory only to write and to read
data into.( The external memory is there only to store
data)
My configuration is
>MISC = 0x07
>PEAR=0x0C
>EBICTL= 0x01
>MODE=0xE2 (Normal Expanded Wide)
>
I have read your application node : HCS12 Expanded
Mode bus-design and HCS12 ICE use in Expanded-Modes
guide
But I don't understand how is it possible to write
into the external memory.
the EMK in Mode register is used in Emulation Mode ,
No?
I think the Emk register is used to transfert
automatically the value from the PPAGE Register to
the POTK Register.
Thnaks for your help.
Sincerly
Ludo
--- Doron Fael <doronf@doro...> wrote:
---------------------------------
Ludo,
Here are a few notes on your configuration:
>MISC = 0x02
This will turn off the internal Flash. Do you really
want to turn it off. I
think it is more likely you want to configure MISC to
0x03 or 0x01 to keep
the Flash turned on, to allow your code to execute out
of the internal Flash.
Also, this MISC settings is for 0 wait-states access
to the external RAM. I
suggest to set at least 1 wait-state to begin with,
and only later try to
reduce to no-wait-states.
>MODE=0xE0
Do you connect any of the PORTK pins as address
signals for the external
RAM? If so you need to set the EMK bit of the MODE
register. This will
configure PORTK so it is used as the extended address
outputs, and the ECS
signal.
>PEAR=0x0C
>EBICTL= 0x01
These settings for the PEAR and EBICTL registers are
good.
Apart from this, your problem can very likely be in
the hardware side of
the external bus interface. As Stphen indicated
earlier, the HCS12 bus is
really not user freindly.
You should probably read carefully an application note
I wrote on the
subject, which is available on the Nohau web-site
(under the below link, in
the HC12 Application notes area)
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 04:42 29/03/2005 -0500, you wrote:
>Stephen,
>
>I have configured my regiter
>PORTK = 0xFF
>DDRK = 0xFF
>MISC = 0x02
>PEAR=0x0C
>MODE=0xE0
>EBICTL= 0x01
>
>but nothing is occuring.
>
>Thanks
>Ludo
>
> >
> >
> >
> > Ludo,
> >
> >Bienvenue à la liste HC12!
> >(Welcome to the HC12 list!)
> >
> >Interfacing external RAM to the 9S12D series is
quite difficult.
> >These parts are designed for single-chip operation.
The external bus
> >is an afterthought useful primarily for emulator
vendors.
> >
> >Doron Fael has written a bit about what the bus
interface requires.
> >There are particular problems, such as negative
setup times, that make the
> >design quite challenging. You might like to take a
look in the archives
> >for messages from Doron in the last few months. Not
coincidentally,
> >Doron is an emulator engineer.
> >
> >If you just need storage, and can accept slow
access, you can hang the
> >RAM off port pins and implement the bus signals in
software.
> >
> >Stephen
> >
> >--
> >Stephen Trier
> >Technical Development Lab
> >Cleveland FES Center
[Non-text portions of this message have been removed]
Yahoo! Groups Sponsor ADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
______________________________
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: Extern RAM with MC9S12DP256B - Doron Fael - Mar 30 10:03:00 2005
Ludo,
The EMK bit of the MODE register is write-once in Normal expanded mode. It
is used to enable the high-order page address bits to an external memory
device. You need it usually if you want to access more than 16K of external
memory, and use the PPAGE register in order to access different 16K pages
in the external RAM.
How big is your external RAM?
How big is the portion of the external memory you want to access?
The settings of MISC to 0x07 should allow accessing 16K of the external
memory through the 0x4000 - 0x7FFF window (if all the external memory
interface hardware is tuned and set correctly).
If you set EMK to 1, you should be able to also access many 16Kbyte pages
of the external RAM through the 0x8000 - 0xBFFF window, by setting the
PPAGE register to different values. If you would like to use this method,
please note that you need a special external memory access function that
sits in the un-paged Flash area somewhere in the 0xC000 - 0xFFFF range, so
the PPAGE register can be changed in the beginning of the function, and be
restored in the end of the function, without changing the execution of the
code in the paged Flash that also use the PPAGE register to execute in
different Flash pages. (Since the CALL and RTC instructions modify the
PPAGE value to execute code in different Flash pages). In this method, the
Flash occupies the high PPAGE pages from 0x3F and down, and the external
RAM occupies the low PPAGE pages from 0x00 and up.
Apart from the above, how important is the speed of your accessing of the
external memory. If speed is not very important, you should consider
operating in Normal Single-Chip mode, and accessing the external RAM by bit
banging PORT A, B, E and K pins as General-purpose I/Os. This method
produce slower accesses to the external memory, but the timing on the
external bus interface is much more relaxed and easy to meet (no danger of
negative hold times etc.).
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 14:33 30/03/2005 +0200, you wrote:
>Doron ,
>
>i would use external memory only to write and to read
>data into.( The external memory is there only to store
>data)
>
>My configuration is
> >MISC = 0x07
> >PEAR=0x0C
> >EBICTL= 0x01
> >MODE=0xE2 (Normal Expanded Wide)
> >
>I have read your application node : HCS12 Expanded
>Mode bus-design and HCS12 ICE use in Expanded-Modes
>guide
>But I don't understand how is it possible to write
>into the external memory.
>the EMK in Mode register is used in Emulation Mode ,
>No?
>I think the Emk register is used to transfert
>automatically the value from the PPAGE Register to
>the POTK Register.
>
>Thnaks for your help.
>Sincerly
>Ludo
[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: Extern RAM with MC9S12DP256B - ventre ludovic - Mar 31 3:26:00 2005
Doron,
Thanks you for your explanation.
I understand in what the EMK is used.
For example, i would like to write the data 0x0001 in
address 0:8002 (PPAGE =0x00), i wrote :
#define externalMEM *(unsigned int *)(0x8002)
PPAGE = 0x00;
externalMEM = 0x0001;
After this, nothing are occuring into my external
Memory.
My configuration is the following:
MISC = 0x0D
( Only want to access at external memory between
$8000-0xBFFF )
PEAR = 0x0C
MODE = 0xE3
EBICTL = 0x01
I don't know this configuration is appropriated.
However, when i flash my program in external memory
all operare very well.
MISC = 0x0F (ROMHM =1 to access at 0x4000-0x7FFF).
I can execute my program in the external memory
(0x4000-0x7FFF).
Thanks you
Ludo
--- Doron Fael <doronf@doro...> wrote:
---------------------------------
Ludo,
The EMK bit of the MODE register is write-once in
Normal expanded mode. It
is used to enable the high-order page address bits to
an external memory
device. You need it usually if you want to access more
than 16K of external
memory, and use the PPAGE register in order to access
different 16K pages
in the external RAM.
How big is your external RAM?
How big is the portion of the external memory you want
to access?
The settings of MISC to 0x07 should allow accessing
16K of the external
memory through the 0x4000 - 0x7FFF window (if all the
external memory
interface hardware is tuned and set correctly).
If you set EMK to 1, you should be able to also access
many 16Kbyte pages
of the external RAM through the 0x8000 - 0xBFFF
window, by setting the
PPAGE register to different values. If you would like
to use this method,
please note that you need a special external memory
access function that
sits in the un-paged Flash area somewhere in the
0xC000 - 0xFFFF range, so
the PPAGE register can be changed in the beginning of
the function, and be
restored in the end of the function, without changing
the execution of the
code in the paged Flash that also use the PPAGE
register to execute in
different Flash pages. (Since the CALL and RTC
instructions modify the
PPAGE value to execute code in different Flash pages).
In this method, the
Flash occupies the high PPAGE pages from 0x3F and
down, and the external
RAM occupies the low PPAGE pages from 0x00 and up.
Apart from the above, how important is the speed of
your accessing of the
external memory. If speed is not very important, you
should consider
operating in Normal Single-Chip mode, and accessing
the external RAM by bit
banging PORT A, B, E and K pins as General-purpose
I/Os. This method
produce slower accesses to the external memory, but
the timing on the
external bus interface is much more relaxed and easy
to meet (no danger of
negative hold times etc.).
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 14:33 30/03/2005 +0200, you wrote:
>Doron ,
>
>i would use external memory only to write and to read
>data into.( The external memory is there only to
store
>data)
>
>My configuration is
> >MISC = 0x07
> >PEAR=0x0C
> >EBICTL= 0x01
> >MODE=0xE2 (Normal Expanded Wide)
> >
>I have read your application node : HCS12 Expanded
>Mode bus-design and HCS12 ICE use in Expanded-Modes
>guide
>But I don't understand how is it possible to write
>into the external memory.
>the EMK in Mode register is used in Emulation Mode
,
>No?
>I think the Emk register is used to transfert
>automatically the value from the PPAGE Register to
>the POTK Register.
>
>Thnaks for your help.
>Sincerly
>Ludo
[Non-text portions of this message have been removed]
Yahoo! Groups Sponsor ADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - ventre ludovic - Mar 31 10:48:00 2005
Doron,
Thanks you for your help i have succeded to write and
read into the external memory.
I really thank you for your kindness.
Sincerly
Ludo
--- Doron Fael <doronf@doro...> wrote:
---------------------------------
Ludo,
Here are a few notes on your configuration:
>MISC = 0x02
This will turn off the internal Flash. Do you really
want to turn it off. I
think it is more likely you want to configure MISC to
0x03 or 0x01 to keep
the Flash turned on, to allow your code to execute out
of the internal Flash.
Also, this MISC settings is for 0 wait-states access
to the external RAM. I
suggest to set at least 1 wait-state to begin with,
and only later try to
reduce to no-wait-states.
>MODE=0xE0
Do you connect any of the PORTK pins as address
signals for the external
RAM? If so you need to set the EMK bit of the MODE
register. This will
configure PORTK so it is used as the extended address
outputs, and the ECS
signal.
>PEAR=0x0C
>EBICTL= 0x01
These settings for the PEAR and EBICTL registers are
good.
Apart from this, your problem can very likely be in
the hardware side of
the external bus interface. As Stphen indicated
earlier, the HCS12 bus is
really not user freindly.
You should probably read carefully an application note
I wrote on the
subject, which is available on the Nohau web-site
(under the below link, in
the HC12 Application notes area)
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 04:42 29/03/2005 -0500, you wrote:
>Stephen,
>
>I have configured my regiter
>PORTK = 0xFF
>DDRK = 0xFF
>MISC = 0x02
>PEAR=0x0C
>MODE=0xE0
>EBICTL= 0x01
>
>but nothing is occuring.
>
>Thanks
>Ludo
>
> >
> >
> >
> > Ludo,
> >
> >Bienvenue à la liste HC12!
> >(Welcome to the HC12 list!)
> >
> >Interfacing external RAM to the 9S12D series is
quite difficult.
> >These parts are designed for single-chip operation.
The external bus
> >is an afterthought useful primarily for emulator
vendors.
> >
> >Doron Fael has written a bit about what the bus
interface requires.
> >There are particular problems, such as negative
setup times, that make the
> >design quite challenging. You might like to take a
look in the archives
> >for messages from Doron in the last few months. Not
coincidentally,
> >Doron is an emulator engineer.
> >
> >If you just need storage, and can accept slow
access, you can hang the
> >RAM off port pins and implement the bus signals in
software.
> >
> >Stephen
> >
> >--
> >Stephen Trier
> >Technical Development Lab
> >Cleveland FES Center
[Non-text portions of this message have been removed]
Yahoo! Groups Sponsor ADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - ventre ludovic - Apr 5 13:19:00 2005
doron,
Sorry but i have a problem which is the following:
when i c
--- Doron Fael <doronf@doro...> wrote:
---------------------------------
Ludo,
Here are a few notes on your configuration:
>MISC = 0x02
This will turn off the internal Flash. Do you really
want to turn it off. I
think it is more likely you want to configure MISC to
0x03 or 0x01 to keep
the Flash turned on, to allow your code to execute out
of the internal Flash.
Also, this MISC settings is for 0 wait-states access
to the external RAM. I
suggest to set at least 1 wait-state to begin with,
and only later try to
reduce to no-wait-states.
>MODE=0xE0
Do you connect any of the PORTK pins as address
signals for the external
RAM? If so you need to set the EMK bit of the MODE
register. This will
configure PORTK so it is used as the extended address
outputs, and the ECS
signal.
>PEAR=0x0C
>EBICTL= 0x01
These settings for the PEAR and EBICTL registers are
good.
Apart from this, your problem can very likely be in
the hardware side of
the external bus interface. As Stphen indicated
earlier, the HCS12 bus is
really not user freindly.
You should probably read carefully an application note
I wrote on the
subject, which is available on the Nohau web-site
(under the below link, in
the HC12 Application notes area)
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 04:42 29/03/2005 -0500, you wrote:
>Stephen,
>
>I have configured my regiter
>PORTK = 0xFF
>DDRK = 0xFF
>MISC = 0x02
>PEAR=0x0C
>MODE=0xE0
>EBICTL= 0x01
>
>but nothing is occuring.
>
>Thanks
>Ludo
>
> >
> >
> >
> > Ludo,
> >
> >Bienvenue à la liste HC12!
> >(Welcome to the HC12 list!)
> >
> >Interfacing external RAM to the 9S12D series is
quite difficult.
> >These parts are designed for single-chip operation.
The external bus
> >is an afterthought useful primarily for emulator
vendors.
> >
> >Doron Fael has written a bit about what the bus
interface requires.
> >There are particular problems, such as negative
setup times, that make the
> >design quite challenging. You might like to take a
look in the archives
> >for messages from Doron in the last few months. Not
coincidentally,
> >Doron is an emulator engineer.
> >
> >If you just need storage, and can accept slow
access, you can hang the
> >RAM off port pins and implement the bus signals in
software.
> >
> >Stephen
> >
> >--
> >Stephen Trier
> >Technical Development Lab
> >Cleveland FES Center
[Non-text portions of this message have been removed]
Yahoo! Groups Sponsor ADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Extern RAM with MC9S12DP256B - ventre ludovic - Apr 5 13:38:00 2005
Hello Doron,
sorry for the first emails.
My problem is the following:
when i do an external write with the odd address, the
data (16 bits) was broken in two.
for example, adress 0x8401 and data =0x3312
Firts we are seeing on the bus the address 0x8401
followed by the 2 MSB bytes swapped of the data
0x8433 secondly the address 0x8402 is pushed on the
bus followed by the 2 LSB bytes swapped of the data
0x1202 (12 is LSB Data and 02 is LSB Address)
When we are seeing the /LSTR , A0 and /RDW we have the
code 010(8-bit write of an odd address W8L)
corresponding at 0x8433 and the code 100 (8-bit write
of an even address W8H) corresponding at 0x1202
When i write 16 bit data in Even adress operate well.
I don't understand why my data of the odd adress is
broken in two adress
Sincerly Thanks you
ludo
--- Doron Fael <doronf@doro...> wrote:
---------------------------------
Ludo,
Here are a few notes on your configuration:
>MISC = 0x02
This will turn off the internal Flash. Do you really
want to turn it off. I
think it is more likely you want to configure MISC to
0x03 or 0x01 to keep
the Flash turned on, to allow your code to execute out
of the internal Flash.
Also, this MISC settings is for 0 wait-states access
to the external RAM. I
suggest to set at least 1 wait-state to begin with,
and only later try to
reduce to no-wait-states.
>MODE=0xE0
Do you connect any of the PORTK pins as address
signals for the external
RAM? If so you need to set the EMK bit of the MODE
register. This will
configure PORTK so it is used as the extended address
outputs, and the ECS
signal.
>PEAR=0x0C
>EBICTL= 0x01
These settings for the PEAR and EBICTL registers are
good.
Apart from this, your problem can very likely be in
the hardware side of
the external bus interface. As Stphen indicated
earlier, the HCS12 bus is
really not user freindly.
You should probably read carefully an application note
I wrote on the
subject, which is available on the Nohau web-site
(under the below link, in
the HC12 Application notes area)
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 04:42 29/03/2005 -0500, you wrote:
>Stephen,
>
>I have configured my regiter
>PORTK = 0xFF
>DDRK = 0xFF
>MISC = 0x02
>PEAR=0x0C
>MODE=0xE0
>EBICTL= 0x01
>
>but nothing is occuring.
>
>Thanks
>Ludo
>
> >
> >
> >
> > Ludo,
> >
> >Bienvenue à la liste HC12!
> >(Welcome to the HC12 list!)
> >
> >Interfacing external RAM to the 9S12D series is
quite difficult.
> >These parts are designed for single-chip operation.
The external bus
> >is an afterthought useful primarily for emulator
vendors.
> >
> >Doron Fael has written a bit about what the bus
interface requires.
> >There are particular problems, such as negative
setup times, that make the
> >design quite challenging. You might like to take a
look in the archives
> >for messages from Doron in the last few months. Not
coincidentally,
> >Doron is an emulator engineer.
> >
> >If you just need storage, and can accept slow
access, you can hang the
> >RAM off port pins and implement the bus signals in
software.
> >
> >Stephen
> >
> >--
> >Stephen Trier
> >Technical Development Lab
> >Cleveland FES Center
[Non-text portions of this message have been removed]
Yahoo! Groups Sponsor ADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
______________________________
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: Extern RAM with MC9S12DP256B - ventre ludovic - Apr 7 10:32:00 2005
Stephen,
Thanks you for your explaination
I have an other problem. My extended adress is not
acive allt time only befrore the chipselect.
Ludo
--- Stephen Trier <sct@sct@...> wrote:
---------------------------------
On Tue, Apr 05, 2005 at 07:38:48PM +0200, ventre
ludovic wrote:
> when i do an external write with the odd address,
the
> data (16 bits) was broken in two.
Ludo,
That is correct behavior. Addresses $8400 and $8401
are a single 16-bit
word. Thus, if you wrote $3312 to $8400, the HC12 can
write the data
in a single operation.
$8402 and $8403 are the next 16-bit word in memory.
Therefore, when
you write 16 bits to $8401:$8402, the write has to be
split across two
different 16-bit words in RAM. Your external memory
should to use A0
and /LSTRB as byte-access signals so that it can
handle these odd-aligned
accesses correctly.
Many early 16-bit CPUs, including the original 68000,
didn't have this
capability. If software tried to access 16-bit data
at an odd address,
the 68000 would generate an exception instead of
continuing with the
program. The HC12's approach of automatically
splitting such accesses
is kinder to programmers.
Stephen
--
Stephen Trier
Technical Development Lab
Cleveland FES Center
sct@sct@...
---------------------------------
Yahoo! Groups Links
To
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
______________________________
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 )