Connect with us

RS-232 Circuit

Discussion in 'Hobby Electronics' started by Blog the Haggis, Aug 21, 2003.

Scroll to continue with content
  1. Hello,

    I was wondering if someone could point me in the right direction regarding
    RS-232 communication protocols, specifically to do with whether I need to
    synchronise the computer and the circuit sending the data. Also whether I
    need to include any start and stop bits on the data packet etc.

    What I'm trying to do:
    I want to get 8 mercury switches setting the states of a parallel loading
    shift register, then to send this byte to the serial port (through a
    line-driver to get the +ve/-ve RS-232 voltage levels). I believe it will be
    fairly easy to get the Comport flags to load the register and initiate
    transmission, but I am unsure of whether I need to send a clock signal or
    any extra bits aside from the data.

    If someone could enlighten me I'd really appreciate it,

    -Duncan
     
  2. Mike Harding

    Mike Harding Guest

    No and yes.
    Personally I'd use a small micro - PIC maybe, with built
    in UART - don't forget switch debounce - which may, or
    may not, be an issue for you. Mercury doesn't have much
    IIRC.
    RS232 is an asynchronous protocol (ie. no clock) although
    the 25 way connector does have provision for a clock I
    have never know it be used?

    Do a Google on "RS232" - lots of good hits - no point
    in us spending ages typing what is readily available.
    Then ask again if you have detailed problems.

    Mike Harding
     
  3. Rod Speed

    Rod Speed Guest

    Not if you are using the asynch protocol. Thats the whole point of it.
    Yes, thats essential. Thats how it works
    out the timing with the asynch protocol.
    Thats fine, tho you may find that a uart
    alone is enough, no need for a shift register.

    You'd be better off using a picaxe tho, much cheaper than a uart.
    Thats not how RS232 is done. The com port just
    looks at the RX line, waiting for chars to arrive.
    You do need a start and stop bit.
    You'd be better off starting with a picaxe.

    http://www.picaxe.com.au/
     
  4. Thanks for the info Mike. I have already done a Google search and I indeed
    found tons of sites about RS-232. While they all contained a description of
    what each pin does, none of them had a binary example of a serial
    transmission. The only thing I really need to know is how does the
    computer's UART distinguish between the start of one packet and the next, ie
    the difference between data & start/stop bits...

    -Duncan
     
  5. Rod Speed

    Rod Speed Guest

    Some pathetic little gutless fuckwit desperately
    cowering behind the entirely appropriate
    just the pathetic excuse for a troll any 3 year old could leave for dead.
     
  6. the swan

    the swan Guest

    You can always use one of the (old) pin-programmable UARTS (such as the
    COM8017). Attach your inputs to the 8-bit data bus lines, set the pins
    for the desired operation (start/stop/parity etc), add a crystal for the
    baud rate you'd like and then trigger it as you've mentioned.

    These devices contain the shift register, baud rate clock divider,
    parity generator etc all in (usually) a 40-pin package.

    I used one of these once to do an 8-input, 8-output remote I/O box via
    RS232, using a poll command to read the inputs or set the outputs (I
    think there were a few kits many years ago based on the General
    Instruments devices as well).
     
  7. You are right, it can be done with a shift register. There was a
    circuit in ETI, in the '80s, I think, that used a shift register and a
    555 to turn 8 bits into serial. The start and stop bits were hard
    wired. Hmmmm. Try looking up the ETI 632 VDU, I seem to vaguely recall
    it having a multiturn pot to get the baud rate right. There was two
    types of keyboard, the first cost an arm and a leg, the second was
    cheaper and used the shift register approach, maybe, it's a bit grey.

    Cheers,

    Mark, trying to remember too much ancient history.
     
  8. Hi Mark, yes that's the sort of thing that I'm trying to do. I think it will
    be fairly easy to generate the stop bit, all I'll have to do is hard wire a
    logic 1 to the serial input and by the time I've transmitted the 8 bits I
    should have a register full of them.

    At the moment I'm trying to think of some clever (and easy!) way of getting
    the start bit. So far the only solution that comes to mind is to add a
    flip-flop to the output of the register which I can load a 0 into. Not a
    very satisfactory solution but it would work. Maybe I can get the DTR line
    triggering the start bit...

    -Duncan
     
  9. Rod Speed

    Rod Speed Guest

    Same way, its just another bit that is always in the same state.

    In other words you need a 10 bit shift
    register, 1 start bit, 8 data bits, 1 stop bit.
    Thats another way of saying a shift register with more than 8 bits.
    Nothing unsatisfactory about it. You just
    need to clock it 10 times for the 10 bits.
    Its more usual to have the device send out a
    full char at a rate thats internally determined.

    You should be using CTS if you want to have an initiate command.
     
  10. Franc Zabkar

    Franc Zabkar Guest

    I have some minor experience with synchronous short haul modems that
    used the clock pins on the RS232 interface.


    - Franc Zabkar
     
  11. Rod Speed

    Rod Speed Guest

    Wrong. Its the standard covering both synch and asynch.
    Funny that.
    Corse its been used, for synch.
     
  12. Mike Harding

    Mike Harding Guest

    You didn't know that until Frank posted did you
    Roddie :) Oh you do have a fragile ego.

    Mike Harding
     
  13. Rod Speed

    Rod Speed Guest

    Wrong. As always. Even you should be able to use google
    and see that I have commented on that long ago.

    And used that mode too, with leased lines, back in the days when 300
    and 1200 baud leased lines were the bleeding edge of technology too.

    Reams of your puerile shit flushed where it belongs.
     
  14. Mike Harding

    Mike Harding Guest

    And yet despite the fact that my post had been here for
    2.5 days you waited until 27 minutes after Frank
    posted before telling us how clever you are - again!

    And you cut the bit about your fragile ego - you little
    tinker.

    Mike Harding

    PS. 300 baud! You poofter! I was in this game when
    we used automated Semaphore flags. We'd have been
    in seventh heaven with 300 baud!
     
  15. Rod Speed

    Rod Speed Guest

    I hadnt noticed that particular piece of drivel of yours
    because I didnt read that drivel of yours carefully, fuckwit.

    Reams of your puerile shit flushed where it belongs.
     
  16. Mike Harding

    Mike Harding Guest

    You can squirm all you want but the truth is plain to
    see.

    And you cut the bit about your fragile ego _again_!

    Mike Harding
     
  17. Rod Speed

    Rod Speed Guest

    Some pathetic excuse for a bullshit artist claiming to be
    Mike Harding <> desperately attempted
    to bullshit its way out of its predicament when its nose was rubbed
    in yet another of its terminally pig ignorant stupiditys in message
    and fooled absolutely no one at all. As always.

    Try harder, fuckwit. You might actually manage to fool someone, sometime.
     
  18. Mike Harding

    Mike Harding Guest

    I'm just curious; how long will you go on with a thread
    posting asinine drivel purely trying to have the last word?
    It's very egocentric you know.

    And stop cutting the bit about your fragile ego, is it
    really that fragile?

    Mike Harding
     
  19. Rod Speed

    Rod Speed Guest

    Some pathetic excuse for a bullshit artist claiming to be
    Mike Harding <> desperately attempted
    to bullshit its way out of its predicament when its nose was rubbed
    in yet another of its terminally pig ignorant stupiditys in message
    and fooled absolutely no one at all. As always.

    Try harder, fuckwit. You might actually manage to fool someone, sometime.
     
  20. Rod Speed

    Rod Speed Guest

    Some pathetic excuse for a bullshit artist claiming to be
    Mike Harding <> desperately attempted
    to bullshit its way out of its predicament when its nose was rubbed
    in yet another of its terminally pig ignorant stupiditys in message
    and fooled absolutely no one at all. As always.

    Try harder, fuckwit. You might actually manage to fool someone, sometime.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-