(Rescuing this page from the spam-ridden pbworks Microprinter wiki)
Notes and settings I used to get this printer to work and accept input. The main problem with this printer is the low baud rate (9600) for the connection. This is fine for text, but when you are pushing bytes down the line to print images, it is painfully slow.
Datasheet – get it here
Wikibooks page on the RS 232 connection (contains details on the pinout of the 25 pin serial connector, as well as details of how to short circuit certain connectors)
Settings: (YMMV)
Dip switch settings (1 – on, 0 – off)
DS1 – 10110011
DS2 – 0000000000
DS3 – 0000
DS4 – 0100
Which leads to the following diagnostic: (Hold down the feed button as you turn on the printer to get a printout containing the diagnostics)
58mm paper – (important – if you are using 80mm wide paper instead, you need to flip DS1, switch 3 to OFF!)
Baud rate: 9600 bps
Data bit: 8 bit
Parity: None
Handshake: DTR/DSR
Buffer size: 4k
Pinout wiring (using a MAX232N chip to interface with an arduino – pins refer to printer serial pins unless otherwise mentioned)
(See the serial page linked to above for a description of how the pinout is numbered)
Pins 4 & 5 on the printer (RTS&CTS) were simply connected together
Pins 8 & 20 (DCD & DCR) were also connected together (even though the datasheet suggests 8 isn’t used)
Pin 7 was connected to ground
Pin 2 (TX) was connected directly to pin 8 on the MAX232 N (R2in)
Pin 3 (RX) was connected directly to pin 7 on the MAX232 N (T2out)
Used the following circuit: (MAX232IN chip with 1µF electrolytic capacitors)
Arduino connections:
Roo Reynolds’s arduino sketch from github – this .pde file was able to be used unchanged to control the printer.
The rxPin of the arduino was connected to pin 9 on the MAX232N chip. The arduino txPin was connected to pin 10 on the MAX232N.
[Weirdly, I found that the circuit and connection worked both at 5v and at 3.3v, both as supplied by the arduino.]
Hopefully this should help people get started. Feel free to rejig and add to this page for others.
Python code to control the microprinter and also to print images to it – (requires python’s PIL)
Alexander Berndt
September 26, 2012
I have the CBM1000, it’s connected to a serial to USB converter to my RaspberryPi. dmesg shows:
[ 1151.836076] usb 1-1.3: new full speed USB device number 5 using dwc_otg
[ 1151.936656] usb 1-1.3: device descriptor read/all, error -32
[ 1152.016208] usb 1-1.3: new full speed USB device number 6 using dwc_otg
[ 1152.118989] usb 1-1.3: New USB device found, idVendor=067b, idProduct=2303
[ 1152.119025] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1152.119044] usb 1-1.3: Product: USB 2.0 To COM Device
[ 1152.119060] usb 1-1.3: Manufacturer: Prolific Technology Inc.
[ 1152.124144] pl2303 1-1.3:1.0: pl2303 converter detected
[ 1152.129267] usb 1-1.3: pl2303 converter now attached to ttyUSB0
And my script is as follows:
from microprinter import Microprinter
m = Microprinter(“/dev/ttyUSB0″,”CBM1000”)
m.resetState()
m.write(“Foo….\n\n Bar…\n”)
m.feed(5)
m.cut()
However nothing happens when run, any ideas?
benosteen
September 26, 2012
One thing you didn’t explicitly mention is if you are doing the level conversion between the two “serial” interfaces. The common USB serial adapters are of the 5v TTL type and the CBM1000 uses a RS232 type (~7.5v). Typically you’d need the MAX3232 chip to do a conversion, unless your adapter is actually an RS232 adapter.
Secondly, make sure the baudrate of the CBM1000 is set to the the baud rate in the code, which IIRC in the default code is the lower of the two options, 9600. You can change this to the higher one, by changing line 146 in to be the other option, 19200.
Alexander Berndt
September 26, 2012
Thanks, I’ve no idea of my adapter converts the voltages, it’s just a cheap one off eBay http://goo.gl/xpBNr so perhaps I do need that chip.
Secondly I do have the printer set to 9600 as I have followed the DIP pin guides and printed out to verify it had been set correctly.
benosteen
September 27, 2012
That might already do the level conversion. Another thing to think about is the other wiring on the 25pin serial port on the printer itself – eg connecting 4&5 and 8&20, connecting 7 to ground – is it possible that those aren’t quite right?
Otherwise, do you have another serial device to try to talk to?
(Oh and if you turn on the printer with the feed button pressed down, it should spew out a diagnostic. Handy to check that it is happy, healthy and thinks it can print.)