Using FlashMagic without DTR and RTS control

Started by Marc, November 20, 2003, 12:29:17 AM

Previous topic - Next topic

Marc

Hi,

I am trying to program a P89C51RD2Hxx device via an isolated RS232 port.  The port uses the DTR and RTS lines to supply power for isolation purposes, and hence they can not be used to control the /PSEN and RST lines. I effectively have to manually put the device into ISP mode.

Does FlashMagic or WinISP cater for this scenario? Info on WinISP is sketchy, and the FlashMagic manual does not mention this case specifically.

Any help appreciated!


Andy Ayre

You can modify your firmware to accept a command via the UART to place it into ISP mode. You can then send that command using the StartBootROM feature in Flash Magic. If that is not what you are looking for then please give me more details.

Embedded Systems Academy, Inc.
support at esacademy dot com

Marc

Hi Andrew,

Thanks for the quick answer - it does give me an idea. However, I would like a bit more clarification, so bear with me while I endeavour to enlighten you further. Note that at this stage I do not have a platform to test this on - the project is at the schematic phase. I'm just making sure that I cater for every possibility before committing to layout.

I have looked through the Flash Magic options, and notice that the only option I have for DTR and RTS is to assert them (besides using them for reset control, etc.). Ideally I need DTR low and RTS high, continuously - I don't want Flash Magic to interfere with those signals, else I lose power to my optoisolators and the serial port dies.

Sooo, let me sketch ideal scenario (correct me if I'm wrong somewhere):

Flash Magic running, DTR low, RTS high, I pull /PSEN low through an onboard link, reset the processor which then enters ISP mode. Flash Magic then used to download code. Processor reset with /PSEN high, code runs, much joy as programmer rides off into sunset with favourite girl on arm.

Questions:

1. If  I can somehow get DTR and RTS to the correct state, does Flash Magic lose any of it's functionality due to it not having direct control of /PSEN and RST?

2. Does the firmware need to be changed in this scenario? Sure,  I can write code to look for a certain character sequence to put the processor in ISP mode when in the field (with some clever hardware manipulation), but in this case I'm talking about initial download of code to a virginal processor.

3. Any input on how WinISP does it?

Regards,

Marc.

Andy Ayre

Answers:

1. Yes. The Hardware Config options in the Advanced Options and the functionality they control will no longer work. Not a problem if you are going to manually place the device into ISP mode or use a start BootROM command, etc.

2. From the factory all devices have their status bit/byte set to 1, therefore they power up into ISP mode regardless of /PSEN. Note that if you want to put the device into ISP mode on command you don't need any additional hardware - you simply use IAP to program the status bit/byte to 1 and then get the watchdog reset the device. We have a library that helps with this by making the IAP routines look like C function calls.

3. As far as I know, WinISP does not do anything with DTR and RTS.

Note that in the past I have come across someone using optocouplers and they distorted the baud rate, causing problem with the autobauding of the bootloader and the subsequent PC communications.

Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

You mention that you don't want Flash Magic to interfere with DTR and RTS. Note that when the COM Port is opened and closed, those signals may change or have glitches/pulses on them. That is under Windows control. As Flash Magic opens and closes the COM Port a lot, that aspect is beyond my control.

Embedded Systems Academy, Inc.
support at esacademy dot com