Downloading code to MCS08QE128 windowed area

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Downloading code to MCS08QE128 windowed area

Jump to solution
1,897 Views
TimA
Contributor I
Using the debugger in CW 6.1 Special Edition, I'm having difficulties downloading code to flash at $8000. I'm not currently using bank switching at all. Although CW reports programming at $8000, it appears to end up down around zero (through RAM!). Changing the start address to $4000 or $C000 works as expected.
The code to be programmed is in .S19 format, so I can clearly see the addresses in the file are correct.

Any help would be much appreciated - thanks.
Labels (1)
Tags (1)
0 Kudos
1 Solution
442 Views
Navidad
Contributor III
TimA,

I am not familiar with the command files you mention. However, maybe my comments below will help you.

The QE128 is a bit different from other HCS08 derivatives from the memory management point of view. It can address memory above the 64k boundary a "normal" hc08 can address. A paging mechanism was put into place to support this. Also, the memory management unit has this linear address registers that can be used to access the memory in a linear fashion.
Taking into account this details about the chip, there are two "views" of the memory: a paged one and a linear one. Paged addresses are composed of three bytes, the page number and an address within the paging window. The addresses you are using in the linker parameter file are of this kind, if not specified otherwise (with the 'F address space designator). Of course, this does not apply to addresses outside the paging window (for instance 0xC002).
All in all: address 008000 refers to the first byte of page 0. If you want to place something within page 2 you need to use 028000-02BFFF.

View solution in original post

0 Kudos
3 Replies
443 Views
TimA
Contributor I
The problem seems to be in the 9s08qe128.S8P programming command file:

COMMENT2=S-Record Addresses $2080-$3FFF --> Page 0
COMMENT1=S-Record Addresses $4000-$7FFF --> Page 1
COMMENT3=S-Record Addresses $8000-$BFFF --> Page 0
COMMENT4=S-Record Addresses $C000-$FFFF --> Page 3
COMMENT5=All Pages can be accessed with 24-Bit Address...
COMMENT6=... eg $28000-$2BFFF --> Page 2

Why would $8000-$BFFF be mapped to Page 0, instead of Page 2? Can anyone explain Comment6?
It's not obvious how to change this behaviour on any of the other lines - is anyone familiar with these command files?

Complete file attached.

Thanks.
0 Kudos
443 Views
Navidad
Contributor III
TimA,

I am not familiar with the command files you mention. However, maybe my comments below will help you.

The QE128 is a bit different from other HCS08 derivatives from the memory management point of view. It can address memory above the 64k boundary a "normal" hc08 can address. A paging mechanism was put into place to support this. Also, the memory management unit has this linear address registers that can be used to access the memory in a linear fashion.
Taking into account this details about the chip, there are two "views" of the memory: a paged one and a linear one. Paged addresses are composed of three bytes, the page number and an address within the paging window. The addresses you are using in the linker parameter file are of this kind, if not specified otherwise (with the 'F address space designator). Of course, this does not apply to addresses outside the paging window (for instance 0xC002).
All in all: address 008000 refers to the first byte of page 0. If you want to place something within page 2 you need to use 028000-02BFFF.
0 Kudos
443 Views
TimA
Contributor I
Navidad

Thanks, that explains everything. I hadn't realised that S2 records had acquired this additional interpretation.
0 Kudos