Shop OBEX P1 Docs P2 Docs Learn Events
problem with serial to propeller — Parallax Forums

problem with serial to propeller

dr hydradr hydra Posts: 212
edited 2007-03-19 14:10 in Propeller 1
I cannot get the propeller to program·with the "serial to propeller" diagram listed on the web page (3 transistors to serial port).· I have checked over the schematic five times and it still does not work.· I have an USB2SER that I can use for programming that works great, but when I try the "serial to propeller" the IDE does not identify the propeller when I hit F7.· What am I missing?· Does the computer serial port have to be configured a certain way (bits per second, COM port, ect.....)·anything?· When I hit F7·with the propeller running, using a tv driver, the tv goes blank for a second, like it is resetting, then the IDE say a error·about not identfing the propeller.

··

Comments

  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-16 18:33
    I have had no issues using this method but I prefer the 232 driver method as with the propstick

    www.parallax.com/dl/docs/prod/prop/PropStick-v1.2.pdf

    - are you using a real com port or a usb to serial adapter on the pc ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-16 18:46
    The download process does reset the Propeller. That's how the built-in boot loader is activated.

    The "serial to propeller" circuitry is dependent on the specifics of your serial port and, although it works with most serial ports, it may not work on some. In particular, it requires that DTR be active and that DTR is pulsed at the beginning of the download sequence. Some USB to serial adapters don't provide this or the timing is delayed. Some very simple PC serial ports might not implement this properly. The USB2SER and PropClip/Plug and the FTDI driver for them is known to work properly.

    I've been able to use the "serial to propeller" circuitry with a Keyspan USB-serial adapter with no problems. The PropStick circuit is more forgiving of sloppy serial ports
  • dr hydradr hydra Posts: 212
    edited 2007-03-16 18:59
    Thanks for the replies...I am not using anying USB to serial adapters. I am using the 9 pin serial plug. Do you think the FTDI drivers from the USB2SER are casuing problems with serial ports?
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-16 19:04
    Specifically the attached image is the transistor method I have used...similar to the parallax example but·uses different transistors.

    I do not think the FTDI drivers are causing your problems as I have had both attached to the PC and just switch on the one I want to program...

    Quattro

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Post Edited (QuattroRS4) : 3/17/2007 11:18:54 AM GMT
    1308 x 900 - 142K
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-16 19:40
    Your schematic appears fine. Notice that DTR should measure 0V or a negative voltage when the serial port is active. The fact that the Propeller appears to reset suggests that the DTR signal is changing at about the right time. It may have enough voltage change to force a reset, but may not go to zero or below zero. The serial interface needs that DTR voltage in order to reliably transmit back to the PC.

    It may be that you'll have to use the MAX3232 type chip. Your computer just may have a "wimpy" serial port that isn't strictly RS232 (in terms of signalling voltages uses).

    By the way, if you don't use any USB to serial adapters or USB to RS232 adapters, you don't need the FTDI drivers.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-16 19:45
    Mike - I just posted another 3 transistor sample for dr hydra .... you must have thought that was him/her ?


    Quattro ..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • T ChapT Chap Posts: 4,223
    edited 2007-03-16 19:48
    Do you have a scope? Check for signals on both pins Tx and Rx(Prop pins) and note the results when hitting F10
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-03-16 19:59
    dr hydra,

    I think Mike has nailed all of the known issues and requirements centered on the DTR pin that I would have mentioned. This circuit was originally chosen, because it has already survived the test of time in one form or another. If you study it closely compared to the front end of the BS2 modules, you will see that it is nearly identical. I originally put it together for use on the Propeller after a trip out to California and realizing I misplaced/lost my USB2SER plug·after·returning home. At that time it was suggested that we make it available to our customers as an alternative method to program the Propeller. As Mike has pointed out, not all Serial ports are created equal, and while the 3-transistor circuit may work on most machines, there will still be·some machines that are not compatible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 3/16/2007 8:06:13 PM GMT
  • dr hydradr hydra Posts: 212
    edited 2007-03-16 20:25
    I have tried the circuit on two different machines...still no luck. In the device manager are there any settings that need to be changed?
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-16 20:29
    No changes..

    The fact that its two machines now point to the circuit - Or the serial cable you are using - tx/rx incorrect by any chance - what cable are you running to the p.c ?

    Is pin 5 of the serial port (DB9) [noparse][[/noparse]or PIN7 if its a DB25] ·also tied to gnd of the circuit ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • dr hydradr hydra Posts: 212
    edited 2007-03-16 20:35
    It could be the circuit...when you are facing the serial port on the computer port 1 is on the top left...right?
  • dr hydradr hydra Posts: 212
    edited 2007-03-16 20:38
    I mean pin 1 is on the top left
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-16 20:49
    Have a look here


    www.lammertbies.nl/comm/cable/RS-232.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • dr hydradr hydra Posts: 212
    edited 2007-03-16 21:27
    I have the pins correct...It still does work
  • T ChapT Chap Posts: 4,223
    edited 2007-03-16 21:45
    Do you have a scope?
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-03-16 21:47
    dr hydra, when you are saying that you are checking, are you just doing visual inspection or are you doing electrical inspection as well to ensure things are actually connected properly?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-17 00:19
    Mike Green said...
    Your schematic appears fine. Notice that DTR should measure 0V or a negative voltage when the serial port is active. The fact that the Propeller appears to reset suggests that the DTR signal is changing at about the right time. It may have enough voltage change to force a reset, but may not go to zero or below zero. The serial interface needs that DTR voltage in order to reliably transmit back to the PC.

    It may be that you'll have to use the MAX3232 type chip. Your computer just may have a "wimpy" serial port that isn't strictly RS232 (in terms of signalling voltages uses).

    By the way, if you don't use any USB to serial adapters or USB to RS232 adapters, you don't need the FTDI drivers.

    Mike, is the schematic drawn correctly for the 10K resistor from DB9.2 to DB9.4? The RS232 DTR is at a positive voltage when the port is connected and it is when the port goes from disconnect to connect status that the reset transistor T3 is turned on momentarily (in this circuit). Notice that the exact same reset circuit is used with USB or MAX232 chips but there the DTR signal is inverted going from 3.3V (disconnect) to 0V(connected).

    But from this circuit this means DB9.2 can never go negative and so the PC will never see any data (actually it sees a break). Shouldn't this 10K go from DB9.2 to ground at least? Of course a negative voltage would be better but a swing of 3.3V to ground will work. There is also the issue with the DTR reset signal but you may find that it works anyway as the reset is momentary and generated on a DTR transition and the disconnect to connect cycle is very short.

    *Peter*
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-03-17 05:03
    Peter,

    Since the logic signals for RS232 are opposite than what you would normally think, a signal that is 'set' or '1' would show up as a negative voltage.· A signal that is 'clear' or '0' would show up as a positive voltage.
    (Right now, with DTR 'set', I'm measuring -11V with respect to ground.)

    The DTR signal is active High, meaning that when it is 'set' it is ready for operation.· When it is 'clear' this indicates that the serial port is busy and not ready for Data.· So normally in the clear mode (DTR = +V),· RX or TX communication is supposed to be suspended but many programs don't abide by this Data throttling method.

    When the DTR line rises to +V, the Propeller is held in reset for approximately 300uS due to the 10nF capacitor.· The output of T3 goes LOW (0V) during this period, and then back HIGH (3.3V) after about·300uS.· When the DTR line returns to -V or the 'set' condition, the output of T3 remains HIGH due to an internal pull-up resistor in the Propeller.

    While the DTR line is in the 'set' mode (-V), R1 acts as a pull-down resistor to the PC serial port RX line (pin2).· During Transmission from the Propeller, a LOW signal on the TX from the Propeller pin (p30) causes T2 to turn 'ON', thus forcing the RX line (pin2) on the PC serial port to go from -V to 3.3V.· A HIGH signal on the Propeller TX pin (p30) turns T2 'OFF'.· This action allows R1 to pull-down the voltage on the PC serial port RX line (pin2) to -V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 3/17/2007 6:41:43 AM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-17 08:18
    Hmmm, so that means when something is not plugged into a coms port it will receive a false DTR??? An RS-232 circuit only responds (in real life) to voltages higher than about 1.8V and the output to the logic side returns a low. When nothing is plugged into a coms port the RS-232 receiver(s) will be set to logic high, the normal idle state of logic level coms ports. So on the logic side they are active low but on the RS-232 side they are active high. The same goes for DTR which should be measured not by 'setting' but by opening the port on the PC with a terminal program. This you will certainly find to be at +V when it is connected and -V when the port is closed.

    The Propeller tool does not keep the coms port open when it is not programming so the DTR signal is sitting at -V (not connected) so don't use this as a guide.

    Also note the comment I had made about the DTR circuit being the same regardless of whether it is operated from the RS-232 line or via an RS-232 receiver inverter. Note however that this is inconsequential to the operation of the circuit anyway as it is edge triggered.

    *Peter*
  • ForrestForrest Posts: 1,341
    edited 2007-03-17 10:36
    Are you ready for this one - Not all 2N3904 NPN transistors are wired the same! Always check the pinout of the device in hand against your footprint.

    I got this from Spark's Fun's History Museum page where they show all their mistakes - www.sparkfun.com/commerce/present.php?p=Prototyping-1 - just search the page for 3904 and you'll find the relavant story.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-17 14:49
    Seems that the Propeller tool treats the DTR not as a DTR but as a reset line. Normally a terminal program will assert the DTR by pulling from it's idle state of high to low (on the logic side). Well, the Propeller tool does that but only for a reset after which it deasserts the DTR while it is programming (non-standard).

    What this means is that the published 3 transistor circuit will work and should work for programming but when you try to run a program that uses serial communications to a terminal program then the DTR will be asserted (+V on RS-232 side of DTR) and this circuit will never be able to transmit data back to the PC. This is because the PNP that drives the TX line can pull it up to +3V3 and relies on the resistor to pull it down to ground or less (negative). But the pull-down resistor is tied to the RS-232 level DTR which sits at +V when the port is open. A continually break will be detected in this case. When the port is closed the DTR will once again go to -V and if you scope it while the Propeller is transmitting something it will look normal, but too late, the port is closed.

    If this circuit is derived from the BS2 then it looks like it's not the same as the BS2 seems to be operating half-duplex (bitbashed?) as it has a 4K7 (vs 10K) from the collector of the PNP through to the receive line (normally sitting at -V if PC is not transmitting). So on the BS2 this will work but as long as the PC is not trying to transmit while the BS2 is transmitting.

    Summary:
    Propeller 3-transistor RS-232 circuit will work for Propeller tool by not with terminal programs (such as Hyperterminal).

    Solution:
    Take 10K resistor from PNP collector to ground instead (will work).

    BTW, Dr Hydra, the Propeller tool cannot tolerate a slow PC or other programs hogging most of the CPU time as the Propeller seems to timeout if the PC doesn't respond fast enough (tested this). This problem is exacerbated with the transistor circuit because the DTR circuit is inverted from that used with the USBSER or MAX232 circuits and that extra delay coupled with a slow PC can be enough for it to timeout.

    *Peter*
  • dr hydradr hydra Posts: 212
    edited 2007-03-19 14:00
    I got it to work.....It was the serial cable. Not all serial cables are the same.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-19 14:10
    Good stuff - was thinking it was the circuit or the cable ...rx/tx swapped !

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Post Edited (QuattroRS4) : 3/19/2007 2:20:28 PM GMT
Sign In or Register to comment.