Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Problem with programming Philips P89V51RD2 as communication fails

Status
Not open for further replies.

pravin_kakar

Newbie level 3
Joined
Feb 4, 2007
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
I am programming a P89V51RD2 with a 12MHz crystal using a USB-RS232 adapter and Flash Magic.

However, I keep getting a message which says:-

UNABLE TO COMMUNICATE. TRY REDUCING THE BAUD RATE. RESET THE HARDWARE INTO ISP MODE.

I have tried every Baud rate available and still get this message.

What should I do to solve this problem?

I have tried unchecking the "Use DTR to control RST" box. That gives me the message "RESET THE DEVICE TO ISP MODE NOW". However, switching OFF and ON the power supply or pressing an external RESET button does not help at all.

Added after 12 minutes:

I have a second question too.

How can I specify the address at which my code should be loaded in the Keil C compiler?
 

narccizzo

Full Member level 3
Joined
Jan 20, 2006
Messages
174
Helped
16
Reputation
32
Reaction score
11
Trophy points
1,298
Location
PATZCUARO,MICHOACAN,MEXICO
Activity points
2,819
reset the device into isp mode now

Are you selecting the correct port?
Is the virtual com properly configured?
If don't, check this two things in the system properties.
Or maybe the usb adapter does not support the dtr to control the rst, that is very common in some adapters.
 

pravin_kakar

Newbie level 3
Joined
Feb 4, 2007
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
flash magic for 89v51rd2bn

Thanks for the advice! I have checked the port as well as the device I have connected and both are correctly chosen. I just tinkered around with the connections a bit and the circuit started working perfectly.

Now, if only someone could answer my Keil question.

Added after 12 minutes:

pravin_kakar said:
How can I specify the address at which my code should be loaded in the Keil C compiler?
 

pravin_kakar

Newbie level 3
Joined
Feb 4, 2007
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
phillips p89v51rd2

I am trying to perform the In-Application Programming of this microcontroller. I have written this section of code for the program but it doesn't seem to be working at all.

call_iap_write:
PUSH IEN0 ; disable interrupts
CLR EA
MOV B,CMOD
MOV R2,B ; store copy of CMOD
JNB B.6,?IAPTAG11 ; if watchdog enabled then disable
ANL CMOD,#0BFH
?IAPTAG11:
MOV ACC, 55H
MOV DPH, 23H
MOV DPL, 70H
MOV R1, #02H
ANL FCF, #0FEH ; enable bootrom
CALL 01FF0H ; call iap routine
MOV R7, ACC
ORL FCF,#01H ; disable bootrom
MOV CMOD,R2 ; restore CMOD (restore watchdog state)
POP IEN0 ; restore interrupts to initial state
RET

I have ensured that this code is well beyond 1FFFH i.e. the part of memory that the bootloader will occupy.

Can anyone please help?
 

pravin_dwaramwar

Advanced Member level 4
Joined
Dec 6, 2006
Messages
103
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
Nagpur - India
Activity points
1,913
keil c programs on p89v51rd2

the programming technique of 89V51RD2BN is somewhat different. Follow the steps given below to program your IC:
1. Click on "START" button.
2. Then u get the message "Reset the hardware in ISP mode now"
3. put PSEN(bar) to low(ground).
4. reset the MuC.
5. and again put the PSEN(bar) pin to logic high(Vcc)
6. the dialouge box will automatically vanish and the IC gets programed.
 

wek

Full Member level 4
Joined
Dec 21, 2004
Messages
239
Helped
28
Reputation
56
Reaction score
2
Trophy points
1,298
Activity points
1,991
philips 89v51rd2bn

Dear pravin_dwaramwar,

P89V51Rx2 don't require to use PSEN to enter the bootloader. Please read carefully the datasheet.

JW

Added after 1 hours 8 minutes:

Just for the record, the solution is in http://www.8052.com/forum/thread.phtml?thread=145532

JW
 

annapoorani

Junior Member level 3
Joined
Nov 20, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
chennai
Activity points
1,496
Re: philips 89v51rd2bn

first of all complie ur prgm after creating hex file..... then select the device in flash magic 89v51rd2....
then select erase then browse ur hex file..... then select verify after prgming.... then start.... i think u did small mistake.........
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
Re: Philips P89V51RD2

Which hardware you are using for IAP. you need dedicated hardware.

Next loading the hex code in any memory location you have option in flash magic too
 

annapoorani

Junior Member level 3
Joined
Nov 20, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
chennai
Activity points
1,496
Re: Philips P89V51RD2

i am using 8051 development board..:)
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
Re: Philips P89V51RD2

org 02100h

PUSH IE ;DISABLE INTERRUPTS
CLR EA
MOV A, 0B1h
ANL A,#0FCh ;enable boot sector - !!! this command MUST be located ABOVE 2000h!!!
MOV 0B1h, A
MOV A,#1h
CALL 01FF0H ;call to ISP_API (modifies B register but no Rx)

MOV DPH,#00h
MOV DPL,#00h


MOV R1,#02H ; function code
MOV A, 0B1h
ORL A,#001h ;switch back to user FLASH
MOV 0B1h, A
POP IE
END


this is the code for IAP

for more information refer this http://www.efton.sk/t0t1/p89v51rd2 iap.pdf

---------- Post added at 15:29 ---------- Previous post was at 15:26 ----------

the programming technique of 89V51RD2BN is somewhat different. :
1. Click on "START" button.
2. Then u get the message "Reset the hardware in ISP mode now"
3. put PSEN(bar) to low(ground).
4. reset the MuC.
5. and again put the PSEN(bar) pin to logic high(Vcc)
6. the dialouge box will automatically vanish and the IC gets programed.

first of all complie ur prgm after creating hex file..... then select the device in flash magic 89v51rd2....
then select erase then browse ur hex file..... then select verify after prgming.... then start.... i think u did small mistake.........

He is talking of IAP, not ISP
 

annapoorani

Junior Member level 3
Joined
Nov 20, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
chennai
Activity points
1,496
Re: 89v51rd2bn datasheet

first of all complie ur prgm after creating hex file..... then select the device in flash magic 89v51rd2....
then select erase then browse ur hex file..... then select verify after prgming.... then start.... i think u did small mistake......... then go to timeouts and select time and go to misc and select wave file.... definitely it will works....



then i cant understand "how can i specify the address at which my..............." why u have to specify the address?
 

nitinc091

Newbie level 1
Joined
Jan 5, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,285
Re: 89v51rd2bn datasheet

sir,
to program p89v51rd2 using flash magic it requires the dtr signal which level shifted through max 232 and used in sink mode active to the reset pin.
also enable the option in flash magic that assert the dtr signal the time ratio that i have used is 50 & 100 ms.
 

krischai81

Newbie level 3
Joined
Mar 15, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
Re: flash magic for 89v51rd2bn

Thanks for the advice! I have checked the port as well as the device I have connected and both are correctly chosen. I just tinkered around with the connections a bit and the circuit started working perfectly.

Now, if only someone could answer my Keil question.

Added after 12 minutes:

HI Pravin,

I am facing the same problem(Reset in ISP mode). could you plz tell me what correction you did. I am breaking my head to correct this problem. It will be of great help..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top