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....
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
};
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