Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Steps to program P89V51RD2 by ISP method using RS232

Status
Not open for further replies.

snayak

Junior Member level 1
Joined
Jun 8, 2012
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,418
Steps to program P89V51RD2 microcontroller by ISP method using RS232

After long discussions and try, I was able to successfully able to program P89V51RD2 by In Situ Programming (ISP) method using RS232. In a hope that it shall be useful to other members, I would like to post my experience with simple steps. For my success, I shall thank all our friends, who have helped me clearing my doubts and have provided their help and suggestions.

Here are the steps to program P89V51RD2 by ISP method using RS232.

My Need:
--------
1. I had to find a microcontroller, which is self programmable, do not need a separate programmer.
2. Circuit should be simple, even a novice can make it and learn.
3. Other tools should be simple and freely available.

So, I choose:
-----------
1. P89V51RD2 microcontroller from Philips. Specifically P89V51RD2FN.
2. Circuit diagram from **broken link removed**
3. SDCC for compiling C programs and FlashMagic for programming the microcontroller.

I made the circuit on a veroboard.
Connected the circuit to PC using serial cable(RS232).

Test code:
----------
test.c
Code:
#include<p89v51rd2.h>
void DeadDelay(unsigned int delay)
{
	unsigned int indexI,indexJ;

	for(indexI=0; indexI<delay; indexI++)
		for(indexJ=0; indexJ<1275; indexJ++);
}
void main(void)
{
	while (1)
	{
		/* Blink LED on Port 0 */
		P0=0x55;
		DeadDelay(25);
		P0=0x00;
		DeadDelay(25);

	}
}

SDCC commands:
--------------
C:\>sdcc -I"c:\Program Files\SDCC\include\mcs51" test.c

C:\>packihx test.ihx > test.hex
packihx: read 25 lines, wrote 17: OK.

Flash Magic setting:
-------------------
Code:
com port: com1
baud rate: 9600
device: 89v51rd2
interface: none(isp)
hex file: C:test.hex
check "Verify..."
DO NOT check the box near to "Erase all Flash".
DO NOT check the box near to "Erase Flash used by Hexfile".
It may damage the bootloader!
I didn't check these two boxes and programmed my P89V51RD2 twice, hence confirming that my bootloader was in safe condition.

Now click on "Start".
When it asks to reset the device, press reset button on circuit board and get p89v51rd2 programmed!

Sincerely,
Srinivas Nayak
Home: http://www.mathmeth.com/sn/
 
Last edited:

Re: Steps to program P89V51RD2 microcontroller by ISP method using RS232

thanks a lot for posting this circuit!!!!! I had been using other circuits found in the net..i spent whole 2 days to make them work.but everytime they failed.once i connected this circuit i got it programmed very fast without any retries!!:) thanks!!
 

Re: Steps to program P89V51RD2 microcontroller by ISP method using RS232

You are most welcome.

Sincerely,
Srinivas Nayak
Home: http://www.mathmeth.com/sn/
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top