Cart New Account Login Search
HomeAbout usProductsSupportForumsBlogCustomer Service

PROG12Z and the 9S12XE Microcontroller Family

In-Circuit Flash Programming , MC(9)S12(X) Microcontrollers Add comments

P&E's flash programming software PROG12Z now supports the Freescale MC9S12XE family of microcontrollers. 

The MC9S12XE family of microcontrollers comes with unique flash memory called D-Flash that can be allocated for Emulated EEPROM (EEE)  which mimics the small sector size and endurance of real eeprom. Before you can program the D-Flash or EEE, the D-Flash must be configured with the "Full Partition" command PROG12Z. This article discusses how to program the D-Flash of MC9S12XE100 using PROG12Z. The P-Flash does not support the allocation of EEE and therefore does not require partitioning.

Overview

The size of the D-Flash on the MC9S12XE can be up to 32KB or 128 sectors of 256 bytes each. You can allocate up to 4KB or 16 pages of 256 bytes each  to be used for EEE. Please see Freescale application note AN3490 for a more detailed overview of the EEE implementation. There are two  parameters that control how the software configures the memory: DFPART and ERPART.

DFPART = Number of D-Flash sectors reserved as User D-flash (128 total)

ERPART = Number of pages reserved for EEE (16 total)

The two parameters are required to meet two size conditions to be valid:

1. (128-DFPART) / ERPART >= 8

2. (128-DFPART) >= 12 if ERPART==1

The following table shows how the flash memory can be allocated towards D-Flash and EEE. The arrows indicate that any number in that range is a valid amount of sectors for D-Flash. DFPART and ERPART are in hexadecimal notation.

Programming

Open Prog12z and connect to the target board. After entering background mode, the software will prompt you for an algorithm. There are two seperate algorithms for D-Flash and EEE. The D-Flash algorithm is "Freescale_9S12XEP100_1x16xmax16k_max32k_Linear_User_Dflash.12P". The EEE algorithm is "Freescale_9S12XEP100_1x16xmax2k_max4K_EEPROM_linear_1k_page.12P".

Lets choose the algorithm for D-Flash. After selecting your S19 file and before programming, execute the Full Partition (FP) command. The software will prompt you to enter a value in hexadecimal that is the combination of DFPART and ERPART parameters. 

Examples:

"8000" - Enables 128 sectors (32 KB) of D-Flash and 0 pages of EEE 

"200C" - Enables 32 sectors (8 KB) of D-Flash and 12 pages (3 KB) of EEE

"100C" - Enables 16 sectors (4 KB) of D-Flash and 12 pages (3 KB) of EEE

"0010" - Enables 0 sectors of D-Flash and 16 pages (4 KB) of EEE 

When you want to program the EEE, you should choose the algorithm for EEE. You do not need to run the Full Partition command again unless you want to change the memory configuration. Note that setting up the memory configuration using the FP command will erase all the contents of both D-Flash and EEE.  If you get the error message "Started. Error during .12P specified function.", you have entered an invalid value.

Reading

The D-Flash begins at 0x100000. If all your memory is allocated towards D-Flash only, execute the Upload Module (UM) command to dump the memory to a S19 file. UM reads the entire flash regardless of how it was partitioned. If there is D-Flash and EEE, execute the Upload Range (UR) command instead. For example, if there is 8 KB of D-Flash, then upload the range 0x100000 to 0x101FFF.

 

7 responses to “PROG12Z and the 9S12XE Microcontroller Family”

  1. Debbie Lustic Says:
    We are using the 9s12xep100. As of May 6, 2009, it takes ~10 minutes to program a single device using prog12z. Has this issue been addressed/resolved?

    Thankyou
  2. Johnny Ng Says:
    Hi Debbie,

    We can create a flash programming algorithm that utilizes the PLL in the XE100 microcontroller to increase the speed of flash programming. If you are interested, fill in this request form: http://www.pemicro.com/SRS/create_SR_flashAlgRequest.cfm

    Please provide the speed of your crystal oscillator or external clock.

    Best Regards,
    Johnny
    P&E Technical Support
  3. Maurizio Cilenti Says:
    Hi, can I read all file into the micro if is it protected by password(reading)?

    Maurizio
  4. Johnny Ng Says:
    Maurizio,

    I assume by password that you are referring to the back door key. You can have a back door key in your code to allow you to temporarily unsecure the device and get access to your code. However, P&E's BDM tools do not support the back door key mechanism and so we cannot provide support for it. You will need to communicate with the device through SCI or other interface. Please refer to the Freescale application notes "AN2880: Using the Backdoor Access Capability to Unsecure HCS12 MCUs" and "AN3275: S12 All-Access Bootloader for the HCS12 Microcontroller Family".

    Best Regards,
    Johnny
    P&E Technical Support
  5. Nachman Lupu Says:
    Hello ,

    I work with MC9S12XEP100 and program it with CODEWARRIOR .

    I want to program it with PROG12Z .

    All I can do is FULL PARTITION ( FP).

    Programming the modul with the S19 file from CW gives an error of address .

    No way to change the Base Adress .

    Please help !

    Nachman Lupu
  6. Johnny Ng Says:
    Hello Nachman,

    If you're programming P-Flash, you must use the PHY file that Codewarrior generates.

    http://www.pemicro.com/website_management/faq_view.cfm?id=3

    If the problem is still not resolved, please submit a support ticket with the details of the error message so that one of our engineers can take a look at it.

    Regards,
    Johnny
    P&E Technical Support
  7. Janaki Singotam Says:
    I tried the D-Flash partition for 8KB (32 sectors) of D-Flash and 3KB (12 Sectors) of Emulated ROM by sending the "Full Partition" command "200C". And this i observed the partition "Successful" message on P&E write window.

    But how i can check my D-Flash is partitioned according to the command i have given..??
Please login to post a message on this Post: Login
Home RSS Feeds


© 2012 P&E Microcomputer Systems
Website Terms of Use and Sales Agreement