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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/22/07 01:29
Read: times


 
#135547 - Problems calling ISP/IAP in a Philips P89C51RD2
Hi All,

The problem I'm having is that when I call a function in the IAP that I found in the philips application note AN461 I find that the MCU resets. I have verified that my external watchdog timer isn't the culprit using a scope.

I'm not sure what is happening here as the function seems to return as I see a response on the serial port. I was also wondering if there isn't more detailed documentation could obtain on the the bootload that philips has on this MCU?

Here is the offending code:

void (*fnIAP)() = 0xFFF0;

// Load parameters.
DPL = (unsigned char) CMD_uiCmdHexParameter;
DPH = (unsigned char) (CMD_uiCmdHexParameter>>8);

// Need to load registers r0 and r1 with the clock rate and the command.
#pragma asm
MOV A, XTAL_MHZ
MOV r0, A
MOV A, IAP_CMD_READ_BYTE
MOV r1, A
#pragma endasm

// Pet watchdog for IAP/ISP test. (Period min 500 ms)
XTR_mWATCHDOG();

// Disable interrupts.
EA = 0;

// Enable the BootRom. I'm guessing this is a shadow register.
AUXR1 |= 0x20;

// Need to jump to IAP function call.
fnIAP();

// Disable the BootRom.
AUXR1 &= ~0x20;

// Re-enable interrupts.
EA = 1;

// Need to return the value read from the accumulator.
SRL_fnLoadHexIntTxBuf(ACC);
SRL_fnStartTx();


Any help in this matter would be greatly appreciated. Thank you for taking the time to read the issue.

Chris



List of 5 messages in thread
TopicAuthorDate
Problems calling ISP/IAP in a Philips P89C51RD2            01/01/70 00:00      
   What is bit 7 of IAP_CMD_READ_BYTE?            01/01/70 00:00      
   Problem resolved, function pointer incorrect            01/01/70 00:00      

Back to Subject List