Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 30 Jun 2015, 15:46
All times are UTC - 4
 Forum index » Advanced Topics » Hardware
Program P89V51RD2 microcontroller by ISP method using RS232
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count_1  
Author Message

Joined: 14 Sep 2011
Posts: 233

PostPosted: Thu 12 Jul 2012, 06:59    Post_subject:  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 http://www.ece.ubc.ca/~jesusc/P89V51RD2_System.pdf
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:

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 */


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:

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!

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

Home: http://www.mathmeth.com/sn/
Blog: http://srinivas-nayak.blogspot.com/
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Hardware
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0415s ][ Queries: 11 (0.0033s) ][ GZIP on ]