Good morning
I'm a really new freescale user. I have a question regarding external RAM. I'm trying to do a software to test an external memory by writting and reading dummy data on all the memory bytes.
The Ram is connected by PORT A /B ( 13 bits) and K (3bits).
In my .PRM file I defined my paged ram like this (I put only the PAGE 1 for exemple):
PAGE_01 | = READ_WRITE 0x010000 TO 0x012000; |
But when I debug my software with the CW simulator and I try to write something on this page I have an error message,
No memory at [XXXXXX:2].
I don't know if it is a simulator issue ? is it possible to emulate external ram with the CW simulator ?
Thanks in advance.
You can't write new value to PPAGE while executing code in P-page window. To access paged data from paged code, you need to jump to nonpaged routine, save old PPAGE, switch to PPAGE with data, access data, restore PPAGE, and only then return to paged code. Codewarrior supports "far" (paged) data on S12A this way. When you access far data, nonpaged runtime routine is called, which makes all required manipulations for you. Please study CW docs.
Hi
In full chip simulator you can define your own memory map (HCS12 FCS -> Configure menu). By default Mode is set to "auto on load". All objects with known size are automatically added to memory map. Derivative specific registers, which are supported by FCS are also added to memory map. You can change Mode to "user defined" and define your own simulator memory areas.
Edward
Thank you for your answer.
I did it, and now I have an ILLEGAL_BP in the debbuger. I think I did a mistake in my code. I'm trying to writte all the bytes of the RAM. My first idea was to fill all the bytes of the first page of ram (PPAGE_00 for exemple), check it, change the RAM page and redo the same test for all the RAM pages. Currently I'm using the instruction PPAGE to choose my RAM page, but I'm not sure that it is the good way to do.