Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/27/04 09:04
Read: times


 
#78192 - PROGRAM BYTE IAP 89C51RD2 ACC !00
I've written this flash byte macro for the isd51 demo from Keil. It seem to "work", but returns ACC != 0 indicating an error (Think it's 0xCD). WDT is not in use, as our hardware was designed before this feautre became common. FlashMagic works just fine. I'm ticking the 6clks/sycle box. I've failed to find any messages about simmilar problems. Could it be hardware ? or ? ... Any documentation on the return code(s) from PGM_MTP ?

PGM_MTP EQU 0xFFF0 ; 89C51RD2
XTAL EQU 16 ; Xtal frequency rounded down
sfr AUXR1 =0xA2 ; SFRegister AUXR1 in 89C51RD2
ENBOOT EQU 0x20 ; Bit in AUXR1 to ENable BOOTrom shadow at FC00-FFFF
DISBOOT EQU 0xDF ; Bin in AUXR1 to DISable BOOTrom shadow at FC00-FFFF

CWRITE MACRO
; PUSH IE
; PUSH AR1
; CLR EA ; Dissable all interrupts
ORL AUXR1,#ENBOOT ; Enable shadow BOOTrom at PGM_MTP
MOV DPL,R0 ; DPL <- R0
MOV DPH,A ; DPH <- ACC
MOV R0,#XTAL ; R0 <- #XTAL
MOV R1,#02H ; R1 <- #0x02 { IAP call = "Program Byte". (No WDT) }
MOV A,CBLK ; ACC <- CBLK (IDATA, byte address)
LCALL PGM_MTP ; Returns ACC 0 if o.k. else !0
ANL AUXR1,#DISBOOT ; Disable shadow BOOTrom at PGM_MTP
MOV A,#0
; POP AR1
; POP IE
ENDM

I have a slightly different version of the same called
from "C" that I've used to print the return value.

List of 17 messages in thread
TopicAuthorDate
PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
   RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
      RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
   RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
   RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
      RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
         RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
            RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
   RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
      RE: PROGRAM BYTE IAP 89C51RD2 ACC !00            01/01/70 00:00      
         RE: FLASH OR EEPROM ???            01/01/70 00:00      
            RE: FLASH OR EEPROM ???            01/01/70 00:00      
            RE: FLASH OR EEPROM ???            01/01/70 00:00      
               RE: FLASH OR EEPROM ???            01/01/70 00:00      
                  RE: FLASH OR EEPROM ???            01/01/70 00:00      
                     RE: FLASH OR EEPROM ???            01/01/70 00:00      
                        RE: FLASH OR EEPROM ???            01/01/70 00:00      

Back to Subject List