CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC CCS thermal printer development program MP105 - APS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
supermarkao236



Joined: 05 Jan 2020
Posts: 3

View user's profile Send private message

PIC CCS thermal printer development program MP105 - APS
PostPosted: Sun Jan 05, 2020 10:25 am     Reply with quote

I need help developing the control software for a MP105 thermal printer - APS

Would anyone have something like that?

Following is the printer datasheet:
http://www.cerne-tec.com.br/Datasheets/MP105_rev_b.pdf

The engine logic is done.

The printer control pins: (DATA, CLK, PLAT, STROBE)

THANKS
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Sun Jan 05, 2020 10:49 am     Reply with quote

You have a lot of work to do.
This is not a complete printer, just a mechanism.
To print anything, you have to work out the exact pattern of dots and
send these along the line, together with a clock pulse.
Then you need to operate the stepper motor to move forward.
You also need to read the thermistor sensor to know if you are driving too
hard.
You are going to need a font table, and code to rasterise the required text
into dot patterns. Then correct timing for the output of this, and then
operate the stepper.
It's a lot of work.
supermarkao236



Joined: 05 Jan 2020
Posts: 3

View user's profile Send private message

PostPosted: Sun Jan 05, 2020 11:44 am     Reply with quote

Thank you for your help.

I am aware that it takes a lot of work to figure out the printing points.

I would like someone to help you have a program as a starting point.

I appreciate the tips.
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 05, 2020 11:52 am     Reply with quote

As Mr. T says, a lot of work, BUT it can be done if broken down into 'stages'.
Consider that the printhead consists of 192 'pixels'. That would breakdown to 32 characters 6 pixels wide, making easy 5x7 font with a 1 pixel space between characters. Use 5x7 font with 1 pixel spacing between lines.
Look at almost any LCD module datasheet for bit patterns to create the font table.
Your best friends in this project are 1/4 square graph papaer and a pencil ! Use them to see HOW the characters are created, how a line of text is done. Much of the 'math' can be figured out this way BEFORE actually powering up the printer.The actual control of 'print a line of dots, advance paper' would be the next stage.
This IS the way I did it 3 decades ago with 'simple, cheap' mechanical print mechanisms....though cut in Assembler, the process is the same, start small, build upon sucesses....
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Sun Jan 05, 2020 12:12 pm     Reply with quote

Basically the graphic LCD driver shows the steps to convert a character
into 'points'.
Start with just a basic 'line' stored in memory, and generate the code
to write this to the printer line, and the code to operate the stepper.
Ideally use a bipolar stepper driver chip that allows the current to be
controlled and has options to maintain drive when not stepping, but reduce
this current to a low figure.
Be aware of just how serious the supply requirements are 3.8A if you
print a solid line. 340mA for the stepper (which is an inductive load), so
even if you turn the current down to just 20% when not moving, you need a 4A supply.
Once you have the line being printed, then use the LCD graphic code
to generate the lines being needed.
If you want to draw graphics, you will need to think what you actually
'need'. So (for instance), if you wanted a 'line' algorithm that allowed
XOR when a line crossed, you would have to have a PIC that had
enough RAM to hold a significant lump of the image. However restrict
the pen to 'set only' operation, and instead it can be done on a line by
line basis without needing a buffer like this.
Now you have to read the thermistor, and if the head starts to get too
hot, slow down the print rate.
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 06, 2020 9:37 am     Reply with quote

The 'scary' part of this project is the lack of documentation ! I looked online for an hour,sure lots are selling it, but no 'how-to' details.
I understand there's 192 'dots' on the printhead BUT is it LSP or MSP order ?
Do you clock the pixels in left to right or right to left ? I'd assume left to right BUT would need to cut code to test.
The mechanical printers I used were right to left,presumably faster for applications like adding machines.....

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Mon Jan 06, 2020 9:46 am     Reply with quote

Note 1, under the table giving printhead electrical characteristics.

First bit of data entered (Dot 1) is the first bit of data printed (FIFO),
left side of TPH, top view (gearing side of the printer).

The data is actually sent as three blocks of 64 bits with the different
STB line saying which block it is.
supermarkao236



Joined: 05 Jan 2020
Posts: 3

View user's profile Send private message

PostPosted: Mon Jan 06, 2020 3:14 pm     Reply with quote

Thank you for your help.

I am beginning to understand how the printing system works by your help.

I have the original card that printed the text sent via serial TX in 9600:
Code:

#include <18f4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,NODEBUG,NOCPD,PUT,NOWRT,BROWNOUT
#use delay(clock=4000000)
#use RS232(baud=9600, parity=N, bits=8, xmit=PIN_C6,rcv=PIN_C7,stream=RECEIVED)

Send to print the characters:
Code:

fprintf(RECEIVED,"----------------");
delay_ms(500);

The images below are of the oscilloscope on the DATA and STROBE pin sent to the printer:

https://ibb.co/HdfPsk7

https://ibb.co/PcPJFsD

Tks
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 06, 2020 5:01 pm     Reply with quote

You MUST have some kind of 'interface' or 'control' board between the PIC and the printer, as the original posting links to a 'basic' OEM style printer device.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group