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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/10/07 16:51
Read: times


 
#148050 - Keil ISD51 debugger
I am trying to use the Keil ISD51 monitor to debug my target and have run into problems establishing communication over the serial port. My application uses the serial port so I had to add software to share the port. When I load my application on the target chip AT89C51ED2 I am able to send and receive commands using hyperterminal, but when I download with the debugger software added hyperterminal no longer works. The application has a crystal frequency of 11.0592 and I would like to use a baudrate of 19200 or 9600. The code to initialize the port follows (for 9600):
  
PCON = 0;		// sfr addr: 0x87
IEN0 = 0;  	        // ALL IRQ'S OFF, sfr it reg addr: 0xa8
IO = 0xFF;  		// INIT P0, sfr addr: ????
P1 = 0xFF;  		// INIT P1, sfr addr: 0x90
P2 = 0xC7;  		// INIT P2, sfr addr: 0xA0
P3 = 0xFF;  		// INIT P3, sfr addr: 0xB0
//Change for ISD51 debugger
T2CON   = 0x30;        /* Use Timer 2 For Baudrate */
TMOD = 0x31;           // Turn off timer 1, sfr timer addr: 0x89
TCON = 0x11;           // sfr timer addr: 0x88
//Change for ISD51 debugger, use timer 2 to set serial port baudrate
RCAP2H  = 0xFF;
RCAP2L  = 0xDC;  /* 9,600 Baud @ 11.0592MHz */
TH2	= 0xFF;
TL2	= 0xDC;
TR2 	= 1;
SCON 	= 0x50;  // 8 BIT UART, sfr uart addr: 0x98
EA      = 1;     /* Enable Global Interrupts */
    
AUXR = 0x1C;  // SET FOR INT RAM 1768 BYTES
ENO = 0;      // sfr P3^3 (sbit type), or specifically P3 bit 3
EN= 0;        // sfr P3^4 (sbit type), or specifically P3 bit 4 

I think that I calculated the baudrate correctly and I've read every datasheet, message, document, and article that I could find on how to correctly set it up. I just can't find what's wrong.
I also had to change the interrupt handler for the serial port since my application has to share it with the debugger. In the ISD51 assembler code where it processes the serial interrupt, it looks for a code of x'A5' as a cue for the debugger SW. I added a call to my subroutine if the data is not x'A5' because it means my application is trying to read something.
I would appreciate any help that you could provide!
Thanks, Nida

List of 6 messages in thread
TopicAuthorDate
Keil ISD51 debugger            01/01/70 00:00      
   Try Keil?            01/01/70 00:00      
      Verify correct serial port commands            01/01/70 00:00      
         you did            01/01/70 00:00      
   Do it Keil's way            01/01/70 00:00      
      Keil examples            01/01/70 00:00      

Back to Subject List