Shop OBEX P1 Docs P2 Docs Learn Events
RS-232 Programming/Comms with PC — Parallax Forums

RS-232 Programming/Comms with PC

sethen320sethen320 Posts: 7
edited 2012-05-23 02:31 in Propeller 1
I have done everything possible. I've built the circuit using all of the revisions of the schematic. I've used third-party schems. Is there a step I'm missing? When I use Prop Tool to try to download to the chip (no EEPROM, I've eliminated that for troubleshooting), I cannot communicate with it. I have a demo board and that works fine, so I know it's not the PC. I'm using P31 & P30. Something in the data sheet made me suspect that I need to power-cycle the chip just prior to attempting the download. I've tried it to no avail. Should I give up and declare this chip DOA?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-20 22:00
    It's hard to give you advice with the limited amount of information provided. The schematics work. The Prop Tool works. You don't need to power cycle the chip before downloading. The Prop Tool toggles DTR which should cause a reset if you've built the interface circuitry as shown in the schematics. You don't even need a crystal for downloading. Check your wiring carefully. Make sure the Propeller has power. If you're using a USB to serial adapter, make sure you have the proper USB driver installed.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-05-20 22:26
    A common mistake is to have P30 and P31 swapped... make sure that these are correct.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-05-20 23:01
    USB to serial adaptor, or a real serial port? If a USB to serial adaptor, which brand (some work, some do not). Propplug? FT232 or max232 or max3232? Transistor reset circuit or a spare gate on the max3232? Which schematics? A spare prop chip available? Regulator and associated components?

    Many things to tweak and get right and together the collective wisdom of this forum should be able to sort it out.

    Any chance of a quick photo of your setup? If you can, when you do a reply, click "Go Advanced" just underneath where you type and then you can upload photos.
  • sethen320sethen320 Posts: 7
    edited 2012-05-21 20:28
    Ah, thanks for the suggestions. I am using a USB to serial adapter, which was against my better judgement (I have NEVER completely trusted them for timing-critical jobs). I can do some tests using a laptop with a native 232 port tomorrow. If that doesn't yield any info then I will definitely provide photos. I'm a bit embarrassed as it's all patched together on a breadboard at the moment.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-05-21 21:11
    I suspect it would be the USB to serial adapter. I bought a whole lot of cheap $2 ones a few years back and they worked fine at the time, but what has happened is that there was an 'upgrade' to the proptool and it stopped working with these cheapie adapters. I am fairly certain it is the timing of the DTR pulse as these adapters work fine for subsequent comms between the propeller and a serial terminal program. I have tried resetting on the leading edge and the trailing edge of the pulse but it makes no difference. I suspect it is the delay between the pulse and the download.

    It probably is just one line of code to change in the proptool but I don't have access to the source.

    I've looked at the ft232 chip but it is only available in surface mount and I like to work with DIP parts.

    The solution I found was to type "USB Serial FT232" into ebay which brings up a few cables eg http://www.ebay.com.au/itm/Black-FTDI-FT232-RS-232-RS232-Serial-USB-Adapter-Cable-w-Magnetic-Ring-/170833794906?pt=UK_Computing_Parallel_Serial_PS_2&hash=item27c67cd75a They are $16 instead of $2 which is a mildly irritating way of fixing one line of code in a program, but it is a solution which works.

    Or you can buy the propplug which has a ft232 chip on it.

    Or a ft232 breakout board http://www.ebay.com.au/itm/FT232RL-USB2-0-Serial-Module-USB-TTL-level-Converter-Adapter-Arduino-/251056721141?pt=AU_B_I_Electrical_Test_Equipment&hash=item3a74258cf5

    But it would be interesting to see how you go with a real RS232 port.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-05-21 23:39
    Even whilst using a real, motherboard, '232 port I usually get "no Prop found" for the first attempt, after that it sees it ok.

    I have made boards and got the ins-and-outs of the Prop the wrong way around, but thats obligatory with '232, isn't it ??

    As far as I can remember, it's out on P30 and in on P31, so that agrees with my early memories of Z80 PIOs that chose to use 0 to indicate outputs and 1 for inputs (Now everything uses them the other way around ...)
  • LeonLeon Posts: 7,620
    edited 2012-05-22 01:05
    I bought a USB-RS-232 adapter many years ago, with an FTDI chip in it, and that has been very reliable. I make sure that I use the latest driver.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-05-22 22:55
    Just to be certain, what schematic are you using when you say "I've built the circuit using all of the revisions of the schematic"?

    I have assumed you were using this one...

    http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/SerialtoPropeller.pdf

    .. but now I'm not so sure.

    Note: You also need to supply 3.3V power to the Propeller
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-05-23 00:55
    That three transistor interface is the one that I usually use. Whilst this thread does say that it is used for comms with a PC just remember that it relies on the - Ve from PC port, so two of these circuits wouldn't like talking to each other (just like being at home then) where as the MAXxxxx chips make their own. I now wonder if all the USB - serial units make adiquate minus volts.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-05-23 02:31
    so two of these circuits wouldn't like talking to each other (just like being at home then) where as the MAXxxxx chips make their own. I now wonder if all the USB - serial units make adiquate minus volts.

    Second question - I think they do and it is some sort of negative voltage on the ones I have but YMMV. Anything under -3V counts according to the standard. I think it is often -9V.

    The true RS232 standard is anything less than -3V or anything more than 3V. The "PC" standard allows 0V to count as a negative voltage. So a common standard that would work for all connections would be maybe anything more than 1V or less than 1V.

    Would 2 of those transistor circuits talk?

    I suspect they might. The Tx output transistor will output 3V or it will be off which is floating. For the rx, a floating voltage will be pulled down to 0V with the 10k pulldown.

    I haven't tested it thoroughly, but if you take a max232 chip and connect nothing to the chip except the power and capacitors, the output will be +5V. That infers an input of a negative voltage as the max232 inverts (as do the transistor circuits). Which says that if the input is floating, it defaults to a negative voltage. The propeller transistor circuit also rests with a floating voltage. So while the propeller transistor circuit breaks quite a few RS232 rules, I very much suspect it will work as an inter-prop comms system, plus should be compatible with a max3232 and max232 and a real RS232 port.

    The only thing that may not work is the way the DTR is wired up connected to Rx. That might end up resetting the prop.

    For years I resisted the max232 and max3232 chips but I now use them for all my ports. It isn't really that they conform to the standard but more that you can do all sorts of horrible things to them and nothing bad happens. Short the pins. Connect two Tx pins together. Stick 25VAC down a pin. Muddle up all the pins on a plug in a random order. You can't do that to a propeller chip!

    I'm going to be very interested to see how our OP goes with a real RS232 port.
Sign In or Register to comment.