P89C51RD2 ISP problems

Started by Tony G, May 06, 2004, 08:20:21 PM

Previous topic - Next topic

Tony G

Help please:
I have tried program the P89C51RD2 using an application note which suggested the use of DTR and CTS of the RS232C port. This did not work and I have followed procedures for power up of Vpp and PSEN.
I have been able to program the part using just the RX and TX. However the part insists on setting the FX2 bit and forces the micro to work in the 6 clock mode. Among other possible effects is that the baud rate generator now works at 2 times the rate. Using just TX and RX I have not been able to get FlasMagic to program for 12 clock mode.
I have tried to alter the CKCON register with the user code but am unable to read of alter this register. CKCON always returns FFh.
The user code works because I have used the same code on an ATMEL 89C51RD2 and I am able to read this register and alter it.

Any suggestions?

Thanks

Andy Ayre

Which device are you using? Is it the P89C51RD2Hxx or the P89C51RD2xx? Are you selecting the correct device in Flash Magic?

Embedded Systems Academy, Inc.
support at esacademy dot com

Tony Gelonese

Hi Andrew,
Thanks for your reply. The part I am using is P89C51RD2HBP and I have selected the correct on in FlashMagic. FlashMagic seems to have trouble communicating when the signal from RTS DTR are used. If I manually set the part into ISP mode the commas work ok and I can program the part. I do not see any way of controlling the FX2 flag. Hence my code is not able to read or change the CKCON register. My code does work but the serial port which I set up for 19,200 Baud now works at 38kB.

Your help is greatly appreciated.

Cheers,

Tony G.

erikm

the .H devices do not have the CKCON SFR.  Use the coorrect datasheet.

Erik

Andy Ayre

Tony,

Erik is correct. The Hxx devices can only be placed into 12 clocks/cycle mode using a parallel programmer. The devices cannot be returned to 6 clocks/cycle.

The Rx2xx devices come from the factory in 6 clocks/cycle mode and can be programmed via ISP or in your code using CKCON to 6 clocks/cycle.

Embedded Systems Academy, Inc.
support at esacademy dot com

Tony Gelonese

Thanks Erik and Andrew for pointing out and confirming  that the H part does not have a CKCON register.  I have now located the data for the P89C51RD2HBP which I have. Unfortunately FlashMagic does not 'know' that it can't program the 6/12 cycle option.
Does anyone know if this part is now obsolete?

Thanks.

Ian Prossor

H part needs a parallel programmer to set the clock back to 12 clock cycles per instruction ... The newer part's without the H can be set by s/w.

IP

selvam

Help please:
I have tried program the P89C51RD2BN using an application note which suggested the use of DTR of the RS232C port.

This did not work and I have followed procedures for power up of Vpp and PSEN.

I am not able to program the P89C51RD2BN.

Flashmagic showing that  "unable to communicate.(transmit/receive) ensure no other aplications are using the comportconfigure.try raising or lowering the baudrate)

wha may be the problem?

Any suggestions?

Thanks


Andy Ayre

First of all, have you applied the reset workaround in the errata sheet for the device? That is the most common cause of problems.

Second, have you analysed the signals from DTR and RTS to make sure they match the waveforms in the Flash Magic application note that describes ISP entry using the handshaking signals?

Thirdly, have you tried disconnecting DTR and RTS and placing the device into ISP manually by pulling /PSEN during reset?

Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

fourthly, if you had implemented NoTouch, you would not have had any of these problems.

Erik

selvam

Hi Andrew,

Already i used to program the p89c51rd2bn by superpro2000 programmer
at that time i erased the flash full. after a long time, now only i am trying for isp, now i am facing these problems.

Is it the problem is becos of erase all flash?

I iinstalled everything in the erratta

But still i am facing the problem
Pls help me

Thank and Rgds
selvam

Andy Ayre

I have no idea if that programmer erased the boot vector of the device. If it did then you wouldn't be able to program it via ISP. I would put it back into the programmer and check the boot vector value.

Don't forget to answer my other questions. :)

Embedded Systems Academy, Inc.
support at esacademy dot com

selvam

Hi Andrew,

Now i purchased new p89c51rd2bn controller for that also showing the communication problem.

i checked the psen pin that is going high after some duration
and reset is going low after some duration.
i implimented the rc circuit for vpp also.
what else i need to do
and what else i need to check.


Pls help me

Thank and Rgds
selvam

erikm

>>Now i purchased new p89c51rd2bn controller for that also showing the communication problem.<<
If you have a problem THE FIRST TIME you try to program a chip, the problem us in your serial link.  Is the MAX232 (equivalent) operative, are the connections good etc.

You are not one of those that believe that a MAX232 (equivalent) is not necessary are you?

Erik

Andy Ayre

Erik is right. Devices come from the factory with the status byte set, so on power up they are in ISP mode. If you cannot communicate with the device then there is something stopping the data getting from your PC to the device.

Power up your device
Connect to it using Hyperterminal with: 8 bits, no parity, 1 stop bit, no flow control, 9600 baud.
Send a single 'U'.

Is the 'U' echoed back? If not then you need to put a scope on the TxD and RxD pins to see if the 'U' is getting to the device at all and if it is, whether it is also coming out of the device at all.

Embedded Systems Academy, Inc.
support at esacademy dot com