??? 07/22/07 06:18 Read: times |
#142140 - first steps Responding to: ???'s previous message |
Hi Collin, I)As Richard says - get actual datasheet, read it twice, google for unknown terms/ideas. II) Make first firmware steps. You cant build whole circuit at start. Whole circuit depends of other blocks/functions included/needed in Your device. So - 1)You need prototype board for printer interface - input of board is connected to some microcontroller board (8..12 micro's ports will be enough), output connector is for printer mechanism. 2)Start with paper moving/motor driving. In case of stepper motor try different speeds. If Your target speed is 50 mm/sec ,try to get stable 25 mm/sec. At this stage of coding make procedures with parameter( speed), because You will need at least 2 speeds - one for printing and one for paper loading (usually slower). Maybe You will think some about accelerating from minimal to desired speed (stepper motor). It depends of micro's speed , but usually stepper motor driving is performed trough interrupt (timer). 3)Black lines. So You got paper driving. Its time to print. 3a) Strobe. Each strobe line "fires" some part of thermal head. Printhead can have 1,2,3... strobe lines. Most important at this stage is "STROBE" control , bad control - long strobe pulse- will damage thermal head. It is good idea to build monovibrator (with LM555 for example) - Your micro will start monovibrator, pulse width will be constant (variable trough potentiometer) - even if microcontroller dies in the middle of pulse. On other hand - thermal head have 2 or more STROBE inputs. So - some AND is needed - to combine monovibrator output with default strobe port(line). This is needed when strobe lines are not driven all in one time. For example - if Your power supply (for head dots) can deliver 2 Ampers and black horisontal line needs 3Ampers (all dots fired simultaneously ). You will need to separate line into 2 passes - fire STROBE_A+STROBE_B, wait pulse time , deactivate these strobes and then fire STROBE_C . Example assumes 3 strobe lines. So - strobes help to minimise power(not energy) consumption . Payment is speed and code compexity (this reflects motor control too) . Simplest way is to use strong enough power supply and all strobes fired simultaneously. Strobe line(s) must be fired after paper is moved at desired position. 3b)Latch. Think about head as two long registers. You shift data into serial shift register. At this (and every) moment parallel register and strobe lines are combining and producing fire signals to each thermal dot. When You send all dots, LATCH line driving causes content of serial regfister to be copied into parallel register. This must be done after strobe pulse is finished. 3c)data shifting. You can start with bit banging, but You will find this is very slow method. From desired speed calculate time for each thermal line. Divide by count of thermal dots. Now You can calculate bitbanging speed. Better idea is SPI. If Your micro do not have SPI, use UART mode 0 (x51 micro) - TX is clock, RX is data. 3d)Fonts. At start use font with fixed width - 8 points. Fonts with different width for each symbol are handled and printed more hardly, think about this later. 4)Return to motor control. Think about problems You encountered - paper jamming , motor overheating with long print and ..... 5)Now get one beer , sit down an think - how to build the best thermal printer. Best regards and good luck! |
Topic | Author | Date |
Driving a thermal printer Mechanism | 01/01/70 00:00 | |
Why would you \"presume\" that? | 01/01/70 00:00 | |
Try GOOGLEing for Thermal Printer | 01/01/70 00:00 | |
first steps | 01/01/70 00:00 | |
My experience | 01/01/70 00:00 | |
Epson Printer | 01/01/70 00:00 | |
What Epson printer? | 01/01/70 00:00 | |
If you really want "help" ...![]() | 01/01/70 00:00 | |
Thank you | 01/01/70 00:00 |