Shop OBEX P1 Docs P2 Docs Learn Events
Adding a serial interface for debugging. — Parallax Forums

Adding a serial interface for debugging.

DgswanerDgswaner Posts: 795
edited 2008-01-03 00:31 in Propeller 1
I'm tired of using the propeller programming serial connection (pin 30,31) to debug.... lots of extra switching programs and closing comport apps... gets old quick. I have a few Max232 chips and I thought I would essentially make my own "debug plug" basically a serial version of the prop plug. I don't need anything fancy just a serial connection for debugging.

I found this circuit www.coolcircuit.com/circuit/rs232_driver/max232.gif but I'm not too familiar with serial communication and wanted to verify that this will work before I give it a try.

The Max232 will do TTL level inputs which I believe to be what the prop requires.

will this work? is there a better option? I know you can use transistors, but I already have the 232's on hand.

Thanks, for the look. I'm a little worried about frying my board.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

DGSwaner

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-31 18:57
    Since the MAX232 needs a 5V Vdd, the RX input to the Prop in your diagram will have a 5V "high" level. You will need to add a series resistor to limit current into the pin. There's also a 3.3V version of this chip, the MAX3232. But since you already have the '232s, you should be okay with the additional precaution noted here.

    -Phil
  • DgswanerDgswaner Posts: 795
    edited 2007-12-31 19:07
    this is the exact reason I wanted a second opinion! I'll get the 3.3v versions next time.

    Thanks!!!!!!!!!!!!!!!!!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-31 19:14
    I had no problem running the MAX 232 @3 Volts, RS-232 Ssgnals were 6 rather than 10 Volts, and I only used it at 19 kBit/sec
  • LeonLeon Posts: 7,620
    edited 2007-12-31 21:18
    I've used a MAX232 at 3.3V without any problems, until I could swap it for a MAX3232.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • hippyhippy Posts: 1,981
    edited 2008-01-01 02:16
    I added serial debug output by taking a Propeller output pin and feeding it straight into the PC's Rx In via a 180R and have had no problems.

    Serial data from the PC Tx Out goes straight to a Propeller Input pin via a 560K, again I've had no problems with my desktop PC which gives out +/-12V.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-01-01 04:28
    I'm feeding my M100, (TRS80 portable) with a serial output pin directly without issues.
    Providing I keep my speed around 2400-9600, I don't get errors.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • deSilvadeSilva Posts: 2,967
    edited 2008-01-01 09:34
    @Hippy: You should also add a diode at the right place. With -12V @560 Ohms = 25 mA you live at the risky side of life . But +8 V = 15mA are not better. I wonder....

    Why dont you take a decent 10k?
    Even with 10p capacitance this will influence the signals for >1 M BPS only


    The "transistor solutions" allow a somewhat safer handling of the voltage reduction, but not much... Main reason to use the transistors is to invert the signal, which however is unneeded in most cases as the software can adjust for it (but not the bootloader!)
  • hippyhippy Posts: 1,981
    edited 2008-01-01 11:39
    @ deSilva : 560K - so around 20uA smile.gif
  • DroneDrone Posts: 433
    edited 2008-01-01 11:58
    Like Leon, I've also had success with the MAX232 at 3.3V. But now I use the +3.0-+5.5V rated MAX3232CPE or MAX3232CPE+, the latter of which is RoHS/Lead-Free. This part number is for the 16-pin plastic DIP package.

    David
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-01 12:00
    @Hippy: Otherwise you would have had to replace the Propeller after each use, I guess smile.gif
    So you do not need the diode either.
    But 500k is somewhat of an overkill.. The signals above 100 kBits/sec should not look so well.. But 9600 Baud is o.k.

    I shall connect a Prop with an USB/serial dongle this afternoon.
    I shall take:
    PC -> 47k (and a diode, being paranoic)
    PC <- 100R (being paranoic)

    Post Edited (deSilva) : 1/1/2008 12:09:54 PM GMT
  • DgswanerDgswaner Posts: 795
    edited 2008-01-02 16:40
    I looked around at different circuits and I want more of a universal "debug plug" so I do want to use the Max232 IC Attached is the Circuit that I intend to use. I'd love a 2nd set of eyes to look at it and make sure I have it correct. I'm working on the PCB layout now and will post it for any one interested. I have to say I'm pretty much guessing on the LED connection, Will it work? I copied that from another schematic.

    and can some one answer a question? the Caps, most of the schematics have a -||- symbol (non polarized) but show a + indicating there it matters others show the -|(- symbol. Do these caps need to be polarized? could someone explain why or have a link on where I can find out why it matters... or not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
    342 x 459 - 25K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-02 16:45
    Most small capacitors (usually less than 1uF) use ceramic or plastic insulation and are not polarized.
    Generally larger capacitors (1uF or larger) are electrolytic and are normally polarized. In your case,
    only the 10uF capacitor would be polarized and the polarity is pretty obvious in that it's connected
    across the power supply.
  • DgswanerDgswaner Posts: 795
    edited 2008-01-02 17:05
    Thanks Mike. I knew the guys at the supply store would ask "are you sure you need 1uf electrolytic caps?" as most I've seen are ceramic. but the schematic was throwing me off. Thanks for clearing it up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-02 17:15
    DGSwaner,
    I think others will give you basic electronic links, I know only (very good) German ones smile.gif

    You see, there is no such thing as "THE" capacitor. The making of capacitors is in fact a black art. Depending on capacity, voltage, accuracy of stated capacity, budget, and lack of annoying side effects you have to chose the right one. This is not so important for the hobbyist as for the working engineer. Highest frequencies need special types, and high voltage AND current (with motors) other types.

    For the microcontroller there are mostly three types of significance
    - ceramic caps
    - polyfilm caps
    - electrolytic caps, with the special sub-type tantal caps

    Due to the underlying principle ceramics - though close to perfect for most applications - will become very large and expensive for higher capacities; electrolytes on the other hand can be made quite small and cheap, however they have their problemes with higher voltage...

    Again, there is not only no such thing as "THE" cap, there is not even a cap at all smile.gif Each piece is a combination of capacitor, resistor, and inductor. As you may already know, inductors are no good... Electrolytes have a lot of inductivity...

    You know how a crystal is drawn? Looks like a cap. That is darn wrong - it's an inductor.

    But back to the topic. Ceramics of higher capacity are not affordable and become bulky; the break even point is around 1µF, but one tries to avoid electrolytes as far as possible.

    They are kind of batteries: much chemistry inside, and don't like it to be connected the wrong way round... So please have care. When you look tightly at the top of an electrolyte you will notice two crossed lines at the silver top. This is the place where the (expletive) will come out when it cracks.

    The lead where to conect the plus is the longer one, as with LEDs. Tantal electrolytes (which are as much smaller as they are expensive) have a clear + sign on them. The standard electrolytes more clearly mark the - side.

    After some experience it will be obvious to you from the diagram, where the plus should be, though it is ALWAYS marked!

    Post Edited (deSilva) : 1/2/2008 5:32:37 PM GMT
  • HannoHanno Posts: 1,130
    edited 2008-01-02 20:44
    Check out ViewPort's "auto connect/disconnect" settings. When I'm developing I don't have problems sharing the 1 com port with two programs- the Propeller Tool and ViewPort... When ViewPort's window is active my measurements are shown. When I "click" on the Propeller Tool, ViewPort automatically disconnects. When I "click" back on ViewPort the connection is restored. If the configuration was changed, ViewPort will detect that. This works for "alt-tab" and "minimize" as well...
    Hanno
  • DgswanerDgswaner Posts: 795
    edited 2008-01-02 23:18
    I didn't like view port as much as Multicodserialdebug. perhaps it's just because I've been using Stamps for too long. I wasn't able to get multiple variables to display.... I didn't try that hard tho. I prefer just the numeric value when debugging, but I also want a "debug plug" for other things like my PINK and other projects. perhaps I need to give viewport another look.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • RaymanRayman Posts: 14,162
    edited 2008-01-03 00:31
    I'm currently using both the 2-transistor serial connection and the USB Prop-Plug at the same time... Using regular serial for programming and USB for PropTerminal. They seem happy to share this way...
Sign In or Register to comment.