Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

In-Application Programming of the Philips P89V51RC2 IAP

Status
Not open for further replies.

geek8051

Newbie level 2
Joined
Mar 20, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
rx2iaplib

I am trying to perform the In-Application Programming of the P89V51RC2. I have written this section of code for the program but it doesn't seem to be working at all. It
seems that it just kept printing Test Test Test message but never perform the erase
procedure. Anyone could give me suggestion? Thanks.

//erase block function
RSEG ?PR?_iap_erase_block?RX2IAPLIB
_iap_erase_block:
PUSH IE ; disable interrupts
CLR EA
MOV A,CMOD
MOV R2,A ; store copy of CMOD
JNB ACC.6,?IAPTAG13 ; if watchdog enabled then disable
ANL CMOD,#0BFH
?IAPTAG13:
ANL FCF,#0FCH ; enable bootrom
MOV R1,#08H
MOV DPH,R6 ; address to program
MOV DPL,R7
CALL 01FF0H ; call iap routine
ORL FCF,#01H ; disable bootrom
MOV CMOD,R2 ; restore CMOD (restore watchdog state)
POP IE ; restore interrupts to initial state
RET
; end of iap_erase_block

//main
sfr WDTC = 0xC0;
#define KILL_WDT WDTC = 0
#define DISABLE_ALL_INTERRUPT EA = false; ///< Disable all interrupt.

void main( void )
{
int i;
DISABLE_ALL_INTERRUPT //disable all interrupt
KILL_WDT; // Disable watchdog
TI = false; // Clear serial transmission interrupt
RI = false; // Clear serial receiving interrupt

initSioPoll(); // initialize serial port
printf("Test");

for(i = 0; i < 10; i++){
iap_erase_block(i * 128);
}

while(1);
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top