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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Yuva Raj
03/28/13 02:55
Read: 2105 times
Seri Kembangan
Malaysia


 
#189578 - isp mode with handshake protocal using rs232 and 8051
i'm using keil and c source code to enter isp mode without an external circuit. I cannot set the RTS pin to PSEN AND THE CTS pin to RESET and i need advice on the code that it would work or need to modify a little bit more. please help me on this.



#include <reg51.h>
sbit CTS = P10;
sbit RTS = P29;
void init();
void transmit();
void TODelay();
void main()
{
 init();
 transmit();
 ISP();
 }

void init()
{
 TMOD=0x20;  
 TH1=0XFD; 
 SCON=0x50;
 TR1=1;
}

void transmit()
{
 while(RTS = 1)
 {
  CTS = 1;
  while(RI == 0)
  RI = 1;
  SBUF = 0;
 }
 TODelay();
 CTS = 0;
 TODelay();
}

void TODelay()
{
 TMOD = 0x01;
 TL0 = 0x00;
 TH0 = 0x35;
 TR0 = 1;
 while (TF0 == 0);
 TR0 = 0;
 TF0 = 0;
}

void ISP()
{
 AUXR1 = 0x20;
 R0 = ; 
 R1 =0x06;
 DPTR = 0x00;
 while(ACC == 0);
 system("C:Program FilesFlash MagicFlashMagic.exe");
 ACC = 1;
}




List of 5 messages in thread
TopicAuthorDate
isp mode with handshake protocal using rs232 and 8051      Yuva Raj      03/28/13 02:55      
   difficult      Erik Malund      03/28/13 09:36      
      need further explanation      Yuva Raj      03/28/13 18:05      
         Whose code ?      Jim Granville      03/28/13 18:25      
            examples      Yuva Raj      03/31/13 20:58      

Back to Subject List