Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
How to use the external ram (HC12compact) - sebastian_nowak2 - Sep 14 5:08:43 2006
Hello,
i=B4m working with the HC12compact, ICC12, noice and a compod.
my problem is that i can=B4t use the external ram from $2000 to $8000.
in icc12 i set the program memory to $0900 the data memory to $0800=20
(this is the internal ram $0800 to $0C00).
the stackpointer is set to 0C00.
with these settings everything works well, until i use more than 10=20
integers or 4 interrupts.
how can i activate the ram from $2000 to $8000 to use more integers and=20
interrupts?
i don=B4t want to copy the whole program into the flash, because than i=20
couldn=B4t use noice and the compod anymore.
=20
=20

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Andrew Lohmann - Sep 14 5:48:04 2006
Hi
sebastian_nowak2 wrote:
>with these settings everything works well, until i use more than 10
> integers or 4 interrupts.
> how can i activate the ram from $2000 to $8000 to use more integers and
> interrupts?
If your target is HCS12 series they don't really handle externeal RAM
very well. The data occassional gets corrupted - thiis can be resolved
by using specific makers of RAM I found IDT ok, or using bus buffers.
Freescale spent quite a lot of time on one of my boards for me it worked
better but was not completely reliable.
Andrew Lohmann AMIIE
Design Engineer
PLEASE NOTE NEW EMAIL ADDRESS IS:
a...@bellinghamandstanley.co.uk
Bellingham + Stanley Ltd.
Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
Tel: +44 (0) 1892 500400
Fax: +44 (0) 1892 543115
Website: www.bs-ltd.com
-----------------------------Disclaimer-----------------------------
This communication contains information which is confidential and may also be privileged.
It is for the exclusive use of the addressee. If you are not the addressee please note
that any distribution, reproduction, copying, publication or use of this communication or
the information is prohibited. If you have received this communication in error, please
contact us immediately and also delete the communication from your computer. We accept no
liability for any loss or damage suffered by any person arising from use of this e-mail.
-----------------------------Disclaimer-----------------------------
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!
(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Edward Karpicz - Sep 14 6:54:08 2006
"sebastian_nowak2" wrote:
> Hello,
> iīm working with the HC12compact, ICC12, noice and a compod.
> my problem is that i canīt use the external ram from $2000 to $8000.
>
1) It would be nice if you mentioned what MCU are you talking about. Is it
812A4?
2) Did you read manuals for your board? If not then please download and
study them:
http://elmicro.com/en/hc12compact.php
> in icc12 i set the program memory to $0900 the data memory to $0800
> (this is the internal ram $0800 to $0C00).
> the stackpointer is set to 0C00.
>
> with these settings everything works well, until i use more than 10
> integers or 4 interrupts.
>
> how can i activate the ram from $2000 to $8000 to use more integers and
> interrupts?
It's written in the manual. You have to init some 812A4 registers. Probably
some chipselect pins are used for RAM and they should be initialized to
"see" external RAM on expanded memory bus.
>
> i donīt want to copy the whole program into the flash, because than i
> couldnīt use noice and the compod anymore.
>
It should be possible to make NoICE Playing After Reset some script that
could setup RAM chipselects.
Edward

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Jefferson Smith - Sep 14 13:31:53 2006
Apparently sebastian is using
http://elmicro.com/en/hc12compact.php
That means the board is designed to work with the included external
RAM, and is a matter of using it in your software. Elektronikladen
should have it documented, as well as give support for it.
Other than that, you should find docs for the MC68HC812A4 from Freescale.
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=68HC812A4&nodeId=01624686368637

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Nowe...@web.de - Sep 18 9:47:48 2006
Thank you for your answers.
Yes, Iīm using the 68hc812A4.
I have set a non-default startup in the icc options. The file is called crt12co.o
This is the .s file that belongs to the crt12co.o file:
; =============================================================================
; Name: CRT12CO.S
; Func: ICC12V6 Startup Module for
; HC12compact Single Board Computer in Expanded Wide Mode
; Copr: Imagecraft Inc., additions by MCT/Oliver Thamm
; Vers: 1.2
; =============================================================================
;
; Do not define any .area above this line. .text must be the first
; line in this file. You may put .area(s) at the end of the file.
;
.include "hc12.i"
; You need to define this symbol on the link command line:
; init_sp : initial stack pointer
; The entry point of your program is _start, which is defined here.
;
.area text
__start:: ; entry point
;
; Critical MCU settings first
; REM: MCU starts in NormExpMode
;
clr COPCTL ; Disable Watchdog
movb #$0c,PEAR ; LSTRE+RDWE, ECLK
movb #$3F,CSCTL0 ; Enable CSP0+CSD+CS3+CS2+CS1+CS0
movb #$10,CSCTL1 ; CSD covers $0000-$7fff
movb #$30,CSSTR0 ; CSP0+CSD not stretched (CSP1:3x)
movb #$FF,CSSTR1 ; CS0..3 stretched (3x)
movb #$fe,PPAGE ; Program Page $FE
movb #$c0,WINDEF ; DWEN+PWEN
movb #$0f,MXAR ; A16E...A19E
movb #$80,DDRE ; PE7=Out (LED driver)
movb #$00,PORTE ; LED on
;
; Optional (if you want to protect the EEPROM array):
;
movb #$ff,EEPROT ; Protect EEPROM
movb #$fe,EEMCR ; Lock protection
;
lds #init_sp ; now we have access to the ext. RAM too...
;
jsr __HC12Setup ; define your own setup rtn if you want to do
; initialization stuff before main()
; clear BSS
clra
ldx #__bss_start
init_loop:
cpx #__bss_end
beq init_done
staa 0,x
inx
bra init_loop
init_done:
; copy initialized idata to data
ldx #__idata_start
ldy #__data_start
copy_loop:
cpx #__idata_end
beq copy_done
movb 1,x+,1,y+
bra copy_loop
copy_done:
; call user main routine
jsr _main
_exit::
bra _exit
; __idata_start MUST follow text area for it to be in ROM
.area idata
__idata_start::
.area data
__data_start::
.area bss
__bss_start::
it still doesnīt work.
When I use twinpeaks and set the program memory to $3000, it will give me a write error
at 3000.
It would be helpful if someone could tell me the exact settings which I have to use in the
icc12/projects/options menu.
Currently my settings are:
Device configuration -> custom
Program memory ā donīt know (I want it to be in external ram)
Data memory ā donīt know (I want it to be in external ram)
Stack Pointer ā donīt know (I want it to be in external ram)
Expanded memory enabled
Addr: 0.0x1FFFF
Make paged functions default enabled
S2 record type enabled
Map vector page enabled
Cpu/blanked address disabled
Printf version ā small
Additional lib. ā empty
Word alignment disabled
Other options ā empty
No startup/lib disabled
Non-default startup ā crt12co.o
It is the first time for me to work with a microcontroller, so it is possible that Iīm
doing a very silly mistake. But at the moment I donīt see what Iīm doing wrong.

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Jefferson Smith - Sep 19 13:56:51 2006
--- In 6...@yahoogroups.com, Noweks@... wrote:
> ; Critical MCU settings first
> ; REM: MCU starts in NormExpMode
> ;
> clr COPCTL ; Disable Watchdog
> movb #$0c,PEAR ; LSTRE+RDWE, ECLK
> movb #$3F,CSCTL0 ; Enable CSP0+CSD+CS3+CS2+CS1+CS0
> movb #$10,CSCTL1 ; CSD covers $0000-$7fff
> movb #$30,CSSTR0 ; CSP0+CSD not stretched (CSP1:3x)
> movb #$FF,CSSTR1 ; CS0..3 stretched (3x)
> movb #$fe,PPAGE ; Program Page $FE
> movb #$c0,WINDEF ; DWEN+PWEN
> movb #$0f,MXAR ; A16E...A19E
> movb #$80,DDRE ; PE7=Out (LED driver)
> movb #$00,PORTE ; LED on
> ;
> ; Optional (if you want to protect the EEPROM array):
> ;
> movb #$ff,EEPROT ; Protect EEPROM
> movb #$fe,EEMCR ; Lock protection
Well, that looks quite similar to the code clip at
http://elmicro.com/de/hc12co_support.html
But when you ask where the RAM is addressed, how should we know? You
are the one with the board.
I get stuck here in the manual:
"Two types of RAM chips may be mounted on the HC12compact.
To select between the 128 KB type (256 KB total, default) and the 512
KB type (1 MB RAM, special option) the jumper JP5 must be placed in
the right position (see section Jumpers above)"
So which size RAM do you have, and is your JP5 jumper in the right
position?

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Jefferson Smith - Sep 19 15:52:32 2006
--- In 6...@yahoogroups.com, Noweks@... wrote:
...
> it still doesn=B4t work.
> When I use twinpeaks and set the program memory to $3000, it will
> give me a "write error at 3000".
Hmm, is this a setting in ICC12? You say "set the program memory to
$3000", but does that mean it will try to access it with PPAGE (which
would not work)? The RAM looks like it would be called data memory,
not program memory. How does it distinguish a 16bit address not inside
DPAGE or PPAGE windows?
> Expanded memory enabled
> Addr: 0.0x1FFFF
> Make paged functions default enabled
Curious (maybe because I don't use ICC12), what is this supposed to mean?
- If you really are specifying start of external RAM here, wouldn't it
at least be an even boundary?
- What is the "0." prefix?
- Is this in PPAGE, or DPAGE memory?
=20
=20
______________________________
LaunchPad Kit for MSP430 Value Line: Complete open source tool for harnessing 16-bit performance and ultra-low power. Click for Details
(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Re: How to use the external ram (HC12compact) - Edward Karpicz - Sep 19 16:38:17 2006
Jefferson Smith wrote:
> --- In 6...@yahoogroups.com, Noweks@... wrote:
> ...
>> it still doesnīt work.
>> When I use twinpeaks and set the program memory to $3000, it will
>> give me a "write error at 3000".
>
> Hmm, is this a setting in ICC12? You say "set the program memory to
No, "write error" can't be from ICC12. I think that NoICE complains it can't
write RAM that is not enabled out of reset to special mode. I said
previously that IMO OP should manage to enable that RAM first, then try to
load program to enabled RAM.
> $3000", but does that mean it will try to access it with PPAGE (which
> would not work)? The RAM looks like it would be called data memory,
> not program memory. How does it distinguish a 16bit address not inside
> DPAGE or PPAGE windows?
Since 812A4 doesn't have hardware breakpoints, OP wanted to debug in RAM.
When in NoICE you choose Generic Target, NoICE uses software breakpoints
(replaces first byte at breakpoint address with BGND opcode).
>
>> Expanded memory enabled
>> Addr: 0.0x1FFFF
>> Make paged functions default enabled
>
> Curious (maybe because I don't use ICC12), what is this supposed to mean?
Expanded memory in ICC12 = paged memory (PPAGE, PPAGE window at
$8000..0xBFFF etc). Of course it shouldn't be enabled for code in RAM at
3000..xxxx
> - If you really are specifying start of external RAM here, wouldn't it
> at least be an even boundary?
> - What is the "0." prefix?
It's not a prefix. aaa.bbb means some memory region from aaa to bbb.
> - Is this in PPAGE, or DPAGE memory?
>
______________________________
LaunchPad Kit for MSP430 Value Line: Complete open source tool for harnessing 16-bit performance and ultra-low power. Click for Details
(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
HC12 and graphic color display - jpdi...@free.fr - Sep 20 13:22:58 2006
Hello !
I know this forum is about 9s12 processor, but I can't find any data sheet about a LCD
color display from Sharp : "LQ035Q7DB02".
It's a color 240 x 320 pixels, 6 bits for each primary color, and touch panel. It seems it
is very often used for example on PDA
organizer as Dell Axim...
The only data sheet I can find is about 20 pages (Spec no LCY-0204, issue March 14, 2002),
which doesn't explain all the signals of
this component.
Anybody can help me ?
With all my thanks.
Joel Petrique
Diese-Info
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!
(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Jefferson Smith - Sep 20 18:56:53 2006
--- In 6...@yahoogroups.com, "Edward Karpicz"
wrote:
> No, "write error" can't be from ICC12. I think that NoICE
> complains it can't write RAM that is not enabled out of reset
> to special mode. I said previously that IMO OP should manage
> to enable that RAM first, then try to
> load program to enabled RAM.
Hi Edward, I wasn't referring to the error message. I hope you will
understand I am only uninformed about the specific tool
syntaxt/terminology. I am not unintelligent in general ;)
BTW I had forgot what debuger was used besides twinpeeks. I do use
NoICE for 9S12.
The question was, what is the meaning of "set the program memory to
$3000"? Don't you agree that would be set in ICC12? Maybe it's just a
mis-wording... the OP could mean using the debugger to write to
location $3000. I see two possibilities... write direct with NoICE
(Memory or Watch windows), or configure ICC12 to allocate $3000 for
program space (I presumed the latter).
I read the HC12compact manual about external RAM at $3000. It says
it's DPAGE 243. The Sch shows that JP5 should jump pins 1-2 if it has
the standard 256K RAM, or 2-3 for 1MB. Just suggesting to make sure
the jumper is correct. It looks possible though that the jumper might
make some RAM visible there either way, but don't know enough about
the hardware.
> Expanded memory in ICC12 = paged memory (PPAGE, PPAGE window at
> $8000..0xBFFF etc). Of course it shouldn't be enabled for code in
RAM at
> 3000..xxxx
Yes, one question I had was if it might look in PPAGE instead of DPAGE
because I didn't know how the tools distinguish the three realms of
memory (fixed, DPAGE, PPAGE). I guess NoICE would interperet these
addresses 3000=fixed, F3:7000=DPAGE, F3:8000=PPAGE
To justify my uncertainty, the Motorola linear format gives no way to
distinguish. $3000 then means either start of DPAGE 3, offset $3000 of
PPAGE 0, or the 16bit address, all are unrelated. In GCC I use a
special version using offset regions (for HC12/S12) where [0..0xffff]
is fixed 16bit, [0x10000..0xfffff] is PPAGE [0x00..0x3f] which is
visible at the window [0x8000..0xbfff]. I like GCC, it's easier to
type 0xf2000 than $38:$a000.
> It's not a prefix. aaa.bbb means some memory region from aaa to bbb.
Oh thanks, just bad choice of syntax. Two dots ".." would work but not
one dot. Even a dash '-' or colon ':' commonly means range but I've
never seen a single dot. Makes it hard for us natural experts.
Well it would be easy if the problem is JP5, but I think it could be
the method of NoICE trying to modify the RAM. It is often the little
things, like when this hardware does not allow word access on an odd
boundary, and one tries to write a 16bits to $3001.
One test I might try is run a program in Flash which tests for
writability in ext RAM, in order to bypass possible debugger
complications. That is unless you already know that NoICE has
successfully written to RAM at $3000 in some other case.

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: Re: How to use the external ram (HC12compact) - Richard - Sep 20 21:23:46 2006
Sorry, coming late to the party :-) After looking through all the emails,
it is not clear to me what the user's problem or question is. I would
highly recommend the user gets a simple program to work first without
external SRAM, then go from there. I am almost certain that the
DPAGE/PPAGE/etc. discussion is beyond what we are talking about here.
At 03:51 PM 9/20/2006, Jefferson Smith wrote:
>..
>Hi Edward, I wasn't referring to the error message. I hope you will
>understand I am only uninformed about the specific tool
>syntaxt/terminology. I am not unintelligent in general ;)
>BTW I had forgot what debuger was used besides twinpeeks. I do use
>NoICE for 9S12.
>
>The question was, what is the meaning of "set the program memory to
>$3000"? Don't you agree that would be set in ICC12? Maybe it's just a
>mis-wording... the OP could mean using the debugger to write to
>location $3000. I see two possibilities... write direct with NoICE
>(Memory or Watch windows), or configure ICC12 to allocate $3000 for
>program space (I presumed the latter).
>
>I read the HC12compact manual about external RAM at $3000. It says
>it's DPAGE 243. The Sch shows that JP5 should jump pins 1-2 if it has
>the standard 256K RAM, or 2-3 for 1MB. Just suggesting to make sure
>the jumper is correct. It looks possible though that the jumper might
>make some RAM visible there either way, but don't know enough about
>the hardware.
>
> > Expanded memory in ICC12 = paged memory (PPAGE, PPAGE window at
> > $8000..0xBFFF etc). Of course it shouldn't be enabled for code in
>RAM at
> > 3000..xxxx
>
>Yes, one question I had was if it might look in PPAGE instead of DPAGE
>because I didn't know how the tools distinguish the three realms of
>memory (fixed, DPAGE, PPAGE). I guess NoICE would interperet these
>addresses 3000=fixed, F3:7000=DPAGE, F3:8000=PPAGE
>
>To justify my uncertainty, the Motorola linear format gives no way to
>distinguish. $3000 then means either start of DPAGE 3, offset $3000 of
>PPAGE 0, or the 16bit address, all are unrelated. In GCC I use a
>special version using offset regions (for HC12/S12) where [0..0xffff]
>is fixed 16bit, [0x10000..0xfffff] is PPAGE [0x00..0x3f] which is
>visible at the window [0x8000..0xbfff]. I like GCC, it's easier to
>type 0xf2000 than $38:$a000.
>
> > It's not a prefix. aaa.bbb means some memory region from aaa to bbb.
>
>Oh thanks, just bad choice of syntax. Two dots ".." would work but not
>one dot. Even a dash '-' or colon ':' commonly means range but I've
>never seen a single dot. Makes it hard for us natural experts.
>
>Well it would be easy if the problem is JP5, but I think it could be
>the method of NoICE trying to modify the RAM. It is often the little
>things, like when this hardware does not allow word access on an odd
>boundary, and one tries to write a 16bits to $3001.
>
>One test I might try is run a program in Flash which tests for
>writability in ext RAM, in order to bypass possible debugger
>complications. That is unless you already know that NoICE has
>successfully written to RAM at $3000 in some other case.
// richard (This email is for mailing lists. To reach me directly, please
use richard at imagecraft.com)

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Re: How to use the external ram (HC12compact) - Edward Karpicz - Sep 21 8:25:06 2006
Jefferson Smith wrote:
> --- In 6...@yahoogroups.com, "Edward Karpicz"
wrote:
>> No, "write error" can't be from ICC12. I think that NoICE
>> complains it can't write RAM that is not enabled out of reset
>> to special mode. I said previously that IMO OP should manage
>> to enable that RAM first, then try to
>> load program to enabled RAM.
>
> Hi Edward, I wasn't referring to the error message. I hope you will
> understand I am only uninformed about the specific tool
> syntaxt/terminology. I am not unintelligent in general ;)
> BTW I had forgot what debuger was used besides twinpeeks. I do use
> NoICE for 9S12.
It's a problem you are cutting to much from previous replies; maybe not a
problem for you but real problem for me. Having only the lines above I don't
know what to answer, neither I don't see your point. Pasting first thread
message back:
--------------
Hello,
iīm working with the HC12compact, ICC12, noice and a compod.
my problem is that i canīt use the external ram from $2000 to $8000.
in icc12 i set the program memory to $0900 the data memory to $0800
(this is the internal ram $0800 to $0C00).
the stackpointer is set to 0C00.
with these settings everything works well, until i use more than 10
integers or 4 interrupts.
how can i activate the ram from $2000 to $8000 to use more integers and
interrupts?
i donīt want to copy the whole program into the flash, because than i
couldnīt use noice and the compod anymore.
-------------
Yes, It's not easy to understand this. What I read from between these
lines...
1. OP is using NoICE debugger + ComPOD BDM.
2. He's using HC12Compact board. Target chip is 812A4. A4 has some small
onchip RAM and EEPROM. But there's a lot of offchip external flash and RAM.
3. Problem is OP "can't use external RAM from $2000 to $8000". It's a puzzle
what was meant by "can't use". I think the clue is in last lines of that
message:
4. "I don't want to copy ... program to flash... because thEn I couldn't use
NoICE and ComPOD anymore". What could this mean and why NoICE+BDM could be
not useful to debug program in flash? I think that it's due the fact that A4
family doesn't have hardware breakpoints. => Only software breakpoints may
be used on 812A4. NoICE supports software brakpoints and they are
implemented by substituting temporarily opcode at breakpoint address by BGND
opcode. When program stops at BGND, NoICE restores opcode at breakpoint.
Program memory is modified as 2x is not more times the times target hits
BGND instruction. => OP needs to load program into RAM. 812A4 onchip RAM is
small => he needs to load program into external RAM.
5. Why it could be problematic to load program via BDM into external RAM?
I'm not familiar with A4 and HC12Compact but I guess that external
HC12Compact RAM address decoding is done using nice 812A4 chip select pins.
These chipselect pins must be configured before accessing external RAM;
that's why OP may need to use special ICC12 startup file. After reset to
normal mode, startup code in EEPROM/flash could be executed, chip selects
would be configured, external RAM "plugged" into HC12 address space and the
rest of program code could R/W that external RAM. But... when someone tells
NoICE to Load code, target is first reset to special mode, chip select
configuration is lost and I guess that HC12Compact RAM gets not accessible
via BDM until something configures A4 chipselects again. Startup file
doesn't help here.
That's my IMO. Of course You can be right and I can be wrong. I was just
trying to help, sorry if I made it worse. Let me leave this thread just now,
I can't afford spending so much time guessing and decifiering what was meant
by this or that.
Regards.
Edward
> The question was, what is the meaning of "set the program memory to
> $3000"? Don't you agree that would be set in ICC12? Maybe it's just a
> mis-wording... the OP could mean using the debugger to write to
> location $3000. I see two possibilities... write direct with NoICE
> (Memory or Watch windows), or configure ICC12 to allocate $3000 for
> program space (I presumed the latter).
>
> I read the HC12compact manual about external RAM at $3000. It says
> it's DPAGE 243. The Sch shows that JP5 should jump pins 1-2 if it has
> the standard 256K RAM, or 2-3 for 1MB. Just suggesting to make sure
> the jumper is correct. It looks possible though that the jumper might
> make some RAM visible there either way, but don't know enough about
> the hardware.
>
>> Expanded memory in ICC12 = paged memory (PPAGE, PPAGE window at
>> $8000..0xBFFF etc). Of course it shouldn't be enabled for code in
> RAM at
>> 3000..xxxx
>
> Yes, one question I had was if it might look in PPAGE instead of DPAGE
> because I didn't know how the tools distinguish the three realms of
> memory (fixed, DPAGE, PPAGE). I guess NoICE would interperet these
> addresses 3000=fixed, F3:7000=DPAGE, F3:8000=PPAGE
>
> To justify my uncertainty, the Motorola linear format gives no way to
> distinguish. $3000 then means either start of DPAGE 3, offset $3000 of
> PPAGE 0, or the 16bit address, all are unrelated. In GCC I use a
> special version using offset regions (for HC12/S12) where [0..0xffff]
> is fixed 16bit, [0x10000..0xfffff] is PPAGE [0x00..0x3f] which is
> visible at the window [0x8000..0xbfff]. I like GCC, it's easier to
> type 0xf2000 than $38:$a000.
>> It's not a prefix. aaa.bbb means some memory region from aaa to bbb.
>
> Oh thanks, just bad choice of syntax. Two dots ".." would work but not
> one dot. Even a dash '-' or colon ':' commonly means range but I've
> never seen a single dot. Makes it hard for us natural experts.
> Well it would be easy if the problem is JP5, but I think it could be
> the method of NoICE trying to modify the RAM. It is often the little
> things, like when this hardware does not allow word access on an odd
> boundary, and one tries to write a 16bits to $3001.
>
> One test I might try is run a program in Flash which tests for
> writability in ext RAM, in order to bypass possible debugger
> complications. That is unless you already know that NoICE has
> successfully written to RAM at $3000 in some other case.

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to use the external ram (HC12compact) - Jefferson Smith - Sep 21 15:06:13 2006
--- In 6...@yahoogroups.com, Richard
wrote:
>
> Sorry, coming late to the party :-) After looking through all the
> emails, it is not clear to me what the user's problem or question
> is. I would highly recommend the user gets a simple program to work
> first without external SRAM, then go from there. I am almost certain
> that the DPAGE/PPAGE/etc. discussion is beyond what we are talking
> about here.
[Don't worry, I'm used to people not understanding me. I am not
talking about manipulating DPAGE/PPAGE/etc and using the window, but I
see that correlating the two address spaces is confusing. If one wants
expanded RAM as in the HC12compact fixed address space [$2000..$6fff],
you need correct external address lines and chip enable lines
accordingly. My monolog is about how the lines are translated. See the
manual p.13 (p.15 in downloaded pdf). Generally if you can't get DPAGE
243 then you won't get RAM at $3000 (same RAM).]
But here is another possibility about what sebastian_nowak2 was doing
wrong. Stepping through...
1. works to load prog and data to internal ram (i.e. $0800 to $0C00)
2. Need mor space (stack is overflowing) but needs to be RAM for
debugging purpose
3. problem trying to write to fixed external RAM (example $3000)
4. Has put this code
movb #$0c,PEAR ; LSTRE+RDWE, ECLK
movb #$3F,CSCTL0 ; Enable CSP0+CSD+CS3+CS2+CS1+CS0
movb #$10,CSCTL1 ; CSD covers $0000-$7fff
movb #$30,CSSTR0 ; CSP0+CSD not stretched (CSP1:3x)
movb #$FF,CSSTR1 ; CS0..3 stretched (3x)
movb #$fe,PPAGE ; Program Page $FE
movb #$c0,WINDEF ; DWEN+PWEN
movb #$0f,MXAR ; A16E...A19E
**in the user program** to enable RAM. Chicken before the egg syndrome?
Sure the loaded program will enable external RAM, but how to load the
program into external RAM that should execute and then enable external
RAM?
I don't know how the debugger works (BDM? preloaded monitor code?) but
it would have to set the above registers before loading the program.
If not, you'd have to manipulate those registers with debugger and
enable expanded RAM before loading the program.
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to use the external ram (HC12compact) - Nowe...@web.de - Sep 27 9:33:26 2006
hello,
thank you for your answers so far.
this post:
1. OP is using NoICE debugger + ComPOD BDM.
2. He's using HC12Compact board. Target chip is 812A4. A4 has some small
onchip RAM and EEPROM. But there's a lot of offchip external flash and RAM.
3. Problem is OP "can't use external RAM from $2000 to $8000". It's a puzzle
what was meant by "can't use". I think the clue is in last lines of that
message:
4. "I don't want to copy ... program to flash... because thEn I couldn't use
NoICE and ComPOD anymore". What could this mean and why NoICE+BDM could be
not useful to debug program in flash? I think that it's due the fact that A4
family doesn't have hardware breakpoints. => Only software breakpoints may
be used on 812A4. NoICE supports software brakpoints and they are
implemented by substituting temporarily opcode at breakpoint address by BGND
opcode. When program stops at BGND, NoICE restores opcode at breakpoint.
Program memory is modified as 2x is not more times the times target hits
BGND instruction. => OP needs to load program into RAM. 812A4 onchip RAM is
small => he needs to load program into external RAM.
5. Why it could be problematic to load program via BDM into external RAM?
I'm not familiar with A4 and HC12Compact but I guess that external
HC12Compact RAM address decoding is done using nice 812A4 chip select pins.
These chipselect pins must be configured before accessing external RAM;
that's why OP may need to use special ICC12 startup file. After reset to
normal mode, startup code in EEPROM/flash could be executed, chip selects
would be configured, external RAM "plugged" into HC12 address space and the
rest of program code could R/W that external RAM. But... when someone tells
NoICE to Load code, target is first reset to special mode, chip select
configuration is lost and I guess that HC12Compact RAM gets not accessible
via BDM until something configures A4 chipselects again. Startup file
doesn't help here.
and the last post explained my problem very good.
sorry that it was not clear in the first post.
i understand the "chicken befor egg" syndrom.
but how can i write my "activate external ram"-code in the internal ram at $0800, and my
mainprogramm at $3000 for example?
my jumper 5 is set to 2-3 which is correct for external ram.
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!
(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Jefferson Smith - Sep 27 14:10:16 2006
--- In 6...@yahoogroups.com, Noweks@... wrote:
...
> After reset to normal mode, startup code in EEPROM/flash could be
> executed, chip selects would be configured, external RAM "plugged"
> into HC12 address space and the rest of program code could R/W that
> external RAM. But... when someone tells NoICE to Load code, target
> is first reset to special mode, chip select configuration is lost
> and I guess that HC12Compact RAM gets not accessible via BDM until
> something configures A4 chipselects again. Startup file doesn't help
> here.
>
> and the last post explained my problem very good. sorry that it was
> not clear in the first post.
>
> i understand the "chicken befor egg" syndrom.
> but how can i write my "activate external ram"-code in the internal
> ram at $0800, and my mainprogramm at $3000 for example?
AFAIK, NoICE would need to allow a method of configuring the registers
after reset and before downloading the program to external RAM. I
believe NoICE only resets the target once on connect, not again just
before downloading. You can auto-run a NoICE script each time it is
reset, see "Play this file after Reset" in Target Communications
dialog. That's where I would configure the registers. My version is:
NoICE12.EXE version 8.5.0.1350 (for 68HC12)
And I suppose you select "Target Chip/Environment" = 68HC812A4 RAM
> my jumper 5 is set to 2-3 which is correct for external ram.
I deduce you are implying you have 1MB (not the standard 256KB) of
external RAM.

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - Nowe...@web.de - Sep 28 10:47:05 2006
>I deduce you are implying you have 1MB (not the standard 256KB) of
>external RAM.
>
yes i made a mistake here!
i only have 256kB.
but the Problem is still the same.
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!
(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to use the external ram (HC12compact) - "John Hartman (NoICE)" - Sep 29 15:38:57 2006
>5. Why it could be problematic to load program via BDM into external RAM?
>I'm not familiar with A4 and HC12Compact but I guess that external
>HC12Compact RAM address decoding is done using nice 812A4 chip select pins.
>... when someone tells
>NoICE to Load code, target is first reset to special mode, chip select
>configuration is lost and I guess that HC12Compact RAM gets not accessible
>via BDM until something configures A4 chipselects again. Startup file
>doesn't help here.
When you install NoICE, it should place a file called
Elektronikladen hc12compact normal wide no EEPROM.noi
in your NoICE/bin directory.
This file contains commands to set up the chip selects on the A4 to access
the HC12Compact's RAM.
NoICE can be set up to play this file at startup and at every target
reset. To configure this, select "Options", "Target Communications". In
the dialog that appears, press the "Browse" button to the right to "play
this file after reset" and select the file. Then press OK.
Best regards, John Hartman
NoICE Debugging Tools
http://www.noicedebugger.com
[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: How to use the external ram (HC12compact) - Jefferson Smith - Oct 3 18:15:31 2006
--- In 6...@yahoogroups.com, "John Hartman (NoICE)"
wrote:
> When you install NoICE, it should place a file called
> Elektronikladen hc12compact normal wide no EEPROM.noi in your
> NoICE/bin directory.
>
> This file contains commands to set up the chip selects on the A4 to
> access the HC12Compact's RAM.
>
> NoICE can be set up to play this file at startup and at every target
> reset. To configure this, select "Options", "Target Communications".
> In the dialog that appears, press the "Browse" button to the right
> to "play this file after reset" and select the file. Then press OK.
Oh, just what I thought should be written for this purpose. I'm
certain this is where the problem is. Just needs to "play this file at
startup"
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!

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