Shop OBEX P1 Docs P2 Docs Learn Events
OT : How does the stamp implement multiple UARTS on all pins — Parallax Forums

OT : How does the stamp implement multiple UARTS on all pins

ArchiverArchiver Posts: 46,084
edited 2004-02-03 21:31 in General Discussion
I have a question regarding using a MCU to implement multiple serial
(UART) connections. This is the question :

When I use the Basic stamp. I can use the serin/serout commands to
receive/send UART signals(rs232) . I can actually send it to any pin.
Obviously u cant do it simultaneously. But u can sequentially do
serial commn on each pin. So I can interface it with so many serial
devices.

But in MCUs that I have seen MSP430 , atmega128 : I notice that the
uarts have specific pins assigned. So does that mean that I can only
have 1 serial connxn. What if I want to interface to 15 serial
devices?(sequentially send messages to 15 devices connected to
individual pins w/o the use of an externel multiplexer, like the
stamp does)

I could easily do this with the stamp. I have a feeling I'm missing
something here. Cause surely u could do it with these latest devices
too.

Would i be correct in assuming that the way the stamp implements a
uart on every pin. is through a software UART rather than a hardware
UARt multiplexed to all the pins?


How can other MCUs do the same


I hope my question was clearly framed

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-02-03 13:22
    At 09:34 AM 2/3/04 +0000, suri_list wrote:
    >I have a question regarding using a MCU to implement multiple serial
    >(UART) connections. This is the question :
    >
    >When I use the Basic stamp. I can use the serin/serout commands to
    >receive/send UART signals(rs232) . I can actually send it to any pin.
    >Obviously u cant do it simultaneously. But u can sequentially do
    >serial commn on each pin. So I can interface it with so many serial
    >devices.

    Quite so, and it one of the many marvelous features of the Basic Stamp.


    >But in MCUs that I have seen MSP430 , atmega128 : I notice that the
    >uarts have specific pins assigned. So does that mean that I can only
    >have 1 serial connxn. What if I want to interface to 15 serial
    >devices?(sequentially send messages to 15 devices connected to
    >individual pins w/o the use of an externel multiplexer, like the
    >stamp does)

    In this regard, MicroChip PIC processors are different I guess. The MicroChip
    PIC
    processor is the underlying MCU under the Basic Stamp platform.


    >I could easily do this with the stamp. I have a feeling I'm missing
    >something here. Cause surely u could do it with these latest devices
    >too.

    I really can't speak for the other devices, but PIC processors can usually do
    I/O on most pins. Sometimes it's analog, sometimes digital, and both software
    and hardware UARTs are often supported, depending on which PIC chip you use.


    >Would i be correct in assuming that the way the stamp implements a
    >uart on every pin. is through a software UART rather than a hardware
    >UARt multiplexed to all the pins?
    >Correct !
    >
    >How can other MCUs do the same
    >Ask them, I suppose.
    >
    >I hope my question was clearly framed
    >It was for me :-)
    >
    >Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-03 19:06
    The BasicStamp can do these things because it uses
    a "bit-bang" uart in software. When you issue
    SEROUT 16, 16384, [noparse][[/noparse]"Hi"],
    a software routine sends the bits out port '16'
    (the built-in serial port) and controls the
    timing of the serial bits with a timing loop.

    This is why you can only send out one port
    at a time -- but you can send out any port.

    The PIC has a hardware UART on-chip. To use
    a hardware UART, you simply write to the
    UART's transmit register, and it handles all
    bit timing in the background.

    The benefit of this is that your processor
    can be doing other stuff while the byte is
    being sent.

    If you had multiple hardware uarts, your
    Stamp would only have to talk to them when
    a byte was ready -- not have to sit there and
    ONLY send out bytes, or ONLY recieve bytes,
    and oh by the way the Stamp can't do both at
    the same time.

    It's the 'simultaneous' aspect which is
    desirable and people pay for.

    --- In basicstamps@yahoogroups.com, "suri_list" <suri_list@y...>
    wrote:
    > I have a question regarding using a MCU to implement multiple
    serial
    > (UART) connections. This is the question :
    >
    > When I use the Basic stamp. I can use the serin/serout commands to
    > receive/send UART signals(rs232) . I can actually send it to any
    pin.
    > Obviously u cant do it simultaneously. But u can sequentially do
    > serial commn on each pin. So I can interface it with so many serial
    > devices.
    >
    > But in MCUs that I have seen MSP430 , atmega128 : I notice that
    the
    > uarts have specific pins assigned. So does that mean that I can
    only
    > have 1 serial connxn. What if I want to interface to 15 serial
    > devices?(sequentially send messages to 15 devices connected to
    > individual pins w/o the use of an externel multiplexer, like the
    > stamp does)
    >
    > I could easily do this with the stamp. I have a feeling I'm missing
    > something here. Cause surely u could do it with these latest
    devices
    > too.
    >
    > Would i be correct in assuming that the way the stamp implements a
    > uart on every pin. is through a software UART rather than a
    hardware
    > UARt multiplexed to all the pins?
    >
    >
    > How can other MCUs do the same
    >
    >
    > I hope my question was clearly framed
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-03 21:31
    thanks this answer makes sense. I was suprised that the hw uart on
    the pic was able to connect to all i/o.
    its a software uart : thats why it can bit bang on all bits.
    in our case we need to implement 6 serial connxns from the atmega128
    which has 2 uarts. seems like the best we could do is run two serial
    from them and the rest would have to be bit banged.
    thanks
    --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
    wrote:
    > The BasicStamp can do these things because it uses
    > a "bit-bang" uart in software. When you issue
    > SEROUT 16, 16384, [noparse][[/noparse]"Hi"],
    > a software routine sends the bits out port '16'
    > (the built-in serial port) and controls the
    > timing of the serial bits with a timing loop.
    >
    > This is why you can only send out one port
    > at a time -- but you can send out any port.
    >
    > The PIC has a hardware UART on-chip. To use
    > a hardware UART, you simply write to the
    > UART's transmit register, and it handles all
    > bit timing in the background.
    >
    > The benefit of this is that your processor
    > can be doing other stuff while the byte is
    > being sent.
    >
    > If you had multiple hardware uarts, your
    > Stamp would only have to talk to them when
    > a byte was ready -- not have to sit there and
    > ONLY send out bytes, or ONLY recieve bytes,
    > and oh by the way the Stamp can't do both at
    > the same time.
    >
    > It's the 'simultaneous' aspect which is
    > desirable and people pay for.
    >
    > --- In basicstamps@yahoogroups.com, "suri_list" <suri_list@y...>
    > wrote:
    > > I have a question regarding using a MCU to implement multiple
    > serial
    > > (UART) connections. This is the question :
    > >
    > > When I use the Basic stamp. I can use the serin/serout commands
    to
    > > receive/send UART signals(rs232) . I can actually send it to any
    > pin.
    > > Obviously u cant do it simultaneously. But u can sequentially do
    > > serial commn on each pin. So I can interface it with so many
    serial
    > > devices.
    > >
    > > But in MCUs that I have seen MSP430 , atmega128 : I notice that
    > the
    > > uarts have specific pins assigned. So does that mean that I can
    > only
    > > have 1 serial connxn. What if I want to interface to 15 serial
    > > devices?(sequentially send messages to 15 devices connected to
    > > individual pins w/o the use of an externel multiplexer, like the
    > > stamp does)
    > >
    > > I could easily do this with the stamp. I have a feeling I'm
    missing
    > > something here. Cause surely u could do it with these latest
    > devices
    > > too.
    > >
    > > Would i be correct in assuming that the way the stamp implements
    a
    > > uart on every pin. is through a software UART rather than a
    > hardware
    > > UARt multiplexed to all the pins?
    > >
    > >
    > > How can other MCUs do the same
    > >
    > >
    > > I hope my question was clearly framed
Sign In or Register to comment.