Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:41 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maximite printer interface

Author Message
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 10:24am 14 Mar 2013
Copy link to clipboard 
Print this post

I was cleaning out my work area and up on one of the shelves was a Panasonic printer. So just for fun, I made a printer interface for the CGCOLORMAX2. Wiring only took a few minutes, as did writing the code.

Here is the hardware:



Here is the prntfile.bas code:



printerinit

IF MM.CMDLINE$ = "" THEN
INPUT "Filename: ",filename$
ELSE
filename$ = MM.CMDLINE$
ENDIF

OPEN filename$ For input As #1


' Read the file
DO
printchar(INPUT$( 1, #1 ))
LOOP UNTIL EOF(#1)

CLOSE #1



SUB printchar(character$)

PORT(21, 8) = ASC(character$)
PIN(29) = 0
PAUSE(50)
PIN(29) = 1
PAUSE(50)

END SUB

SUB printerinit

SETPIN 21, 9
SETPIN 22, 9
SETPIN 23, 9
SETPIN 24, 9
SETPIN 25, 9
SETPIN 26, 9
SETPIN 27, 9
SETPIN 28, 9

SETPIN 29, 9

PORT(21, 8) = 0
PIN(29) = 1

END SUB



Here is the text file:



Hello World!

This is a printer test.

CircuitGizmos





Here is the result:



Ah, to hear dot-matrix again!

Edited by CircuitGizmos 2013-03-15
Micromites and Maximites! - Beginning Maximite
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 02:19pm 14 Mar 2013
Copy link to clipboard 
Print this post

Excellent stuff, CG!!!!


I was wanting to add a printer interface to my latest security system idea(as well as logging to the SD card), so might have to steal this...

I will do some tests, but as it seems so easy to get it working, it is a strong possibility that it will be included in the code. Naturally, you will be credited in the code should I do this.

Dot-matrix printers still have their uses.
Smoke makes things work. When the smoke gets out, it stops!
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 03:40pm 14 Mar 2013
Copy link to clipboard 
Print this post

Thanks, Grogster!
Micromites and Maximites! - Beginning Maximite
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 03:55pm 14 Mar 2013
Copy link to clipboard 
Print this post

Still are a few Dotmatrix printers being made and sold with centronic interfaces
So great on making the maximite printer interface/code
Edited by djuqa 2013-03-16
VK4MU MicroController Units

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 04:25pm 14 Mar 2013
Copy link to clipboard 
Print this post

Can you please post the circuit?

I see you have a yellow thing soldered to the LPT plug - I am guessing this is a resistor network in the area of 10k or so as pull-ups on the data lines?
Smoke makes things work. When the smoke gets out, it stops!
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 05:49pm 14 Mar 2013
Copy link to clipboard 
Print this post

If any one is interested, I did up an i2c module (picF88) that outputs an 8 bit ascii byte with a strobe pin - runs with dot matrix parallel printers.
David M.
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 10:25pm 14 Mar 2013
Copy link to clipboard 
Print this post

  CircuitGizmos said  
SUB printerinit

SETPIN 21, 9
SETPIN 22, 9
SETPIN 23, 9
SETPIN 24, 9
SETPIN 25, 9
SETPIN 26, 9
SETPIN 27, 9
SETPIN 28, 9

SETPIN 29, 9



Hi Rob,

Just curious, Why did you use Open Collector outputs? If you set as digital outputs (x,8) you may be able to do away with the Resistor pack...

Or is it to do with the +5V printer input and the respack is pulled to +5V to provide a solid High? I suspect this is the case. I think +5 is present on pin 36 of the centronics plug anyway...

Good work Rob,

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 03:28am 15 Mar 2013
Copy link to clipboard 
Print this post

  Grogster said   Can you please post the circuit?
I see you have a yellow thing soldered to the LPT plug - I am guessing this is a resistor network in the area of 10k or so as pull-ups on the data lines?


Yes. That is a 10k resistor pack. Pulls pins 1-9 on the 25-pin connector up to 5V. Pin 1 is the printer data valid line - when pulsed low the printer accepts the ASCII data value on pins 2-9.

  bigmik said  
  CircuitGizmos said  
SUB printerinit

SETPIN 21, 9
SETPIN 22, 9
SETPIN 23, 9
SETPIN 24, 9
SETPIN 25, 9
SETPIN 26, 9
SETPIN 27, 9
SETPIN 28, 9

SETPIN 29, 9



Hi Rob,

Just curious, Why did you use Open Collector outputs? If you set as digital outputs (x,8) you may be able to do away with the Resistor pack...

Or is it to do with the +5V printer input and the respack is pulled to +5V to provide a solid High? I suspect this is the case. I think +5 is present on pin 36 of the centronics plug anyway...

Good work Rob,

Regards,

Mick


I used 5V logic to be sure that it would work with this printer. Centronics +5V isn't supposed to be used for anything, according to the printer manual.

This is just an example "how-to" I did mainly because I had the printer. I'm not defining any particular pins as Maximite printer interface pins. The printer interface has more than just the 8 data and one signal line - I made this as minimum as possible. There is, for instance, a 'ready' line that would be used to let the Maximite know that the printer is ready for more data.


Micromites and Maximites! - Beginning Maximite
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024