thermal mini printer

Status
Not open for further replies.
check max 232 IC and serial cable. do a loop back test and confirm... check the baudrate in hyperterminal. even if it does not work try replacing the max IC or change tx and rx pin of the cable on one end....
 

does the hyperterminal differ for pic or everything is same
 

hyperterminal is same for any application using serial communication... As i said check the port number . cable connevtivity ( pin 2,3,5) and baud rate of the terminal and program.....
 

hi..........the above code is working in simulator mode perfectly..........the data is perfectly sent to portd but wen i m trying to send the data to txreg only 2 characters l and a of label are displayed the rest characters are not displayed and only two characters of names i.e n and a are displayed.....can u pls help me can u tel me wats the error.................
 

hi my code is working in simulator mode i had to give a delay...........thanks...........but its not displaying in hyperterminal should i make some settings in hyperterminal ..........
 

hi......the circuit shown below is to give input to portB.if we press sw1 the label is printed and so on....i wanted to no if the circuit is correct and i wanted to no y 10k resistor is connected to switches and 1k resistor is connected to LED...pls help us soon

---------- Post added at 13:50 ---------- Previous post was at 13:49 ----------



---------- Post added at 13:52 ---------- Previous post was at 13:50 ----------

#include<htc.h>
#define MYSW1 PORTBbits.RB5
#define MYSW2 PORTBbits.RB6
#define MYSW3 PORTBbits.RB7
void SerTx(unsigned char);
int i;
void main()
{

unsigned char z;
unsigned char mess1[]="label";
unsigned char mess2[]="Barcode";
unsigned char mess3[]="Tocken";
TRISD=0X00;
PORTD=0X00;
TRISBbits.TRISB5=1;
TRISBbits.TRISB6=1;
TRISBbits.TRISB7=1;
TXSTA=0x26;
TXREG=0x00;
SPBRG=15;
INTCONbits.GIE=1;
INTCONbits.PEIE=1;
TXSTAbits.TXEN=1;
RCSTAbits.SPEN=1;
if(MYSW1==0)
{

for(z=0;z<5;z++)
{
PIE1bits.TXIE=0;
while(PIR1bits.TXIF==0);
PORTD=mess1[z];
TXREG=PORTD;

for(i=0;i<999;i++);

}

PORTD=0X00;
RCSTAbits.SPEN=1;

while(1)
{
SerTx('n');
SerTx('a');
SerTx('m');
SerTx('e');
PORTD=0x00;
SerTx('c');
SerTx('l');
SerTx('a');
SerTx('s');
SerTx('s');
PORTD=0x00;
SerTx('c');
SerTx('o');
SerTx('l');
SerTx('l');
SerTx('e');
SerTx('g');
SerTx('e');
PORTD=0x00;
}
}

else if(MYSW2==0)
{
if (PIR1bits.TXIF==0)
return;
TXSTA=TXSTA|0x4;
for(z=0;z<7;z++)
{

PORTD=mess2[z];
TXREG=PORTD;
}
while(1)
{
SerTx('c');
SerTx('o');
SerTx('d');
SerTx('e');
SerTx('3');
SerTx('2');
SerTx('3');
}
}
else
{
TXSTA=TXSTA|0x4;
if (PIR1bits.TXIF==0)
return;
for(z=0;z<6;z++)
{

PORTD=mess3[z];
TXREG=PORTD;
}
while(1)
{
SerTx('R');
SerTx('s');
SerTx('3');
SerTx('0');
}
}
while(1);
}
void SerTx(unsigned char c)

{

while(PIR1bits.TXIF==0);
PORTD=c;
TXREG=PORTD;
for(i=0;i<999;i++);
}

---------- Post added at 13:53 ---------- Previous post was at 13:52 ----------

can anyone tel me how will be the output of this program..............pls help us soon
 

yes i wrote the code....... its working perfectly in simulator one character after the other........
but i want it to be like label
name
class
college

will it print like this or label
n
a
m
e

dont no how to c the output
 

hi.......... i constructed the hardware .......its printing some junk value like v||etghcvbb wen i press the sw instead of label name etc can u tel me wat can be the error ...........wat do i hav to check.........

---------- Post added at 22:48 ---------- Previous post was at 22:48 ----------

pls do reply......

consider this as last warning against using short forms or sms kind of typing words ...

next time if it is repeated then all your posts will be deleted......
 
Last edited by a moderator:

should i increase the delay..........
 

hi..........the baud rate of the printer is 9600 .........i have not set the BRGH bit ...........is it better to use high speed or low.........if i use high speed the SPBRG=71........is it fine please reply soon
 

can u pls tel me what is wrong n how to correct.........the printer is printing all the the things dat is in the char in simulator ........please someone help soon........it is not printing only what is there in TXREG it is printing all d char dat s der in STATUS PCL FSR......... What to b done.pls reply soon


 

From the time you started the thread you are always in a hurry to do this and finish it........ think you dont read the thread posted by others nor appreciate the effort put by everyone for you.... you seem to be in your own world of finishing the project without understanding it.....

i tell you to connect the pic board to hyperterminal and read the characters...... you dont post screen shot of what we request you......

one suggestion is ..... dont print the data directly from serial port register.... store the data you read from hyperterminal and try to print.......
 

i m really sorry for it i have very little time to do the project so i have to hurry.............as i told earlier that nothing is displaying on hyper terminal though i tried many times..........
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…