Interfacing a thermal printer with PIC

Re: Interfacing a thermal printer with PIC

Postby srlvrsn » Mon Sep 21, 2020 1:36 pm

Infact I tried what you said just after I posted the last post. I had this series of frames that were sent from a system to the printer earlier. I used that, A part of it looks like this
Code: Select all
EUSART1_Write("\0x1b@\0x1dP\0x00\0xfe\0x1bp0\0x96\0xfa\0x1b@\0x1dP\0x00\0xfe\0x1dv0\0x00H\0x00\0x1b\0x00\0x00\0x1bJ\0xff\0x1dV1");


I tried your snippet as well.
Code: Select all
EUSART1_Write("\0x1d\0x56\0x48");


In the above link, I was trying to give you the information of the serial device I use. That's all. I guess the problem lies in the device. But I couldn't figure it out.
Ela
srlvrsn
 
Posts: 7
Joined: Tue Sep 08, 2020 12:57 pm

Re: Interfacing a thermal printer with PIC

Postby AussieSusan » Tue Sep 22, 2020 3:33 am

Just a thought - does the printer expect RS232 voltages on the Rx line?
In a previous post, you have a link that shows an internal MAX3232 within the printer. That means it is expecting you to provide true RS232 voltages on your Tx line (the Rx pin on the printer) and also you need to accept the voltages that the printer will be sending back to you.
If you are connecting the PIC directly to the printer then that will NOT work.
Susan
AussieSusan
Verified identity
 
Posts: 133
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist

Re: Interfacing a thermal printer with PIC

Postby srlvrsn » Tue Sep 22, 2020 2:38 pm

What I did was. PIC RC6 -> PMOD232 RX pin (4) -> DB9 male that connects with the printer with DB9 male. MAX3232 is present in the PMODRS232 that converts the signals from PIC to DB9 and sends it to the printer. I checked them with the oscilloscope.

Without powering PMODRS232 (Just connected to the printer) - RX measured some ~2V TX few mV
With powering PMODRS232(5V) (Also connected to the printer) - RX measured some 2-3V TX 5V and RX few mV. It brings back to my question again. PMODRS232 has got CTS and RTS and as of now. I am not using them. the 3 wire connection in ((https://reference.digilentinc.com/refer ... nce-manual) mentioned before). Should I drive those lines form my PIC? if yes, like just high or just low signal would do?
srlvrsn
 
Posts: 7
Joined: Tue Sep 08, 2020 12:57 pm

Re: Interfacing a thermal printer with PIC

Postby AussieSusan » Wed Sep 23, 2020 3:32 am

OK - I'm not sure where you are measuring those voltages but RS232 voltages are more like +/-15V. I would expect the voltages on the pins of the PIC to be on the 0-5V range as they will be TTL levels (or whatever voltage you are running the PIC at).
As for the use of CTS/RTS, use your scope to see how far the signals are getting. You say you are running the interface board in 3-wire mode so I would expect that you would NOT need to drive them. In general there is nothing wrong with connecting the two pins together (as the data sheet for you device says happens with the jumpers in the correct places for 3-wire operation).
One other thing to check is whether you are correctly connecting the PMODRS232 to the printer. Some cables will connect the TX pin at one end of the cable to the TX pin of the other end, while others will connect it to the Rx pin - these are referred to as 'straight through' or 'crossover' cables). Again using your scope to trace the signals will tell you a lot.
This is really basic trouble shooting.
Susan
AussieSusan
Verified identity
 
Posts: 133
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist

Previous

Return to SCI/USART/EUSART

Who is online

Users browsing this forum: No registered users and 1 guest