Mini Thermal printer SCI

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Mini Thermal printer SCI

Post by samabed »

I hope, this is the right place for this topic. If not please direct me to the right location.

I am interfacing Mini Thermal Printer with PIC18F4455.

1. What is SCI technical data such as Number of start bit(s), stop bits, Parity, ....
2. Do you have a basic "C" liberary for this printer? Where is the liberary?
3. Do you have some sample code for this?

Thanks,
Sam

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

We have a tutorial here. The Downloads Page links with our library and some product documentation
http://learn.adafruit.com/mini-thermal-receipt-printer

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

Hello,

I have been to all of the links recommended in your replay and I could not find the data That I am looking for. Also I participated in your "Ask engineer" Live show last night, but unfortunately after the sales show was over, there was not any "Ask Engineer" session. Please if you could be specific where the following informations are.

1. SCI Data format (Number of start bits, stop bit, odd/even parity or no parity) and wave forms
2. Source code for "C" liberaries, so I can modify them for my application
3. Sample "C" code not "CPP" if you have any.

regards,
Sam

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

It's standard 8-N-1 serial protocol.
The libraries linked to are the only ones we have.

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

8-N-1, I think this means 8 bit data, No parity, and 1 Stop bit.
But in your "Adafruit_Thermal.cpp" file, you are indicating 11 bits. So there must be 2 start bits. maybe one idle and 1 start bit. Is this correct?
Do you have any timing diagrams for send and receive?

Regards,
Sam

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

Where do you see 11 bits? It just uses Software Serial, which is start-8 data-stop.
I don't have any timing diagrams. It's just standard 8-N-1 asynchronous serial at 19,200bps

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

As I have stated before, it is in "Adafruit_Thermal.cpp" file, in 2nd set of comment in the code (Approximately line 28). It says "11 bits (not 8) .....".

I will try my code based on 8-bit data, No Parity, and one stop bit.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

Ah - I see it now. I was looking at an old copy of the library The 11th bit is not a protocol bit. It's just a way to insert a 1 bit-time delay between characters. As the comment says, it's probably not even necessary. The actual protocol is 1 start/8 data/1 stop.

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

OK Thanks, I am implementing same as what you said earlier. One more question to make sure my TX and RX pins are correct:

Pin 3 on printer which is marked as TX (GREEN wire) is TX from the printer and should be connected to the RX of Micro and pin 2 which is marked as RX (Yellow wire) is RX for printer and should be connected to the TX pin of the micro. Am I correct?

Thanks,
Sam

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

That is correct.

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

Hello again,

Where can I find the list of command for the mini receipt printer?
I think I know hoe to send a string to the printer. How do I send a command to the printer?

Thanks,
Sam

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

The User Manual has all the printer commands:
http://www.adafruit.com/datasheets/A2-user%20manual.pdf

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

Hello,
I have seen that, but I fully do not understand the translation to English.
Which command should be used to position the cursor (start of the next character to be printed)?

User avatar
samabed
 
Posts: 16
Joined: Fri Jul 05, 2013 11:21 am

Re: Mini Thermal printer SCI

Post by samabed »

I forgot to ask, how does the tab command (HT) works? I am using it same as Line Feed (LF) command which works. But HT (horizontal tab) does not do anything.

Thanks,
Sam

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Mini Thermal printer SCI

Post by adafruit_support_rick »

samabed wrote:Which command should be used to position the cursor (start of the next character to be printed)?
Not sure what you are trying to do. The LF should reposition to the beginning of the next line. You can offset from there with blanks.
samabed wrote:But HT (horizontal tab) does not do anything.
Hmmm...you're right. HT does not seem to work. I don't know why.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”