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
Mini Thermal printer SCI
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
We have a tutorial here. The Downloads Page links with our library and some product documentation
http://learn.adafruit.com/mini-thermal-receipt-printer
http://learn.adafruit.com/mini-thermal-receipt-printer
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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
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
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
It's standard 8-N-1 serial protocol.
The libraries linked to are the only ones we have.
The libraries linked to are the only ones we have.
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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
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
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
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
I don't have any timing diagrams. It's just standard 8-N-1 asynchronous serial at 19,200bps
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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 .....".
I will try my code based on 8-bit data, No Parity, and one stop bit.
I will try my code based on 8-bit data, No Parity, and one stop bit.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
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.
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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
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
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
That is correct.
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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
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
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
The User Manual has all the printer commands:
http://www.adafruit.com/datasheets/A2-user%20manual.pdf
http://www.adafruit.com/datasheets/A2-user%20manual.pdf
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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)?
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)?
- samabed
- Posts: 16
- Joined: Fri Jul 05, 2013 11:21 am
Re: Mini Thermal printer SCI
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
Thanks,
Sam
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Mini Thermal printer SCI
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:Which command should be used to position the cursor (start of the next character to be printed)?
Hmmm...you're right. HT does not seem to work. I don't know why.samabed wrote:But HT (horizontal tab) does not do anything.
Please be positive and constructive with your questions and comments.