Shop OBEX P1 Docs P2 Docs Learn Events
Connecting a printer to Basic Stamp — Parallax Forums

Connecting a printer to Basic Stamp

Brian DalzielBrian Dalziel Posts: 17
edited 2005-11-24 10:15 in BASIC Stamp
Hi Fellas,

I'm getting involved with a datalogging project where I need to get a hard copy after the test is complete (using Basic Stamps).·

Wondering how to connect a printer (any type of printer) to a Stamp.· I am sure there must be an intermediate device (USB) that is available to connect to a Stamp somehow, then you connect the printer to the USB device?· Or can you use a straight serial printer.

I am also guessing that you can use SEROUT command to output data to the printer.· I'm sure it gets wildly complex, but any help of what type of equipment I need and frags of code to get me started, would be much appreciated!

Thanks - Brian

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-11-19 00:32
    You can use Hyperterminal to capture your data to an Excel or Word file, clean it up, then print it on your PC printer like any other document.· No need for an extra printer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Brian DalzielBrian Dalziel Posts: 17
    edited 2005-11-19 00:35
    That sounds like it would work, but I don't want to have a PC involved.· Once this machine finishes what it is measuring, it needs to spit out hard copy directly.
  • John R.John R. Posts: 1,376
    edited 2005-11-19 00:48
    It's been a long time, but I have taken raw data and "fed" it to a serial printer via RS-232 as a serial stream. This was from a Unix machine, but you should be able to do the same thing with a STAMP, assuming you can find a straight serial charcater printer.

    Formatting wasn't too bad, as everything was monospaced, so you just needed to keep track of line position, and figure out how many spaces between fields (taking into account a possibly variable field length). The printer I worked with used separate carriage return and line feed characters.

    If you can find a serial dot matrix, you should be all set.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.

    8 + 8 = 10
  • John R.John R. Posts: 1,376
    edited 2005-11-19 00:49
    As an additional thought, you might also be able to find a small serial thermal printer that will accept character input (as opposed to graphics commands).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.

    8 + 8 = 10
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-11-19 00:51
    The new·Serial Inkjet Printer Kit from Parallax·could work. How many characters do you need to print?
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are·3 kinds of people in the world,

    the dreamers, the do-ers, and the "Oh, what's this button do"-ers.
    Formerly bugg.
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com


    Post Edited (RoboGeek) : 11/19/2005 1:24:33 AM GMT
  • SPENCESPENCE Posts: 204
    edited 2005-11-19 02:29
    Star dp8340 serial printer dot matrix is what i use. It is a 40 collumn receipt printer like used in stores

    73
    spence
    k4kep

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    73
    spence
    k4kep
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-19 02:53
    Look at page 135 of this PDF. It·may require a BS2P for the I2C commands but it shows how to connect a BS2P to a printer cable. Perhaps you can simulate I2C commands as it is done with a BS2 to connect to a 24LC32 EEPROM.


    http://www.parallax.com/dl/docs/prod/book/bs2pCommnFeat.pdf
    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-11-19 11:11
    So it seems there are really two choices.

    1. Use a somewhat traditional serial printer
    2. Use an I2C chip to get either parallel or serial I/O

    [noparse][[/noparse]I am assuming USB printer requires too much initializing code for the BasicStamp to have much space left for an actual task.]

    Option One, you may need hardware control lines as well as the Rx and Tx. To do so, I think you need to establish an other serial port with TTL signals and covert them the RS-232. I suppose you might try to use the existng port [noparse][[/noparse]the signals are already inverted] and just add two lines, but you might fine it just ain't worth it unless you absolutely must save two pins.

    Lately, I have been thinking that USB is fairly limited in the embedded system environment. It seems to allow transmission and reception, but is very limited on control. Traditional RS-232 had 9 lines - one for the Ring Indication [noparse][[/noparse]nearly useless], four for Tx, Rx, and related grounds, and four for handshaking. Printers like to handshake.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Brian DalzielBrian Dalziel Posts: 17
    edited 2005-11-24 04:38
    Thanks everyone for your reply (and thanks for your time!)· I'll let ya know how things pan out with later posts.· - Brian
  • knightofoldcodeknightofoldcode Posts: 233
    edited 2005-11-24 10:15
    The following webpage might be of what your looking for:

    www.phanderson.com/stamp/i2c/print1.html

    Knight.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-
    This message transmitted with 100% recycled electrons.
    -=-=-=-=-=-
    Gravity doesn't exist. The Earth sucks.
    -=-=-=-=-=-
    Make a man a fire, and he will be warm for the night.
    Light the man on fire, and he will be warm for the rest of his life.
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-
Sign In or Register to comment.