P89V51RD2 Problem

Started by jcabral, January 15, 2008, 02:33:21 PM

Previous topic - Next topic

jcabral

We have developed a board to program (via ISP - FM) the P89C51RD2.

The board has a USB interface through a FTDI chip and a "normal" RS-232 interface and is used in students labs.
After some time we "run out" of P89C51RD2.
I read a post in Keil forum, http://www.keil.com/forum/docs/thread10439.asp by erik malund, about the replacement part, since I cannot manage myself in the NXP site. In that post the 89V51RD2 was mentioned. Placed an order ... waited a long while ... and tested the parts to no success at all.

Found information in this forum about the new bootloader and I do suspect that the FTDI chip is generating some garbage at power on that simple makes the 89V51 to go crazy.
Also this afternoon tried to program the parts with the v7 bootloader using a parallel programmer, unfortunately I wasn't able to program more than a few bytes (around 300) in block 1. Could be adapter related or programmer problem, will have to check it again.

My questions are, if I manage to program the v7 bootloader will I be able to configure it using the "true RS-232" port using FM in order to be able to enter ISP through pulling a pin high during reset?
Should I forget about these parts and buy the 89cv51rd2 instead?
Is there anyway of parallel programming the part in order to change the bootloader to enter ISP directly if pin P2.x is pulled (low or high) during a reset?

Thanks in advance



erikm

I do suspect that the FTDI chip is generating some garbage at power on that simple makes the 89V51 to go crazy.

You do not state which ftdi chip you use, but the Vinculum babbles its little head off after you reseet it.

Erik
erik

jcabral

It is the FT232R. After trying and "erasing" a few bootloaders, I decided to read a little in the forums ... too late to change the orders, unfortunately.

I even tried to press and hold the reset button during the power-up of the board. Used FM (it does send trails of 'U''s) and release reset after, the part sends something back, but the only speed where I got something meaningfully (3 bytes that look alike the  Device ID) was at 115200 bps. Them it simple "crashes" ... bootloader is erased or whatever.

I will try to parallel program the device again tomorrow.

But the question still remains, is it possible to replace the bootloader by one where the ISP mode is set by pulling a P2.x pin during reset?

Regards

Je Gold

P89C51RD2 are if not already going obsolete.

P89V51RD2 has significant difference in the programming of P89V to the P89C.

P89V looks at the UART Rx data line after reset (if 'U' char then invoke bootloader).... where as P89C uses /PSEN and RESET

Yes - It is possible using a profesional programmer to reload the bootloader in to block1 of a P89V51 (block0 is user code).

If your first bit of code is an NoTouch algorithm  then yes it is possible to invoke the boot loader by looking at GPIO activity.... BUT.... why would you if you can invoke the bootloader after reset by sending 'U' char's to the UART Rx.

Joe

Andy Ayre

Yes, the latest bootloader allows you to configure a pin for ISP entry. However I believe you have to specify that configuration via ISP.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

jcabral

#5
P89C51RD2 are if not already going obsolete.
P89V51RD2 has significant difference in the programming of P89V to the P89C.
P89V looks at the UART Rx data line after reset (if 'U' char then invoke bootloader).... where as P89C uses /PSEN and RESET


The development board was "built" for P89C51 and uses the FTD232R chip. It has the advantage of allowing students to use their personal laptops.
Unfortunately, the FTD232R generates a bit of garbage at power-up and I'm using the clock output as the xtal2 for the microcontroller, so in order to make the 89V51 work with the board I'll need to reprogram the bootloader.


Yes - It is possible using a profesional programmer to reload the bootloader in to block1 of a P89V51 (block0 is user code).
Finally managed, needed a Capacitor between Vcc and Vss, in order to my programmer to work.


If your first bit of code is an NoTouch algorithm  then yes it is possible to invoke the boot loader by looking at GPIO activity.... BUT.... why would you if you can invoke the bootloader after reset by sending 'U' char's to the UART Rx.

Due to the limitations of the board we use (FTD232R chip generates garbage and bootloader "gets confused").

Edited ... Thanks for the answer Joe

jcabral

#6
Quote from: Andy Ayre on January 16, 2008, 08:14:47 AM
Yes, the latest bootloader allows you to configure a pin for ISP entry. However I believe you have to specify that configuration via ISP.

Andy

...
Ok, those are good news.
I downloaded the v7 from falshmagic forum.
Can one of you supply me a .hex or .bin file to parallel program the 89v51 with the configuration already set (any P2 pin high or low)? Know that I'm being lazy but it will save me the work of building a prototype that uses a true RS-232 port.

Thank you for the reply

Andy Ayre

Sorry, the bootloader comes from NXP, not us, so we don't directly support configuring it.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

jcabral

Quote from: Andy Ayre on January 16, 2008, 01:09:49 PM
Sorry, the bootloader comes from NXP, not us, so we don't directly support configuring it.

Andy

No problem, I will parallel program the parts with the bootloader from NXP site, there is a version there to upgrade to v5 by parallel programmer. I will make a prototype board this week in order to upgrade by ISP to v7 and them program by FM the ISP entry by GPIO. Hopefully I will them be able to "copy" the bootloader to the rest of the chips.


Je Gold

Cheers thanks for the good news feedback.  Please to see you go it working..

Since there is some Vdd, Vss  or data "garbage" on the FTDI232  are you able to clean it up with decoupling and filter caps.

It should be well noted in the forums that USB to Serial converts give trouble.....  have you considered stretching the times of the Reset and 'U' character from the config in Flashmagic?

Search the forum fir "USB" you are bound to pickup some comments.


Me..... I made sure I got a laptop with RS232 ;-)

Regards
Joe

erikm

just a suggestion

while I am not familiar with your ftdi chip, how about a switch or jumper that hold the ftdi in reset.  If the chip require CTS like the vinc, then configure the board so that signal is false during reset/bootload

Erik
erik

jcabral

Quote from: erikm on January 17, 2008, 06:13:52 AM
just a suggestion

while I am not familiar with your ftdi chip, how about a switch or jumper that hold the ftdi in reset.  If the chip require CTS like the vinc, then configure the board so that signal is false during reset/bootload

Erik

One of the problems is the FTDI chip. In our board we did not use the reset neither the CTS RTS lines in order to automatically enter the ISP mode. We used a jumper in the PSEN with the reset ... it worked fine :(
The FTDI chip only generates the oscillator after detecting communications with a PC ...
The other problem is the power, using the USB to power the board doesn't seems to work properly with 89V51 (in my case!!!).

Finally, I have to say that the new part is disappointing. It is surreal that the microcontroller enters in ISP mode and even worst it cleans up the internal flash memory contents (part of the original boot code is placed there) before making sure that a proper communication is achieved with the PC.

I finalize by giving my thanks to you all for your suggestions and congratulate Andy for a very nice tool. One of the reasons I choose the P89C51RD2 was  due to the simplicity and efficiency of FlashMagic.


Andy Ayre

You might want to look at the 89CV51Rx2 devices. I believe they don't execute the bootloader on every reset. Thanks for the kind words.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Jan Waclawek

Hello jcabral,

although it's hard to judge without seeing your design first, I think the problem is that the P89V51RD2 gets resetted spuriously due to insufficient VCC.

You are trying to power a 5V part from the USB power. Although the nominal voltage at USB is 5V, the tolerance of it is high, and even that is often violated - on a typical USB endpoint it is not rare to have less than 4.5V. Nevertheless, you are NOT supposed to use the 5V of USB to power 5V parts; you are supposed to power only 3V parts in a typical host-powered USB device through a suitable voltage regulator.

The 'V' part - contrary to the 'C' - has an built-in brown-out detector, and even though the datasheet is unclear about its exact whereabouts, it should cause a reset under an undervoltage condition. This in fact is not a drawback of the 'V', rather an advantage - the 'C' under insufficient VCC might have run crazy.

I also suspect the 'CV' would have the undervoltage protection, so that is not really an option. You should either provide valid 5V to the 5V parts, or use the 3V version of the part.

I might be wrong, of course.

Jan Waclawek

jcabral

Hi Jan,

The board has a DC power in as well. With the P89C it worked with the USB power only ...
What I found very strange is that the bootloader "destroys" itself.

I have been looking for other manufacturers and I found that some have new bootloaders similar to this one, but they still keep the hardware ISP entry mode.


Regards,
jcabral