Shop OBEX P1 Docs P2 Docs Learn Events
Programming a Prop with a generic USB to Serial converter? — Parallax Forums

Programming a Prop with a generic USB to Serial converter?

Joel RosenzweigJoel Rosenzweig Posts: 52
edited 2009-04-28 01:49 in Propeller 1
I have a Prop based device that needs a firmware update. Unfortunately, the device is in France, and I'm not. The fellow in France does not have a Prop Plug, but he does have access to a generic USB to Serial converter that supports RX and TX, but not DTR. I'd like to know if there is a relatively simple way of connecting his generic converter to the Prop to program it.

The challenge I see is that the Prop Plug makes some use of the DTR signal, which this generic converter does not have. Furthermore, I don't know if the DTR signal is modulated during programming or not. I know that 2 minutes with an oscilloscope would answer that question about DTR modulation - I'm just unable to do that at the moment. If the signal is modulated, then it looks certain that this generic programmer won't be workable. If it's not modulated, then it would seem trivial to make it work.

Can it be done? If so, how?

If it's not possible to rig something up using this generic USB to Serial converter, I'll send him a Prop Plug or have him buy it locally. I just thought I'd try this route first before purchasing and shipping more hardware around the world.

Thanks guys.

Joel-

Comments

  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-04-27 01:11
    This isn't USB, but there is a simple RS-232 circuit that you can use to program the Prop. It involves a couple transistors and some resistors. Anyone care to chime in on it?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-04-27 01:26
    If the converter does not work you may try the manual method.
    * Press F8 to compile the source or load the eeprom file
    * Show hex
    * Load EEPROM or ALT-E and reset or power-up the Prop at the same time

    If it fails to find the Prop then just try again with maybe a slight variation between the load and reset. This method has worked for me on various systems and sometimes it is a little tricky but at least it does the job. Next time you ship a Prop product you might include a Prop Plug [noparse]:)[/noparse]

    *Peter*
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-27 05:51
    The DTS is only needed to reset the Propeller, which starts the bootloader. The rest is done with RX an TX pins only.

    Before I discovered that my USB to Serial converter also supports the DTS I programmed the Propeller by pressing the reset-button manually.
    I pushed the reset button and held it. A short while before the PropTools tries to load the program to RAM I released the button. Depending on how good your timing is, it might fail from time to time, but it was not to anoying. So, if it's only for rare occasions, it'll do quite well.

    Post Edited (MagIO2) : 4/27/2009 7:41:43 AM GMT
  • dwelvedwelve Posts: 21
    edited 2009-04-27 07:32
    If he can find a USB-to-SERIAL converter that supports DTR as well as TX and RX, he might be able to use this circuit here ("Serial to Propeller"):
    http://www.parallax.com/tabid/254/Default.aspx

    The generic USB-to-SERIAL cable probably outputs RS232 voltage levels, so he'd have to use this circuit regardless for TX and RX, too, or else he might destroy the Prop chip. Alternatively, he could get the more functional USB-to-RS232 cable (with DTR/TX/RX) and find a MAX232 or similar chip, breadboard it, and get a quick n' dirty USB-to-RS232-to-3.3V logic converter chip. If he only has the TX and RX line, I might suggest a similar circuit here, with a manual reset of the Prop (if the board was equipped with a reset button of some kind): http://www.uchobby.com/index.php/2007/06/11/ttl-to-rs232-adaptor-explained/

    If I recall correctly, when I've had to manually hit reset to program, I think I first hit the F7 key to "Identify Hardware..." ...
    ... I started out by hitting reset at the same time as hitting F7 to see if the prop was found, but a check of the o-scope revealed a slight delay from hitting F7 to seeing the reset line pulsing, so I increased my the delay from F7 to hitting the reset button until I find the correct timing... this timing was for me the same as for programming the chip (i.e.: hit F11 to load the eeprom and then hit the reset button).

    Oh, and as for the reset line being modulated, I believe all it does is just go from logic high to logic low (for RS232, a negative voltage to a positive voltage, but this is level-shifted and inverted, plus RESn is active low logic), back to a logic high, followed by a slight delay (50 ms or so), followed by the Prop bootloader routine ... I believe this is documented in the Propeller datasheet (http://www.parallax.com/tabid/442/Default.aspx, version 1.2 of the prop datasheet on pages 5 and 6). This is why timing manually is kinda tricky--you have to bring the prop to reset and make sure that the prop boots up and goes through it's 50 ms delay and then hope that the bootloader detects the PC (or vice versa) in time for programming.

    Post Edited (dwelve) : 4/27/2009 6:41:40 PM GMT
  • Joel RosenzweigJoel Rosenzweig Posts: 52
    edited 2009-04-27 14:58
    A quick update - it turns out that the cable he has does support DTR.· This is good.· But, I don't yet know if it's true RS-232 voltage levels, 5V, or 3.3v.· The cable was meant for programming another microcontroller based device that he has, so there's a good chance that it is not using true RS-232 levels.· I'm working with him to see what he can do to check the levels so I can figure out what to do next.· I'm not certain that he has easy access to any parts with which to breadboard a circuit one way or the other.· I'll know more soon.

    Thanks for everyone's input so far.

    Joel-
  • localrogerlocalroger Posts: 3,452
    edited 2009-04-28 01:49
    @Joel -- If I were you, I would just airmail him a PropPlug in a first class envelope. The labor you and your customer will expend trying to hack this thing will far overshadow the cost of the PropPlug and postage.
Sign In or Register to comment.