Basic Stamp 1 DIP Serial Communication UART and USART

Anybody been through this subarea of microcontrollers?

When you put a Stamp 1 on a breadboard and it communicates with Basic Stamp Editor and Terminal

how is that done?

I doubt if the 16F5x the Stamp 1 starts out as has a UART or USART on it but then again I know very little about it.


  • Are you talking about the DEBUG statement or SEROUT (and SERIN) statement or what?

    There's a Nuts and Volts column (#20 here) on the subject of the BS1 DEBUG statement and how it communicates with the Basic Stamp Editor.

    The SEROUT (and SERIN) statement do "bit banging" where there's a subroutine in the BS1's interpreter that takes care of timing and I/O pin manipulation. There's no built-in UART or USART.

  • Okay. I know a little. :smile:

    The way the Stamp DIP is done is that like the old serial and parallel port programmers for PIC's?

    Well I guess it must have some resemblance because that in essence is what it is doing.

    Let me add now there is EUSART or EUART which is probably 'Enhanced UART'.

    Yes I am interested because I am build a dev board that swears all you need is a USB hardware connector for it to work.

    Must have a UART on the micro.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-11-06 - 17:01:56


    This was in N&V #16 by Scott Edwards.

    'The Stamps do away with the whole concept of dedicated serial ports, instead treating
    serial I/O as just another function of the normal I/O pins.'

    It is similar to the programmers of the time that were simple and inexpensive alternatives

    to expensive ($200 in 90's dollars) Microchip programmers.

    Then Parallax added the 'tokenizer' and some commands and away they went!

    Forgot a little proprietary hardware too.

    That takes care of that!
  • JonnyMacJonnyMac Posts: 6,381
    edited 2017-11-06 - 17:03:51
    There is no BASIC Stamp with a hardware UART. The PICs used in the BS1 and BS2 don't have UARTs, nor does the SX used in the BS2sx..BS2p series. Every one of them "bit-bangs" serial.

    This continues in the Propeller: no hardware UART. This provides a lot of freedom and flexibility. I am recently learning how good FDS for the Propeller is versus SoftwareSerial in the Schmarschmino.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.

  • Thanks Jon

    The hardcore way to learn about UART would be to add one of these to a micro.

    If you wanted to wimp out you could use a micro with a UART as a peripheral built in.

    Tend to think the pay off is less code and less program memory used.
  • Mike GreenMike Green Posts: 22,925
    edited 2017-11-06 - 19:39:33
    There are all sorts of add-on UARTs and USARTs designed for use with other microprocessors that you can add to a Stamp or Propeller at a fairly high cost in I/O pins. There are some simple microcontrollers preprogrammed as a UART-based peripheral for a Stamp to provide for buffering, but the Propeller works just fine with one cog providing up to 4 UARTs with flow control and buffering and speeds well over 230K Baud. Memory cost is maybe 2-3K and some I/O drivers are written to reclaim the assembly code space for use as buffers once the cog is started up.

    The Propeller can do USB with just a USB connector and a couple of resistors. One of the problems you run into with USB is that any but the simplest devices (like keyboards and mice) require a complex, sometimes proprietary I/O driver. Mass storage devices for example might use any of a number of file systems (FAT, FAT32, ExFAT, NTFS, HFS+, ext, ext2 just to name a few).
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-11-06 - 21:05:55

    So you know about TICkit?

    More of an engineering angle than Basic Stamp.

    No educational type material. Looks like they started around the same time.

    Yes. I did sense 'pin-eating' with that Futurlec UART.

    Where does RS232 chip fit in with Stamps?

    It is not listed as necessary to get Stamp DIP running.

    What would you gain if anything by using an RS232 IC?
  • Just throwing out this.

    The BS-1 programming adapter, (RS-232) could be used in conjunction with the USB-to-Serial adapter.
  • Mike GreenMike Green Posts: 22,925
    edited 2017-11-06 - 22:22:35
    An "RS232" chip is a voltage translation device. Look up the definition and history on Wikipedia. The Stamp Manual shows how to use a Stamp I/O pin with most RS232 I/O using a couple of resistors. If you need "real" RS232 voltage levels, you'll need to use an RS232 interface chip.

  • Publison


    That would be cheating!

    Us real tinkerers have to put thing together from parts.

    You do have a point.

    The Parallax Serial Adapter you point out has an RS232 IC in it.

    This is a can of worms! I will think about this some more.
  • Publison wrote: »
    Just throwing out this.

    The BS-1 programming adapter, (RS-232) could be used in conjunction with the USB-to-Serial adapter.

    I used to do that -- then knocked out this little board.

    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • JonnyMacJonnyMac Posts: 6,381
    edited 2017-11-07 - 00:35:16
    Where does RS232 chip fit in with Stamps?
    If you look in the BASIC Stamp help file (hint, hint), you find that you can take an RS-232 level signal into the BASIC Stamp using a 22K current limiter. You'll also need to specify inverted mode communications. This doesn't work for programming, but does work for in-program serial coms.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.

  • Mike

    When I do dive into it I think the RS232 is the place to start.

    'Learn while doing'. :smile:

    It's still a can of worms.

  • Jon

    That's a nice piece of hardware you made!

    Okay. This requires more investigation.

    Probably a lot more!
  • It's just a convenient knock-off of the original Parallax USB-to-TTL adapter (which works on a BS1 if you plug it in upside-down and align the ground pins). EFX-TEK sells a lot of BS1s in the form of the Prop-1 controller, so we needed something to get rid of the USB-Serial/BS1 Serial Adapter stack.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-11-07 - 02:25:08
    Thanks Jon

    Have a couple possible plans here.

    Work up from servo motor to an IC. Maybe an ADC or PWM.

    Might look at I2C communication to an EEPROM. Maybe even with a micro where you can see what's going on.

    Maybe an SX or something else.

    We'll get there one way or another!

    Be a micro interface expert or professional! :smile:
  • JonnyMacJonnyMac Posts: 6,381
    edited 2017-11-07 - 02:33:06
    I'll turn blue in the face saying it, but you'll save yourself a lot of grief by just starting with the Propeller now.

    -- Servos? Easy. I wrote a Spin-only driver that handles 8 servos with ramping; could be bumped to 16 without headaches.
    -- ADC? Easy to attach any ADC you like.
    -- I2C? The Propeller already has an I2C bus for the EEPROM so you don't give up any pins. Coding is a breeze.
    -- 1-Wire? No problem; I have code based on direct info by Dallas Semiconductor engineering.
    -- Smart pixels? I have been using them since they first came on the scene.

    And look at all the cool things people like Mike Green and others have done. It's why allow myself time in these forums: to learn from people like Mike.

    THE SX IS DEAD. I know you don't want to believe it, but you'll get pigs to fly before you get an real traction out of the SX. Again, thank your pals at Microchip for that.

    The question is really this: Do you want to be productive as an embedded programmer, or do you just want to play with chips to pass the time? Nothing wrong with the latter, but being productive is a lot of fun, too -- and can earn you cash if you do it well.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-11-07 - 03:14:40

    ' play with chips to pass the time'

    That sounds darn right relaxing.

    Wish I had thought of that! :smile:

    This period of time is a vacation for me so I am attempting to enjoy it.

    As we used to say I'll get 'yanked out of here' soon enough.

    This (place speech from Henry VII here). 'This English isle...'. :smile:

  • This was the hard way to do it.

    Now I see the benefit of peripherals.

    That way you are not 'fighting a war on two fronts'.

    You get a chip with the peripheral you want and then it becomes a software only issue.

    It is interesting adding hardware peripherals to the Basic Stamp though.

    See the process that brought about peripherals first hand.
  • "This was the hard way to do it."

    Which way? Are you talking about soft peripherals like the way the Propeller does it or hardware peripherals the way most other microcontrollers do it?''

    You can add hardware peripherals to a Basic Stamp and there are nice peripherals available these days that do all sorts of things. Many of them use SPI or I2C interfaces that don't require too many I/O pins to support.

    The Propeller 1 was designed to mostly use soft peripherals including Analog to Digital conversion and video output. If you want another ADC channel, just load up the necessary software into another cog. You don't have to hope the manufacturer has made up another part with the number and types of hardware peripheral units you need. If you need a peripheral that does something special like handle 9-bit asynchronous serial data, you can modify existing software to do that ... and do it quickly with little effort.

  • Mike

    The 'baby steps' of adding stepper motor is headed in right direction.

    I think adding EEPROM to Stamp 1 or 2 DIP would be a good project.

    Will look into Analog to Digital and the other way around.

    Will have an SX DIP soon. Two of them actually.

    Better start out with Stamp though.

    That 'two fronts' thing.

Sign In or Register to comment.