| ??? 03/28/13 08:55 Read: times |
#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;
}
|
| Topic | Author | Date |
| isp mode with handshake protocal using rs232 and 8051 | 01/01/70 00:00 | |
| difficult | 01/01/70 00:00 | |
| need further explanation | 01/01/70 00:00 | |
| Whose code ? | 01/01/70 00:00 | |
examples | 01/01/70 00:00 |



