Serial/parallel printer

I would appreciate any help to get me started with my project.

The CGP-115 printer I am trying to use with an 18x has two inputs, parallel and serial.
The parallel interface is 8 bit and uses Busy handshaking, Strobe, and Acknowledge.
The serial interface is RS-232-C using Data and Busy, 600 baud, 7-bit character, no parity, 2 stop bits.

My problem is that I don't really understand what is required for the 18x to send data to this printer. Am I trying to do something that is not possible with the Picaxe? I have to read previous postings on this forum but am still unclear as to how to proceed.
 

MPep

Senior Member
For serial, you will not have much luck. The 18X (and the majority of PICAXE types) use only 8 data bits, No parity, and 1 Stop bit.

Parallel, never done it. Should be possible though. 8 data lines out, and extra lines for the handshaking. You will need to read up on parallel port addressing etc.
 

hippy

Ex-Staff (retired)
The serial interface is RS-232-C using Data and Busy, 600 baud, 7-bit character, no parity, 2 stop bits.
That should work with an 18X. As 7-bit, no parity, 2 stop bits consists of 7-bit data followed by two idle bits, PICAXE sends 8-bits, no parity, 1-stop bit ( 8-data then one idle bit ) as long as the last bit of data is forced to the idle state it will look the same.

For b1 = "A" to "Z"
b1 = b0 | $80
SerOut pin, N600, (b1)
Pause 50
Next

You may have to wire the serial in connector for the printer ( CTS, RTS, DTR and DCD ) so the printer sees something as connected.
 

westaust55

Moderator
In view of the 7-bit serial comms. I think that a form of parallel interface will be the simpler route to take.
The parallel connection is seemingly 5Vdc

You can use a 74HC595 serial in – parallel out shift register to get the data available for the printer.

Your program also needs to check, with an input pin, the Busy line from the printer before sending a character, and once the data is set up in the 74HC595 then use a PICAXE output pin to create a strobe (pulse) to the printer so the printer will read the character data into the printer.

Think you will be able to ignore the acknowledge signal from the printer.

From the radio Shack website:
http://support.radioshack.com/support_accessories/5632.htm

36 Pin Centronics
Parallel Pinouts

1 Strobe . . . 13 NC
2 Data 0 . . . 14 Gnd
3 Data 1 . . . 15 NC
4 Data 2 . . . 16 NC
5 Data 3 . . . 17 Gnd
6 Data 4 . . . 18 5V, 80 mA
7 Data 5 . . . 19-30 Gnd
8 Data 6 . . . 31 NC
9 Data 7 . . . 32 NC
10 Ack* . . . 33 GND
11 Busy . . . 34 NC
12 GND . . . 35 and 36 NC
 

westaust55

Moderator
as hippy has suggested a scheme to handle the 7-bit and 2 stop bit requirements,
you may also likely to require a MAX232 type chip for the correct RS232 signal levels to the printer.

Some old printers could accept 0 to +5V or 0 to +12V
however, others did need a negative for -5 to +5V or -12V to +12V
for the serial comms
You might ened to do some further research on the internet yourself to clearly identify what RS232 levels can be accepted/requried.
 
Yes John I am aware that it is difficult to get pens for the printer/plotter. Thanks for the link to a source of pens but at that price I'll not be buying any. I have in the past refilled the pens by carefully removing the plastic insert containing the fibre tip and recharging the ink store.

This printer is ideal for my application and I'd really like to interface with a picaxe because I think I might be able to write the code for my project. I have an idea for a non-ink based writing system if I manage to get this started.

John
 

Texy

Senior Member
Hey that printer is a blast from the past- I,m sure I had one of those with my BBC Micro? Or was it my Amiga 1200?

Texy
 

Rickharris

Senior Member
Pens for pen plotters can often be manufactured via an adapter machined to take a ball roller pen refill - This works if the pen holder has an open top to allow the longer refill to fit through.
 

eclectic

Moderator
Hey that printer is a blast from the past- I,m sure I had one of those with my BBC Micro? Or was it my Amiga 1200?

Texy
Possibly try

Atari 1020
Commodore 1520
Mattel (Aquarius)

and ALPS

I think they all had the same "engines"
as the Tandy / Radio-Shack?
e
 
The pens used in the CGP-115 are about 20mm long and about 5mm dia. They clip 4 at a time into a rotating head assembly that could be turned to one of four positions to place a different colour pen in the printing position.
 

westaust55

Moderator
I had one of the Commodore 1520 plotters back in the early 80's.
As well as plotting, also inbuilt was the character set to do text printing (in 4 sizes from memory).

as eclectic say, all the same "engine" under the cover just the comms front end modified by the manufacturer to suit the label (Commodore/Tandy/etc).
 
Hippy,
I thought I would just sit down with the Picaxe manual and understand your suggestion

For b1 = "A" to "Z"
b1 = b0 | $80
SerOut pin, N600, (b1)
Pause 50
Next

The problem is, I can't find out the meaning of the symbol | in the second line.
I believe I have heard it called 'pipe' but more than that I don't know. I'd apreciate it if you would expand on this for me please.

John
 

eclectic

Moderator
Hippy,
I thought I would just sit down with the Picaxe manual and understand your suggestion

For b1 = "A" to "Z"
b1 = b0 | $80
SerOut pin, N600, (b1)
Pause 50
Next

The problem is, I can't find out the meaning of the symbol | in the second line.
I believe I have heard it called 'pipe' but more than that I don't know. I'd apreciate it if you would expand on this for me please.

John
Until Hippy returns, please look at

Manual 2, page 20

Bitwise OR |

e
 

boriz

Senior Member
Could this plotter draw circuit tracks directly onto copper clad board using etch resist pen? Then swap 'pens' to a 5mm wide drill assembly and drill all the holes too?

That would be cool.
 

BCJKiwi

Senior Member
If it was up to the task of drilling then maybe it could route out the tracks and bypass the draw and etch altogether!
 

papaof2

Senior Member
I gather that very few here have seen the CGP115 (or the various other versions from Commodore, Citizen, etc). It uses tiny pens (smaller than a cigarette) and prints on an adding-machine-style roll of paper.

If you want serious pen plotter capability, you're looking at the 8.5x11 format HP in my garage or the 11x17 format HP in my basement. Both of these have the 6 pen carousel; move the paper in one direction (i.e., Y) and the pen in the other direction (i.e., X). There is a Japanese sign "plotter" (cutter for plastic film signs) whose cutters are 1mm smaller than the pens used in the HP. These cutters might be adaptable to making masks for etching circuit boards. Maybe a project for the winter....

John
 
I have been trying to work through Hippy's suggestion

For b1 = "A" to "Z"
b1 = b0 | $80
SerOut pin, N600, (b1)
Pause 50
Next

using the Programming Editor but have not been able to see activity on the nominated serout pin. Can the editor show this kind of activity?

How often is there the need to send 'stop bits'? Are these sent after every asci character so the printer knows the character data has finished or can they be sent after say a string of asci characters?

Does $80 represent a stop bit?

Sorry about all the questions but as you can see I'm a bit lost!
 

hippy

Ex-Staff (retired)
The | $80 sets the msb ...

"A" = $42 = %01000010
"A" | $80 = $C2 = %11000010

That's sent, for Nxxxx baud rates, with a leading start bit (S=1), a trailing stop bit (P=0), 8 data bits sent lsb first and inverted ...

S01234567P = 1101111000 = --_----___

By setting the msb to 1, as it's sent last, the output is the same as idle level (0), so 7 data + 2 stop = 8 data ( with msb set ) + 1 stop. Yes, stop bits go after every character.

The Programming Editor should show the activity on the pin if you conect to it, so too should a LED+R between the pin and 0V.
 

Mycroft2152

Senior Member
I gather that very few here have seen the CGP115 (or the various other versions from Commodore, Citizen, etc). It uses tiny pens (smaller than a cigarette) and prints on an adding-machine-style roll of paper.

If you want serious pen plotter capability, you're looking at the 8.5x11 format HP in my garage or the 11x17 format HP in my basement. Both of these have the 6 pen carousel; move the paper in one direction (i.e., Y) and the pen in the other direction (i.e., X). There is a Japanese sign "plotter" (cutter for plastic film signs) whose cutters are 1mm smaller than the pens used in the HP. These cutters might be adaptable to making masks for etching circuit boards. Maybe a project for the winter....

John
Pof2,

Take a look at some of the scrapbooking cutters. They are basically a inkjet printer mechanism with a swivel knife.

I bought a "Silhouette" last Christmas for about $120 US including software. It is a light duty machine. There are some heavier duty machines that will cut chip board that can cost up to $1400.

Don"t buy the Cricut, as it uses font cartridges ($60 a piece) rather than pc software.

It is a lot of fun, I am working on cutting smt stencils now.

I wish I had one when the kids were younger, it would have been a great help in some of their school projects.

Myc
 
Thanks Hippy, I'll persevere.
I nominated pin 7 as the serout pin but didn't see any activity on the pin 7 window of the simulation panel.

The simulation window didn't work because I had used N600 instead of T600

John
 
Last edited:

eclectic

Moderator
Thanks Hippy, I'll persevere.
I nominated pin 7 as the serout pin but didn't see any activity on the pin 7 window of the simulation panel.

The simulation window didn't work because I had used N600 instead of T600

John
John, has there been a typo?

Could you try this program please?

Code:
#picaxe 18x

For b1 = "A" to "Z"
b0 = b1 | $80
SerOut 7, n600, (b0)
; sertxd (#b0," ") ; used for testing
Pause 500  ; then alter to 50
Next
e
 
Yes thanks eclectric and hippy, sorry I forgot to mention that I had found the typo.
That, together with me using n600 instead of t600 and wondering why there appeared to be no output showing in the simulator had me puzzled.

John
 
E, I ran your programme on the simulator and the LCD display appeared looking rather like Japanese characters. I guess this means that serout was operating as expected.

As soon as I can I'll hook up the printer and try to find out the RS232 requirements.

John
 

hippy

Ex-Staff (retired)
Because the msb of the bytes sent is set, when read as 8-bit, it's causing them to be displayed as weird characters.
 
This is to say a big thank you to all who have helped me with connecting to this printer/plotter. I have got the picaxe to talk to the printer and actually print characters!!!
I used the MAX232 TTL to RS232 chip and there was no need for any handshaking.

Spent quite some time today scratching around trying to determine why there was no printed output despite the printer making its usual rattling noise. As I have a couple of these printers I tried the other one and then characters appeared. The first printer was not pressing the pen against the paper hence no printing. Mending it is a job for another day.

John
 

westaust55

Moderator
Great to read that you have your PICAXE and printer talking.
It would be good to post your schematic and the code you are using so that others can reference same if they tackle a similar project.
 
Great to read that you have your PICAXE and printer talking.
It would be good to post your schematic and the code you are using so that others can reference same if they tackle a similar project.
Hippy's code for sending 2 stop bits was the answer:-
For b0 = "A" to "Z"
b1 = b0 | $80
SerOut pin, N600, (b1)
Pause 50
Next

The printer did not need any handshaking just normal RS232 voltage levels to the serial input.
I have not tried the parallel input. The pause value is subject to adjustment to see just how small a delay is needed before the printer can not keep up. I am using something like pause 5000 I think from memory.

John
 
Top