Shop OBEX P1 Docs P2 Docs Learn Events
Revised SX/B Driver for Serial Inkjet Board (High Baud, Busy Line, Etc) + "Enha — Parallax Forums

Revised SX/B Driver for Serial Inkjet Board (High Baud, Busy Line, Etc) + "Enha

ZootZoot Posts: 2,227
edited 2008-03-15 08:49 in Robotics
This isn't so much a completed projected as completed code. I've made a few small alterations to the SX/B driver for the Parallax Serial Inkjet Board. SX/B file attached along with demo BS2 program using the various features.

See below for details, but here is a quick rundown of the added features:

- selectable baud rate set via host serial command (9600 or 38k4)

- "addressable" serial header so that the Inkjet Board can share an open-true serial line with other addressable serial devices

- selectable mode set via host serial command -- instead of a "prompt" at ready, the board will hold the open-true serial line LOW to indicate "busy: printing"

Also attached in the .zip are two BS2 programs for downloading my version of the "enhanced" font from Gilliland's book. This font is bold and uses the full width and height of the nozzle bitmap. It needs to be downloaded in two chunks. If you are NOT using my revised driver, just be sure to adjust the SEROUT and SERIN commands in the BS2 files to match your driver. I download this font to chars $80-$FF in EEPROM; this lets me print either regular or bold by setting or clearing BIT7 of any character sent. The revised BS2 load font program makes it pretty easy to map chars to where you want, however. Note also that I have not created special dingbat characters for the first 32 char positions; I just haven't had the time. See attached photos for comparison of standard font and my bolder font and a sample of just the bolder font (sorry, the photos are a bit junky and were taken before I cleaned my print heads).

A few notes and observations:

- both boards that I received from Parallax include a "standard" font mapped to chars $00-$7F. Contrary to a remark in the *book*, there is no additional font on the board's EEPROM -- indeed, $80-$FF are blank (all zeros). I tested this by printing chars $00-$FF. Chars 0-32 (dec) are a number of cool "special" characters: dingbats and the like.

- both the installed and my revised version have a 64-byte character buffer. Note that Parallax's posted driver AND the driver pre-installed on recent boards has a 64 byte buffer, BUT the comments at the beginning of Parallax's driver code say the code has a 32-byte buffer. The comments are incorrect. The code is correct smile.gif

- my revised driver comments out the LED utilities -- this is not a feature I use and I was happier turning this off so I never need worry about accidentally frying a print head.

- if you use my revised driver, be sure to READ and SAVE HEX FILE from the SX on the board -- this will give you an actual copy of the driver on your board that can be reloaded. The SX on the board is NOT fuse protected from copying.

'
' Simple driver for HP5160x Inkjet cartridges. 
' The module will output a ">" when it is ready
' to accept data on the USB line; when using TTL serial with a host,
' the serial line will be pulled LOW when the unit is busy, and will be
' released to high when it is ready
'
' serial data must be prefaced with "!IJ"
'
' "!IJC", Byte
'   -- sets the inter-column delay
'   -- units are in 0.1 milliseconds
'   -- range is 1 to 255 (0.1 ms to 25.5 ms)
'
' "!IJN", ASCII code byte, 24 bytes
'   -- use to download new 12x12 character map for "ASCII_Code"
'   -- returns prompt after byte has been loaded
'   -- refer to HP-CharMap.PDF for map definition
'
' "!IJV"
'   -- use to read back version number
'   -- SX will transmit hex BCD (not ascii) version #
'
' "!IJM" -- set Mode(s)/Baud 
'       -- CHANGES TTL SERIAL (SerIO) ONLY, USB WILL ALWAYS BE OT9600
'       -- SX will expect 1 more command byte:
'   high nib (bits 4..7):
'     bit7: 0 = leave baud alone;
'           1 = change baud based on bits 4-6
'     bits4-6: baud mode setting...
'       %000 = 0 = 2400 baud ' unimplemented -- results in 9600
'       %001 = 1 = 4800 baud ' unimplemented -- results in 9600
'       %010 = 2 = 9600 baud '(default baud on powerup/reset)
'       %011 = 3 = 19K2 baud ' unimplemented -- results in 9600
'       %100 = 4 = 38K4 baud
'   low nib (bits 3..0):
'     bit3: 0 = leave mode alone;
'           1 = change mode based on bits 2..0
'     bits2-0: mode settings...
'       %000 - %110 = normal mode
'       %111 = 7    = Sio pin will be held low as "busy" signal during printing
'
' "!IJ", STX, bytes, ETX
'   -- send <= 64 byte ASCII string to print


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php


Post Edited (Zoot) : 10/4/2008 3:49:43 PM GMT

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-03-09 13:46
    Great stuff. I've got to stop procrastinationg and get my ink jet board up and running.

    And Parrallax should get out some text errata for all the newbies. Regarding the board, the book runs you down a few blind alleys.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • ZootZoot Posts: 2,227
    edited 2008-03-09 18:38
    Kramer said...
    And Parrallax should get out some text errata for all the newbies.

    Well, I don't the book will/can be re-printed; it's end-of-life anyway, I think. The "official" posted documentation for the board is correct for wiring, buffer size, etc. and makes no mention of chars above $80 anyway. I'm guessing the printed copies of the book pre-date the current installed SX/B driver and board by a few revisions at least.

    Keep in mind, too, that the onboard EEPROM is 64kbit, so at 12 Words per char you get 256 chars precisely anyway, because the driver writes to 16 Word (32 byte) EEPROM pages (8 x 32 x 256 = 65536 bits). So it's actually impossible to have the full "utility" font *and* the 128 char "enhanced" font in EEPROM using the page-write schema. I debated rewriting the EEPROM write routines to use only 24 bytes per char, which would free up space for a partial third typeface of glyphs, dingbats, shapes and the like, but since the upper half of the map was blank for a second font w/o change, it worked out, and I moved on smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-03-11 14:26
    Zoot,
    I found the book made things harder for me. I had to double check and reverse engineer rather than jump in and go. At the time, SX/B was very new and being revised nearly weekly too.

    Sorry to here it is at the end-of-life as I thing it just had a difficult beginning.

    The book will linger around for years and so will the boards [noparse][[/noparse]in fact it is a great general purpose board if you ever get tired of the Ink Jet]. Errata is usually a one page listing of all the inaccuracies and corrections. You just put it in the front of the Table of Contents as a loose page to call attention to it. Having it on the web will make questions quicker and easier.

    In any event, I am beginning my own notes inside the front cover. Maybe, I'll have enough to post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • ZootZoot Posts: 2,227
    edited 2008-03-12 05:17
    It's an interesting book though, esp. for the theory side of things. I do not believe the Serial Inkjet Board is end-of-life, just the full kit (with the board, book, cartridge and cartridge holder) -- I'm pretty sure Parallax is still selling the board. The ribbon cable is not hard to come by, so it would just be question of rigging the board up to a print head. I may pick up another one at some point and try to hook it up to some of the many old inkjet guts I've got lying around here.... at that point the theory covered in the book could be very handy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-03-15 08:49
    February 'Nuts and Volts' has a cover article on Ponganator's Ping-Pong ball printer. Very amazing.... So interest may suddenly revive.

    With all the darlington drivers, the board might adapt drive other devices - like the tiny stepper motors in 3.5" floppy drives or an array of ultra bright LEDs. It seems like a good special effects controller.

    I suspect that HP buys the boards as an OEM product and resells them for big company production lines that have to date code product. There are lots of soda cans, cereal boxes, and such that look like they have been tagged with such. I'm pretty sure that what you cannot get from Parallax, you will be able to buy from HP for a long time to come.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.