Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
9S08DZ96 with EB-Command
Andreas K. migrated on Dec 31, 2013 at 11:00 AM
No staff assigned yet

  • Hey!

    How could I delete or overwrite only some bytes in eeprom?
    Do I override the bytes with "PB startaddr aa bb"? (EDIT: I got an error: Error during last byte programming (by GUI), with simple application & cfg file: error 18)

    Kind regards,

    see my config file:
    RE ;Reset the MCU
    CM D:\tools\pemicro\1.66\progHCS08sz\9S08DZ96.S8P ;Enable HCS908RC16 Flash
    PB 3D50 11 EE 00 00 00 00 FC 78 ;Program bytes
    QU ;Quit

    old stuff:
    //EB 3D50 3D57 ;Erase the byte
    //VR 3D50 3D57 ;Verify the module again





    Comments

  • Hi andyk,

    For EEPROM, I believe erasing and programming are two separate steps. You must erase the bytes first before you program new data. Could you verify that the memory region is erased (all 0xFF) before you program it?

    Best regards,
    Edison

  • QUOTE (Edison Tam @ Oct 14 2010, 08:25 PM) [legacy comment]
    Hi andyk,

    For EEPROM, I believe erasing and programming are two separate steps. You must erase the bytes first before you program new data. Could you verify that the memory region is erased (all 0xFF) before you program it?

    Best regards,
    Edison


    I would delete the 8 bytes, but there is no command for ereasing only some bytes. See the commands in "old stuff" (first post), I would need an algorithmus with an EB, VR and a working PB command.

    Kind regards,

  • sry for second reply, but I would need as soon as possible a statement. do you have the same error with PB?

  • QUOTE (andyk @ Oct 19 2010, 02:19 AM) [legacy comment]
    sry for second reply, but I would need as soon as possible a statement. do you have the same error with PB?


    Unfortunately, the flash and eeprom on the 9S08DZ96 do not support byte erases. Below are all the available Flash and EEPROM commands that exist on the MC9S08DZ96:

    Command FCMD Equate File Label
    Blank check 0x05 mBlank
    Byte program 0x20 mByteProg
    Burst program 0x25 mBurstProg
    Sector erase 0x40 mSectorErase
    Mass erase 0x41 mMassErase
    Sector erase abort 0x47 mEraseAbort

    In the eeprom, you can use the sector erase command. A sector erase for an eeprom address will erase 8-bytes at a time. For instance, the command "ES 1400" will erase bytes from 0x1400..0x1407. The sector erase will only erase sectors. In other words, if you provide address 1401 as a parameter it will still only erase 0x1400..0x1407.

    After performing the sector erase, you can use the "PB" program bytes command to program the new data. Also, please keep in mind that the "VR ;Verify Range" command only compares data on the device against data in your selected .S19. The "VR ;Verify Range" command is not meant to be used with the "PB ;Program Bytes" command.

    Regards,
    Juan

Add comment


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







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