James Murray

S12XE EEPROM Emulation query command

Discussion created by James Murray on Oct 19, 2008
Latest reply on Oct 24, 2008 by Pedro Palacios
Ok,
I've got my application and a port of the monitor code running on the S12XE and have D-flash partitioned and programmed. However I cannot understand the datasheet on the emulation query command.

It says:
The EEPROM Emulation Query command returns EEE partition and status variables.
            Table 24-73. EEPROM Emulation Query Command FCCOB Requirements
                CCOBIX[2:0]                   FCCOB Parameters
                    000               0x15                      Not required
                    001                         Return DFPART
                    010                         Return ERPART
                                               Return ECOUNT1
                    011
                    100      Return Dead Sector Count    Return Ready Sector Count

Upon clearing CCIF to launch the EEPROM Emulation Query command, the CCIF flag will set after the
EEE partition and status variables are stored in the FCCOBIX register.If the Emulation Query command
is executed prior to partitioning (Partition D-Flash Command Section 24.4.2.14), the following reset
values are returned: DFPART = 0x_FFFF, ERPART = 0x_FFFF, ECOUNT = 0x_FFFF, Dead Sector
Count = 0x_00, Ready Sector Count = 0x_00.


But also it says:
Register Error Bit                                 Error Condition
                   Set if CCOBIX[2:0] != 000 at command launch
         ACCERR
                   Set if command not available in current mode (see Table 24-30)

I'm not understanding this, how do I set FCCOBIX to anything other than zero without getting ACCERR

I want to read DFPART in the monitor to determine whether to do a d-flash partition or erase all d-flash sectors.
Reading from 0x12_0000/0x12_0001 which is supposed to be DFPART yields zero when I was expecting 0x80

The d-flash seems to work correctly from my application, but I'm not getting a complete write from the monitor code and need to ensure I have it initialised correctly.

Has anyone got a code example?

James

Outcomes