• AVR Freaks

Hot!embedded printer

Author
ALPL
Super Member
  • Total Posts : 293
  • Reward points : 0
  • Joined: 2006/12/30 02:52:11
  • Location: Austria
  • Status: offline
2020/08/25 05:05:31 (permalink)
4 (1)

embedded printer

Good afternoon,
we already installed a control/service system which allows the customers to choose certain services from a menu list on a TFT LCD touch screen. When the customer confirms his wishes the data are stored in a local storage unit and on his RFID-card. Now our customer additionally wants to have a printed report (a summary of all transactions) at the end of the day on an A4-page. Unfortunately the easy to use UART- thermal-printers are too small and therefore cannot be used and the old character printers which could be controlled via RS232 disappeared.
Is there any normal-priced modern printer which (besides printing on normal A4 paper) easily can be directly controlled by UART, USB, SPI, etc or should I just go for a Raspberry Pi with Linux which passes on the data from the PIC to an ordinary commercially available (cheap) printer? Or is there any better solution?
Many thanks in advance for positive/helpful responses.
post edited by ALPL - 2020/08/25 05:07:27
#1

11 Replies Related Threads

    Aussie Susan
    Super Member
    • Total Posts : 3772
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: embedded printer 2020/08/25 19:42:19 (permalink)
    +2 (2)
    You might be approaching this from the wrong end. You may need to chose a printer and then work out how to connect to it.
    What do you call a 'normal priced' printer? Some laser printers can be quite cheap to buy (under $100 here in Australia) but the supplies can be very expensive. Ditto ink-jet printers.
    Many 'modern' printers have USB or Ethernet connectors. USB connector tends to be used for direct printing and Ethernet connections used for network access (but there are always exceptions).
    You don't say which MCU you are using: some have USB host hardware capability built in (with the appropriate software stack) and you can always get a cheap Serial-USB chip for others. Similar statements go for Ethernet connections from the MCU. 
    Susan
    #2
    ALPL
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2006/12/30 02:52:11
    • Location: Austria
    • Status: offline
    Re: embedded printer 2020/08/29 21:55:30 (permalink)
    0
    Hi Susan,
    to connect a PIC (eg PIC18F46K22 like in the current project or whatever suitable) to a device via FT232 (or similar) or to use one of the USB-PICs is not the problem. The problem is that I did not find any description/article in the PIC/Arduino/ST/IOT/etc-world how to control any of those printers (ink or laser) which you can buy in any PC shop for 25- 70 US$ - not even in the Arduino world. And if such a protocol is published and free to use: is it easy enough to use it? This means, is there something like a simple command set which can immediately be understood and implemented or only an over-complicated huge software stack (AppSocket protocol like the JetDirect protocol) with hundreds of functions where you (may) need an expensive license and long time to figure out what they mean and which does not fit into a medium-size PIC memory? I do not need this every day - I need it only for this single project. So I cannot invest too much man power into it. If there should not be a daily protocol on an A4-size paper I would choose a thermal printer (like in many other projects). But those normally work only with 58-80mm wide paper.
    I am afraid that there is no simple solution - otherwise there would be plenty of articles about embedded printer control. OK - then I will try to convince a Raspberry Pi to do the job. But I need to know if maybe I missed something and therefore I opened this thread.
    post edited by ALPL - 2020/08/29 22:02:44
    #3
    ric
    Super Member
    • Total Posts : 28731
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: embedded printer 2020/08/29 22:01:40 (permalink)
    +1 (1)
    Almost all of the really cheap printers are very simple raster out devices.
    All the font rendering etc. is all done in the PC.
    I don't know how easy it would be to drive them directly, or if the details are public.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    ALPL
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2006/12/30 02:52:11
    • Location: Austria
    • Status: offline
    Re: embedded printer 2020/08/29 22:33:26 (permalink)
    +1 (1)
    Hi ric,
    when I started to search in the internet I was surprised that I could not find any useful information or projects from other people. Is there no need in embedded projects to print on "normal" paper with a "normal" supermarket printer? Many years ago this was no problem - a simple ASCII command set was sufficient to control the printers (RS232 or parallel port). I have the feeling that things got much too over-complicated in the last years. A good example is the USB-interface - from one day to another the RS232 interface was replaced by this monster. Also the I2C-interface in the newer PICs (like the PIC18F47K42) is getting much more complicated with its many, many registers. Why is everything becoming so complicated? Embedded programming was always very clear, simple and uncomplicated due to its beeing-very-close-to-hardware nature. Does the embedded world now also shift to become awfully highly-complex and software-overloaded (huge APIs) so that only a few professionals can deal with it any more?
    post edited by ALPL - 2020/08/30 01:33:16
    #5
    ALPL
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2006/12/30 02:52:11
    • Location: Austria
    • Status: offline
    Re: embedded printer 2020/08/30 00:50:49 (permalink)
    +1 (1)
    Epson still offers DOT-Matrix-Printers both in 9 (eg LX-350) and 24-pin (eg LQ-350) versions, controllable by ESC/POS commands over RS232 or USB. They use standard A4 single paper or endless paper. They are quite expensive compared to standard printers (300-1000 EUR) but this could be a solution for my problem.
    I ordered a LQ-350 for testing ...
    post edited by ALPL - 2020/08/30 01:34:12
    #6
    karan123
    Super Member
    • Total Posts : 1014
    • Reward points : 0
    • Joined: 2009/02/02 11:11:21
    • Location: 0
    • Status: online
    Re: embedded printer 2020/08/30 04:18:31 (permalink)
    +1 (1)
    Hi,


    https://www.microchip.com....aspx?appnote=en537372

    Above link may useful to you.

    --
    Karan
    #7
    ALPL
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2006/12/30 02:52:11
    • Location: Austria
    • Status: offline
    Re: embedded printer 2020/08/30 08:35:17 (permalink)
    0
    @karan123: thank you for the the link - this looks very promising, also because they give some step-by-step simple instructions for printing. I plan to try this next week. Let's see how much memory will be needed.
    For PIC32 there is also the MPLAB Harmony USB Stack: https://microchip-mplab-harmony.github.io/usb/frames.html?frmname=topic&frmfile=00316.html . But at a first glance this does not look to be easy to use.
    #8
    Antipodean
    Super Member
    • Total Posts : 1929
    • Reward points : 0
    • Joined: 2008/12/09 10:19:08
    • Location: Didcot, United Kingdom
    • Status: offline
    Re: embedded printer 2020/08/30 09:13:32 (permalink)
    +2 (2)
    karan123
    Hi,
    https://www.microchip.com....aspx?appnote=en537372
    Above link may useful to you.
    --
    Karan



    He will need a PIC24 at a minimum to use that. The PIC18 does not do USB Host at all (unless there is a recent one I haven't caught up with).
     

    Do not use my alias in your message body when replying, your message will disappear ...

    Alan
    #9
    karan123
    Super Member
    • Total Posts : 1014
    • Reward points : 0
    • Joined: 2009/02/02 11:11:21
    • Location: 0
    • Status: online
    Re: embedded printer 2020/08/30 11:15:32 (permalink)
    0

    For PIC32 there is also the MPLAB Harmony USB Stack: https://microchip-mplab-h...amp;frmfile=00316.html . But at a first glance this does not look to be easy to use.

    Yes, It's not as easy to use if you have not any experience on PIC32 MCUs ,MLA or Harmony Project..
     
    https://microchip-mplab-h...amp;frmfile=00281.html
    #10
    ALPL
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2006/12/30 02:52:11
    • Location: Austria
    • Status: offline
    Re: embedded printer 2020/08/30 13:11:47 (permalink)
    0
    Many thanks for the new inputs! As far as I know the PIC18s are just USB devices and need for example a MAX3421E to form a USB host system or also a Vinculum can communicate with the PIC18 via UART, but I am also familiar with PIC24Fs (which have a USB OTG and, therefore, USB host capability). Concerning PIC32 I am not experienced.
    Generally, if possible, I try to avoid USB - e.g. we still use the old-style PS/2 keyboards because they are very simple to connect to a PIC18. So I put 2/3 of my hope in the LQ-350 and with the remaining 1/3 I will play with the PIC24.
    #11
    ALPL
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2006/12/30 02:52:11
    • Location: Austria
    • Status: offline
    Re: embedded printer 2020/08/31 23:48:09 (permalink)
    +2 (2)
    Feed-back for the LQ-350 24-pin-printer: very easy to use! We used a PIC18F46K22 and controlled the printer via UART (MAX232 level conversion). The command set is available from the internet. Commands are set up as a string, which then is transferred to the printer. I did not try graphics, just text, because all we need is a text protocol.
    Nevertheless I will not forget the PIC24-option. Unfortunately our PIC24s which we have in stock do not have USB OTG - so I must order some samples first.
    post edited by ALPL - 2020/08/31 23:49:25
    #12
    Jump to:
    © 2020 APG vNext Commercial Version 4.5