programming the xdp512 eeprom not working

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

programming the xdp512 eeprom not working

2,267 Views
e_taylor
Contributor III
hello again:
 
i'm having a mental block on something that should be quite straight forward. following the flow chart of the S12XEETX4KV2 module i arrived at this code.
 
EPROT is set at the start  
 
movb #%11111000,EPROT
 
and the eeprom is erased by the start of code warrior.
 
when i call the routine it does not program the word as expected.
 
 
LoadMachineDefaults
   ldx #DJoystick1XMax     ;start address of default data
  ldy #Joystick1XMax     ;start address of eeprom
    brset ECLKDIV,mECLKDIV_EDIVLD,CheckCBEIF
    movb #%01001010,ECLKDIV
CheckCBEIF brclr ESTAT,#mESTAT_CBEIF,*
   ldd 2,x+
  std 2,y+
  movb #$20,ECMD     ;
  movb #mESTAT_CBEIF,ESTAT
  brclr ESTAT,#mESTAT_CBEIF,*
  brclr ESTAT,#mESTAT_CCIF,*
  rts
 
any help is greatly appreciated!
 
 
regards,
 
ed
Labels (1)
0 Kudos
3 Replies

1,187 Views
kef
Specialist I
How do you check it doesn't program? Debugger may not update contents of nonvolatile memory. If you are really sure it doesn't work, then inspect ESTAT before and after programming routine. What's the state of ACCERR and PVIOL bits.
0 Kudos

1,187 Views
e_taylor
Contributor III
hi kef:
 
thanks again for your reply. i was asleep at the switch and was looking at $800 which is the paged window and not location $c00 which indeed programsjust fine.
 
 
 
regards,
 
ed
0 Kudos

1,187 Views
e_taylor
Contributor III
hi kef:
 
thanks for your reply! the debugger is set to display the contents of nonvolitile memory. i used the following code which is contrary to the manual and will only work in special mode (bdm connected) to write to the eeprom. it works and the debugger displays the correct data. this is not the correct method and i'll need to figure it out. i'm now suspect that the eeprom circuit may not work correctly with the bdm pod attached. i was polling the ACCERR and PVIOL prior to the routine.
 
 
thanks again and a happy new year to you!
 
 
ed
 
   ldx #DJoystick1XMax     ;start address of default data
  ldy #Joystick1XMax     ;start address of eeprom
    brset ECLKDIV,mECLKDIV_EDIVLD,CheckCBEIF
    movb #%01001010,ECLKDIV
CheckCBEIF brclr ESTAT,#mESTAT_CBEIF,*
LMDLoop  ldd 2,x+
  std EDATAHI
  sty     EADDRHI
  iny
  movb #$20,ECMD     ;
  movb #mESTAT_CBEIF,ESTAT
  brclr ESTAT,#mESTAT_CBEIF,*
  brclr ESTAT,#mESTAT_CCIF,*
  cpx #EndOfMachineDefaults+1 ;#EndOfMachineDefaults+1
  blo LMDLoop
0 Kudos