Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Serial Programming Adapter - Testing — Parallax Forums

Propeller Serial Programming Adapter - Testing

Mike CookMike Cook Posts: 829
edited 2008-08-05 07:00 in Propeller 1
I built the Propeller Serial Programming Adapter as shown here:

http://forums.parallax.com/attachment.php?attachmentid=41153

I tested it with the Basic Stamp Debug Window as follows; and am curious to find out if this is a valid test since I don't have the Propeller Tool or Chip yet to test this adapter.

Test Procedure:

1. Connected the Propeller Serial Programming Adapter to Com3.

2. Opened a new debug window for com3 and configured to 19200 baud.

3. Checked the DTR box in the debug window, observed a very short negative pulse on the RST line of the Propeller Serial Programming Adapter.

4. Unchecked the DTR box in the debug window, no pulse observed.

5. Connected a SX chip that outputs serial data at "T19200" to pin RX(P30) on the Propeller Serial Programming Adapter.

6. Reset the SX chip (it outputs serial data on power up) and observed expected serial data in the Stamp Debug Window.

7. Typed a few keys in the Basic Stamp Debug Window, observed toggling data on TX(P31) on the Propeller Serial Programming Adapter.





I attempted testing this with a standard terminal program (HyperTerm & ProComm) and both of these terminal program assert DTR when the com port is open. With DTR asserted I don't get any serial data from the Propeller Serial Programming Adapter RS-232 PIN 2.

Is this the expected behavior of this circuit?

Thanks,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
«1

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-10 21:56
    Did you leave the series cap out of the DTR line? -- that's what it's there for.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 22:07
    Yes the cap (.01uf) is in series with DTR (RS-232 PIN 4) and the 10K going to the base of the 2N3904 that controls RST.

    Using a terminal program such as RealTerm or the Basic Stamp debug window, where you can control DTR, with DTR asserted I get a short negative pulse out RST. While DTR is asserted no serial data arrives to PIN 2 of the RS-232 connector. De-asserting DTR allows serial traffic to pass from RX(P30) to PIN 2 on the RS-232 connector.

    Am I correct in assuming that the Propeller Tool momentarily asserts DTR to just reset the Propeller Chip?

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-10 22:15
    Yes. I know that Beau used the circuit for programming, but I'm unaware if he ever tried any serial tests with it; I don't think that was his concern at the time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 22:21
    Well I built it as a programming adapter for the propeller chip. I was feeding serial ttl data in and out of it to test functionallity.

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-04-10 22:23
    Mike,

    Try moving the 10K (Currently between RX and DTR) so that it is between RX and TX.

    As is, the 10K acts as a pull-down, using the DTR as it's -V source. When you assert DTR,
    the 10K acts as a pull-up, and the data does not flow because it remains at +V.

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

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/10/2006 11:33:11 PM GMT
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 22:42
    Ok, I'll have to let that soak in for a few, I get a little dense after a day at work!

    I built this as per this diagram:

    http://forums.parallax.com/attachment.php?attachmentid=41153

    If the circuit is built as per the above diagram will it work to program the Propeller?

    Was trying to perform some tests with the board I built to verify it was built as per the diagram. I've been over the board and all looks ok. Even bread boarded a second copy of it and the bread board version has the same behavior.

    I also attached a screen shot of the pulse when DTR is asserted.

    Thanks,


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
    792 x 545 - 77K
  • FORDFORD Posts: 221
    edited 2006-04-10 23:04
    Mike,
    I built the circuit on a breadboard, and it worked but caused problems.
    I then built the circuit on a vero-board, and it works perfectly.
    I used the same circuit diagram you have.

    Cheers,
    Chris
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 23:07
    Beau,

    I'm a little confused. In the attached circuit diagram the 10K is between RX (PIN 2 on the RS-232 connector) and DTR (PIN 4 on the RS-232 connector). Was there just a typo in your response of: (Currently between TX and DTR)? Or am I still not getting it?

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 23:09
    Thanks Chris,

    I guess I'll just have to wait for the chip to get here to know for sure. I have a USB2SER but wanted a serial version of the programmer too.

    Thanks,




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-04-10 23:32
    Mike,
    You said...

    If the circuit is built as per the above diagram will it work to program the Propeller?

    Yes. The above circuit works, however if you want to send data from the Propeller
    back to the PC, the DTR line must be kept at -V as you have discovered.
    You said...

    I'm a little confused. In the attached circuit diagram the 10K is between RX (PIN 2 on the RS-232 connector) and DTR (PIN 4 on the RS-232 connector). Was there just a typo in your response of: (Currently between TX and DTR)? Or am I still not getting it?

    Yes, a typo, that should be between RX and DTR I will change it.

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

    IC Layout Engineer
    Parallax, Inc.
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 23:36
    Thanks Beau,

    Eagerly awaiting the Propeller tool and the Chip!

    Thanks again!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Mike CookMike Cook Posts: 829
    edited 2006-04-10 23:59
    Beau,

    So just to clarify the attached Propeller_Programmer_ONLY.JPG as copied from:

    http://forums.parallax.com/forums/attach.aspx?a=6685

    Would be a Propeller programmer ONLY.

    And the attached Propeller_Programmer_And_Serial_Tool.JPG, modified as per this thread, can be used as a Propeller Programmer AND a serial TTL to RS-232 tool for something like "FullDuplex.spin"?

    Sorry to be so anal but I work in an industry where we have to have debugging procedures for something as simple as a cable!

    Thanks Again,


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    Post Edited (Mike Cook) : 4/11/2006 4:19:46 PM GMT
    973 x 720 - 56K
  • Rob7Rob7 Posts: 275
    edited 2006-04-11 01:21
    Great Mike,
    It's great that you are so far ahead in testing before we receive our
    propeller, Can you post a pic of your serial programming adapter?

    Rob7
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-04-11 02:13
    Hi Mike,

    I've discovered during my own Propeller programming that it's actually handier to use a separate serial port for debugging. The reason is that you can then leave your debugging port open all the time in your terminal program (PBASIC Debug window highly recommended), rather than having to close it every time you upload a program. But you really don't need any additional circuitry -- just a female DB9 connector with pin 5 connected to ground and pin 2 connected to a Propeller port pin. You see, most PCs' RS232 ports work fine with 0 to 3.3V signal levels. The trick is to use a Propeller serial driver that works with inverted logic, so you don't need the hardware inverters.

    Cheers!
    Phil
  • Mike CookMike Cook Posts: 829
    edited 2006-04-11 03:09

    Rob

    Attached is a photo of the board so far. The board marked PSPA is the Propeller Serial Programming Adapter. There is also a spot on the main board for the USB2SER. Wanted to have both type of adapters to test with. more info on my board can be found here:

    http://forums.parallax.com/showthread.php?p=579595



    Phil

    I understand what your saying, I've used the Inverted technique with SX's, AVR's, PIC's and other Stamp Models. However when I'm starting out with a new chip I prefer to work with traditional RS-232 circuits to avoid anything that might be the least little bit flaky at Inverted TTL logic levels. Once I see it work then I'll back slide to the Inverted TTL logic levels for short distance serial debugging.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
    1633 x 1331 - 629K
  • Paul Sr.Paul Sr. Posts: 435
    edited 2006-04-11 12:25
    Very nice work - thanks!
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-04-11 16:13
    Mike,

    I wanted to test the revised schematic before I replied, and it does NOT work.
    The original COM2Propeller schematic that I created, is the one you want to use when programming or communicating to the Propeller.

    I have attached a few screenshots of the bare minimum SBB (Solderless Bread Board) components required to program a Propeller.

    Note: If you don't have or can't find a 3.3V regulator, you can use a 220 Ohm and a 330 Ohm resistor combination on an adjustable regulator(LM317) to get about 3.2V

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

    IC Layout Engineer
    Parallax, Inc.
    1800 x 1200 - 395K
    1800 x 1200 - 362K
  • Mike CookMike Cook Posts: 829
    edited 2006-04-11 16:18
    Beau,

    Thanks for going to all the trouble to test the modified diagram. I'll edit my original post to remove the reference to:

    Propeller_Programmer_And_Serial_Tool.JPG

    Thanks Again,



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • parts-man73parts-man73 Posts: 830
    edited 2006-04-15 03:10
    Beau,

    Not to nit-pick, but in your "original COM2Propeller schematic", you have p30 labeled as RX and p31 labeled as TX, I'm assuming this is a typo, but I want to make sure, as I am etching a circuit board, and I don't want to end up with a square green coffee cup coaster. wink.gif

    Thanks again,
    Brian
  • cgraceycgracey Posts: 14,208
    edited 2006-04-15 03:45
    Woops!

    p31 receives from the host

    p30 transmits to the host

    Both signals are TRUE (start bit = low) 3.3V logic.
    parts-man73 said...
    Beau,

    Not to nit-pick, but in your "original COM2Propeller schematic", you have p30 labeled as RX and p31 labeled as TX, I'm assuming this is a typo, but I want to make sure, as I am etching a circuit board, and I don't want to end up with a square green coffee cup coaster. wink.gif

    Thanks again,
    Brian
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-04-15 03:57
    Chip and Brian,

    The schematic is correct. The pins are referenced as if the COM2Propeller was a PropellerClip.

    Reference the image below:
    attachment.php?attachmentid=41250


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

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/15/2006 4:00:25 AM GMT
    771 x 490 - 67K
  • parskoparsko Posts: 501
    edited 2006-05-02 18:36
    Beau,

    Would you care to confirm exactly what schematic is correct??? Both have conflicting Rx and Tx lines. I am now trying to connect, but not seeing anything. I want to confirm this first. I have triple checked my wiring otherwise, and things seem to check out.

    Do you think I would have an issue if I were using a USB/Serial adaptor (Keyspan)? That is what I have right now (my woman has my laptop with a REAL serial connection I will try tomorrow night).

    My B-E-A-U-T-I-F-U-L DEMO board is in the attached pic. Don't ask to see the other side, it's not so nice.

    Thanks in advance,

    -Parsko
    1280 x 960 - 1M
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-02 19:00
    Ok, my apologies for·all of the confusion over this matter.
    ·
    First, pretend for a moment that the "COM2Propeller" schematic·IS a "Propeller Clip" depicted in the Propeller Manual.
    ·
    RX from the "Propeller Clip" or "COM2Propeller" goes to the TX(A30) on the Propeller
    TX from the "Propeller Clip" or "COM2Propeller" goes to the RX(A31) on the Propeller
    ·
    With the exception of the name difference·of VSS and GND, the "COM2Propeller" is pin for pin compatible with the "Propeller Clip"
    ·
    ·
    ·
    I'm not sure about your USB/Serial adaptor from Keyspan, but with the Parallax USB2SER adapter, the "COM2Propeller" is not necessary.
    Just connect the RES,TX,RX, and VSS lines of the USB2SER accordingly. (<-- Read ... as if it were a "Propeller Clip" depicted in the Propeller Manual.)
    ·



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

    IC Layout Engineer
    Parallax, Inc.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2006-05-02 19:32
    People should be aware that this circuit will have an issue when used with general purpose terminal programs, such as Hyperterminal, that leave DTR pin 4 on the DB9 high while connected. This circuit is relying on DTR to act as a pulldown to a negative voltage for RX, pin 2 on the DB9. The Propeller IDE and the Stamp IDE leave that line low by default, so it is not an issue with those. However, a program like hyperterminal will not be able to receive data from the Propeller, unless a different arrangement is made for pulling the line low. The simplest hack is simply to connect the pulldown resistor to ground, and that will work with most but probably not all PC serial ports. Phil addressed this issue in the Prop Stick by adding a MAX3232.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • David BDavid B Posts: 592
    edited 2006-05-06 04:15
    I made the Propeller board serial circuit with the three transistors described in this thread.

    To test the board, I jumpered pins 39 and 40 of the (empty) Propeller socket with a piece of wire, then sent characters from my PC serial port to the Propeller board to see if they would echo back. No luck. (I used a serial port exerciser program that lets me manually set or clear DTR, and had manually DTR set low.)

    So as a test, I breadboarded 2 2N3904 transistors - both emitters to gnd, both collectors thru 2.2K to +5V, RS232 TX thru 10K to the base of one, its collector thru 10K to the base of the second, collector of the second to RS232 RX. Characters echoed fine thru this circuit.

    But if I supplied the second transistor, the RS232 RX driver, with 3.3V, it would not drive my PC's serial port. Garbage characters did arrive, showing that 3.3V is just at the threshold of working.

    So apparantly my PC (IBM NetVista with built-in RS232) does not work properly with only 3.3V driving its RS232 RX input, but 5V is OK, and it does not require a negative voltage in order to work properly, ground is OK. Maybe this is the reason several others are reporting that they can't get this circuit to work.

    Am I correct in expecting to be able to echo characters by jumping pins 39 and 40?

    Does anyone see any problem with the substitution of the above-described NPN in place of the PNP, wired as above, 5V thru maybe 2.2K to its collector, Propeller RX(P30) thru 10K to its base, and its collector driving the RS232 RX? I'd leave the DTR driving the RESET pulse circuit just as is, and leave the TX circuit as is.


    David
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-06 05:10
    David,

    It's difficult to test a circuit on all platforms with all conditions. That said, I came up with the 3-transistor circuit as a derivative of what is
    built onto the BS2 modules. The difference is that the BS2 modules are capable of supplying 5V where the 3-transistor circuit from the
    Propeller·(that seems to work in most situations) can only supply 3.3V.

    The culprit is the RX line going to the PC or Laptop, this is a "up level shifter" ( through the PNP) which steals it's LOW signal from the DTR.
    Perhaps I should re-think this part of the circuit, so that a HIGH signal is "stolen" from the serial connector, and a signal from the Propeller
    brings it LOW. This would also address the problem of communication depending on what state the DTR pin is in.

    The other signals (TX and DTR ... PC side) are "down level shifters" ( through the NPN's) and do just fine... no need for any change here.

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

    IC Layout Engineer
    Parallax, Inc.
  • David BDavid B Posts: 592
    edited 2006-05-06 15:23
    Thanks, Beau.

    I guess I can't wire the PNP emitter to +5, either, because then the Propeller wouldn't be able to completely shut it off.

    So in my case, it looks like I have to go for an NPN to drive the RS232.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-10 15:14
    tried the Comm2prop schematic, and don't get anything back in debug on my HP Pavilion Notebook. I hope this prop isn't dead, it does (i believe read) something with a 16Kbit EE i "borrowed" off a BS2OEM board as i have logic LED's on everything - to assure functionality. The Comm2Prop doesn't work, even when i powered the PNP with 5V and no LED indicator, i got no echo in any terminal prog. M guessing the prop is ok, just my interface, i have a few tricks up my sleeve yet, will sim them on Multisim so i don't dammage the prop. Will probably wind up desoldering the MAX232 and transplanting it to the breadboard.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • SawmillerSawmiller Posts: 276
    edited 2006-08-10 21:10
    sid built me a board for the com2prop... i got it and populated it and it works... but not until i put 3.3v to it.. when i put 5 v to it accidently, it didnt work.

    dan


    ps i never tried to just go back to the term program, somewhere, i think it was in this thread, parallax said that would not work.

    however i have programmed my prop that i had soldered up according to the "homemade" print that is floating around here



    Post Edited (Sawmiller) : 8/10/2006 9:14:25 PM GMT
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-10 22:22
    WOOHOO!! it's a nice feeling when it says prop ver 1 found on com1. Neither transistor design worked with my HP laptop, BUT the MAXIM MAX232 did! Of course it's the 5V version so i had to create a V-divider so the prop would see no more than 3.3V on the RX/SERIN pin 40. D/L'd & i have a blinking led!yeah.gif

    1) I say try the 3 transistor idea, if that fails, move to a MAX3232 (3V ver), or just get a programmer from parallax. Like Mr. Schwabe stated, all computers are NOT equal, and the transistor dsign won't work on all PC's/Laptop's!

    2) A MiniATX power supply is well powered and filtered for ANY project you can think of. PERIOD. Most new ones come with more voltage taps than you know what to do with! I'm using a 400W CompUSA p/s, i believe their 250W/300W p/s is like $20!

    3) I'd like to thank all who added to this thread with what worked for them, and Phil for pointing me in the right direction.

    If anyone is unsure about their interface, simply jumper TX/RX @ the DB9 on your board (which can also be done on the BOE version by physically holdin a wire on the board), with a DEBUG winow already open and Echo unchecked, you should see any character typed echoed in the lower window, now move to the Propeller's TX/RX pins and jumper them with a 1k resistor, you should still get an echo. (don't worry you won't hurt the Propeller), if not check the jumper, the cable IS connected fully, and that you don't have a NULL MODEM cable. With your serial interface working, you should see "Propeller ver 1 on Com n", n being the port number. When yo see that, your in buisiness!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"


    Post Edited (RinksCustoms) : 8/10/2006 10:55:43 PM GMT
Sign In or Register to comment.