Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Thermal printer using ATMEGA8 and Code vision for AVR

Status
Not open for further replies.

djc

Advanced Member level 1
Advanced Member level 1
Joined
Jan 27, 2013
Messages
402
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
India
Activity points
4,554
Hi,

I have successfully interfaced thermal printer Maxim pn-64 with Atmega8 and code vision for AVR. I can print the data using putchar() and puts() function provided with codevision. Now i want to change the font size. Double width and double height.For this command given is 'ESC ! n'. Hexadecimal value for ESC is 1B, for ! is 21 but what about 'n'. What is 'n' and how to send hex value for 'n' or for that matter whole 'ESC ! n' sequence using putchar() or puts() function. Please guide.
 

Kindly attache the application note for the printer, you can see the command for font size, from your state I guess n is the font size number.. to see the value refer the note or attach here to refer that....
 

View attachment thermal-panel-printer.pdfView attachment thermal-panel-printer.pdf

changing value of n, helping a little in increasing height and little bit width. But not satisfactory level. Here is the code
Code:
while (1)
      {
      // Place your code here
      delay_ms(1000);    
     // putchar(0x0d);        //Hex code for enter
      putchar(0x1b);          //Hex code for ESC
      putchar(0x21);          //Hex code for !
      putchar(0x36);          //Value of n
      //putchar(0x1b);
      //putchar(0x0e);                                   
      //puts(0x1b0x210x6e);
      puts(s);                     //s is an array of string         
      };
 

    V

    Points: 2
    Helpful Answer Positive Rating
you can try 0x30 or 0x31 as it is mentioned that double width and height... you printer supports only Normal, Double Width, Double Height & Quadruple Sizes, no other size can be selected... this is the drawback in thermal printer or line printer
with bit4 and 5 high you can choose the maximum size

Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
0 0-upright 0- Single width 0- Single height 0 0 0 0 - 29 Cols
0 1-inverse 1- Double width 1- Double height 0 0 0 1 - 42 Cols
 

Thanx kanni,

30 or 31 for what? for ESC or ! or n. Because as I have mentioned in my code, i am sending all the three values separately using putchar() function.
 

It is for n

30 for 29 characters per line and 31 for 42 characters per line.... you may choose this depending upon your requirements

so the value will be
1B 21 30 -- for 29 C/L
1B 21 31 -- for 42 C/L
 

Means the sequence and the method by which i am sending the data is correct, is it right.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top