Author Topic: P89C51RD2 ISP problems  (Read 31488 times)

Tony G

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
P89C51RD2 ISP problems
« on: May 06, 2004, 08:20:21 pm »
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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2108
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2 ISP problems
« Reply #1 on: May 07, 2004, 09:55:27 am »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #2 on: May 07, 2004, 06:55:06 pm »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #3 on: May 10, 2004, 06:36:53 am »
the .H devices do not have the CKCON SFR.  Use the coorrect datasheet.

Erik

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2108
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2 ISP problems
« Reply #4 on: May 10, 2004, 07:56:21 am »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #5 on: May 10, 2004, 06:22:34 pm »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #6 on: May 11, 2004, 05:07:33 am »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #7 on: May 25, 2004, 04:13:59 am »
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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2108
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2 ISP problems
« Reply #8 on: May 25, 2004, 08:33:31 am »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #9 on: May 25, 2004, 01:34:52 pm »
fourthly, if you had implemented NoTouch, you would not have had any of these problems.

Erik

selvam

  • Guest
Re: P89C51RD2 ISP problems
« Reply #10 on: May 26, 2004, 06:22:51 am »
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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2108
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2 ISP problems
« Reply #11 on: May 26, 2004, 08:27:07 am »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #12 on: May 28, 2004, 02:15:23 am »
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

  • Guest
Re: P89C51RD2 ISP problems
« Reply #13 on: May 28, 2004, 05:22:42 am »
>>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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2108
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2 ISP problems
« Reply #14 on: June 01, 2004, 09:50:23 am »
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