Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

Please accept the use of cookies on our site

At PEmicro we use web browser cookies in order to provide you with an enhanced experience and in order to be able to do things like shopping cart processing and identify you when you login to our website.

Click here to accept

search inside this forum
search inside all forums
Assembler Segmented support for the MC9S08AC128?
Paul M. Aug 1, 2014 at 01:59 PM (13:59 hours)
Staff: Takao Y.

  • As you know, the MC9S08AC128 has 128K of flash. The assembler for the HCS08 generates S19 files which are inadequate for accessing all of the flash in an application. This is because S19 records only specify 16-bit addresses. Several years ago I did some programming on an HCS12 variant and I wrote a program that took code written for a 16-bit address space with a segment identification scheme and remapped it to a 22-bit address space. Since the addresses used in the assembler are 24-bits I could encode a page number into the upper byte of the program counter. After running my translation program the resulting file was in S28 format. It took quite a bit of effort but it worked. But your burning tool then has to make use of an S28 download image. I wrote my own so it wasn't a problem. Now I am faced with having to use your third party flash burner program. 

    Does P&E provide any support/tools, especially in the assembler, to make use of the whole flash in this way?


  • I see by reading in the 9S08AC128.S8P file that it implies that the PROGHCS08 flash programmers can handle 24-bit addresses and can program pages that are banked into Page 2 of the processor's address space. As I have pointed out however, the S19 format only specifies 16-bit addresses. Files in the S28 format are required in order to specify 24-bit addresses. When loading "Object Files" the PROGHCS08 programmer application does not show files with extension S28 as one of its options. 

    Also, even if the PROGHCS08 application did support the S28 file format there are still some questions that the very brief PROGHCS08 help file does not address. In order for code that is in a banked area of flash to be able to run correctly, it must be mapped to $8000~$BFFF. This means that the high-order two bits of addresses must be binary 10 (i.e. addresses are binary 10##############). So I would presume that the upper byte of any absolute flash address is $##???? where ## is the Page # and ???? is the offset within the page segment (and again of course the two high-order bits are "10"). Now the problem is whether PROGHCS08 can handle S2 and S8 record types in files with Motorola S-Records.

  • Greetings,

    The following is an example of address range of how the srecord file format should look like if it programmed all of 128K of flash:

    008000 - 00BFFF Page 0
    018000 - 01BFFF Page 1
    028000 - 02BFFF Page 2
    038000 - 03BF00 Page 3
    048000 - 04BFFF Page 4
    058000 - 05BFFF Page 5
    068000 - 06BFFF Page 6
    078000 - 07BFFF Page 7

    Note, page 3 does not fill up to the end of the page because there are non-volatile TRIM registers, security bytes, and interrupt vectors that I am avoiding in this example. Also, I avoided programming "$2080-$FFFF" because it sits in the same page zero ($8000-$BFFF).

    S28 files will work, we just use the "s19" nomenclature to tell people that the software accepts srec files.

    Takao Yamada

  • Greetings,

    Were you able to resolve your issue? Do you have any other questions or concerns?

    Takao Yamada

  • Right now I am using the linear model. I won't be addressing the segmented issue for quite a while. I am starting a new project and that means I don't yet have enough code to need the segmented model.

Add comment

   Want to comment? Please login or create a new PEMicro account.

© 2018 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement