This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

can't connect ISD51 properly to the target system (NXP P89C51RB2BA.)

I'm trying to debug a very simple program on an NXP P89C51RB2BA. I've read all the tutorials.

Following the troubleshooting chapter of ISD51 User's Guide by the link "http://www.keil.com/support/man/docs/isd51/isd51_trouble.htm", I can properly ran the example code ("\Keil\C51\ISD51\Examples\Generic_8052") in the simulator. Entering sin=0xA5 in the Command Window, the serial window displays 0xF7 followed by six more hex values.

Also, if I invoke the serial communication function in the example code and download it to the flash memory by Flash Magic (Version 4.24 1304), the HyperTerminal can get the character A from the the 8051's serial port.

However, I still can't connect properly to the target system. Approximately 2 seconds after pressing the debug button, this window appears:

ISD51 Error
-------------------------------------------------------
Communication problem with the ISD51!
-Please check if the loaded application matches the ROM content!
-Please check if the baudrates of the PC and the target system match exactly!

This error message doesn't make sense to me because there are no problems related to ROM contents or baudrates.

The testing baudrate is 4800 @ 20MHz with X2 mode off. Also, I tried several other baudrates. All of them are failed on the communication.
What can I do to fix this problem?

Thanks!

The following is the code for testing:

#include <REG51F.H>
#include <intrins.h>
#include <absacc.h>
#include "ISD51.h"

unsigned char j;

#define Port_D XBYTE [0xFFA0] // bit 0: switch S1 // bit 1: switch S2 // bit 4: LED D1 // bit 5: LED D2

unsigned char code testarray[] = "Some Text";

#if 0 // uncomment this function to verify serial communication

/* * Test Function: verify serial communication with HyperTerminal */
void TestSerial (void) { char c = 'A';

TI = 1; while (1) { if (RI) { c = SBUF; RI = 0; } while (!TI); TI = 0; SBUF = c; }
}

#endif

void delay(void) { long i;

i = 0x800; while(i--);
}

void main (void) { unsigned int i;

T2CON = 0x34; /* Use Timer 2 as baudrate generator */

#if 0 RCAP2H = 0xFF; RCAP2L = 0xD9; /* 19230 baud @ 12MHz */ /* 38460 baud @ 24MHz */
#endif

RCAP2H = 0xFF; /* 9615 baud @ 20MHz with X2 Mode off */ RCAP2L = 0x80; /* 19230 baud @ 20MHz with X2 Mode on */ //RCAP2L = 0xBF; /* 19230 baud @ 20MHz with X2 Mode on */

SCON = 0x50; /* enable serial uart & receiver */ EA = 1; /* Enable global interrupt flag */

//TestSerial (); // uncomment this function to verify serial communication

#if 0 // init ISD51 and start user program until the uVision2 Debugger connects ISDinit (); // initialize uVision2 Debugger and continue program run
#endif

#if 0 // init ISD51 and wait until the uVision2 Debugger connects ISDwait (); // wait for connection to uVision2 Debugger
#endif

for (i = 0; i < sizeof (testarray); i++) { j = testarray[i]; }

while (1) {
#if 1 // init ISD51 only when the uVision2 Debugger tries to connect ISDcheck(); // initialize uVision2 Debugger and continue program run
#endif _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); Port_D = (Port_D) ^ 0x30; P1 ^= 0x10; _nop_(); _nop_(); _nop_();
#if 0 // you may use ISDbreak when ISD51 is started with ISDcheck or ISDwait ISDbreak (); // hard coded stop (breakpoint)
#endif delay(); _nop_(); _nop_(); _nop_(); }
}

0