• AVR Freaks

Hot!PIC24 USB Host to Thermal Printer

Author
ECCsimmons
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2018/10/05 13:07:24
  • Location: 0
  • Status: offline
2018/10/08 12:42:57 (permalink)
0

PIC24 USB Host to Thermal Printer

I've seen some documentation, libraries, and videos that give me a great deal of hope this will be possible, but wanted to confirm with some of you that are more familiar with the PIC development before I dive into it too deep.
 
I'm attempting to use a PIC24FJ64GB002 to interface with a USB thermal printer. I have used this PIC for simple USB host to dump files to a USB drive, but never anything like this. I see there is the USB Printer Class, which is likely what I'll have to use, and looks very promising. I also know that this printer when connected to my linux box uses the simple usblp driver, and I can simply echo ASCII text to the /dev/lp0 device that is generated and it will respond accordingly. Which again, gives me hope it's simple enough the chip can handle it.
 
If viewed as very possible, any advice on where to start, or what examples/demos will be the most useful in a situation like this? Any pointers would be great, thanks!
#1

10 Replies Related Threads

    ECCsimmons
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2018/10/05 13:07:24
    • Location: 0
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/10/10 06:50:31 (permalink)
    0
    Suppose we can start with something slightly easier hopefully: What happened to all of the printer examples that were in legacy MLA, they are gone in newer versions. Did they stop supporting the printer stuff, or is it simply they didn't want to maintain those examples any long?
    #2
    Jim Nickerson
    User 452
    • Total Posts : 6328
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/10/10 06:56:14 (permalink)
    0
    maybe you could port the usblp driver ?
    If you have the specific information available from the printer manufacturer it might be easier.
    Maybe the source to usblp would help.
    #3
    Jim Nickerson
    User 452
    • Total Posts : 6328
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/10/10 07:01:45 (permalink)
    0
    The usblp.c source seems to be available for use as a starting point to begin porting, looks like it was last updated 2009
    https://github.com/spotif...vers/usb/class/usblp.c
    #4
    Alpha Whisky
    Super Member
    • Total Posts : 52
    • Reward points : 0
    • Joined: 2014/10/02 07:05:22
    • Location: 0
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/10/10 08:21:40 (permalink)
    0
    Don't forget that usblp.c is under the GPL. If you convey anything based on it to any third party you have to offer (and be prepared to provide) all of your source code for that project.
     
    You can use it as a reference for how to interface to a printer, but you can't just cut and paste from it unless you want to go GPL.
    #5
    ECCsimmons
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2018/10/05 13:07:24
    • Location: 0
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/10/10 12:21:24 (permalink)
    4.5 (2)
    Thanks for the replies gents, but I think you were over-complicating my request. I may have put too much info in my original post and muddied the water.
     
    To anyone looking to do something similar, I just went back and used the legacy (2013??) version of the MLA that still contained all of the printer examples, still not sure where the heck these went along with most of the associated header files... regardless.
     
    I started with the "USB Host Simple POS Demo", and stripped out all of the complex stuff like printer cuts, etc, and used the USBConfig.exe tool to generate the right configurations for this printer using the ESC/POS driver I believe. Then once I got the UARTs up and running so I could dump data to my PC, the printer stuff that was in the demo pretty much worked without issue. May have been some slight changes but nothing major, I would recommend starting there.
     
    Hope this helps anyone looking to do the same. Once I get the code cleaned up I can post a simple sample.
     
    #6
    jonnyjain
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2018/10/31 23:46:12
    • Location: 0
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/11/01 22:54:02 (permalink)
    0
    When I can upgrade my operating system into the latest Window 10. I got a certain error that can stop My all function of Dell Printer while we can be given print command its shows Printer in Error State then we can contact at the Dell support at the following link they really help me.
    #7
    crosland
    Super Member
    • Total Posts : 1667
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/11/02 13:46:04 (permalink)
    0
    jonnyjain
    When I can upgrade my operating system into the latest Window 10. I got a certain error that can stop My all function of Dell Printer while we can be given print command its shows Printer in Error State then we can contact at the Dell support at the following link they really help me.


    What?
    #8
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2018/11/02 13:51:01 (permalink)
    0
    Spam.
    Already reported.

    Nearly there...
    #9
    h_ravelo
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2016/11/11 11:17:55
    • Location: 0
    • Status: offline
    Re: PIC24 USB Host to Thermal Printer 2019/10/21 14:34:30 (permalink)
    0
    Hello, I have read carefully and thank you very much for the information.
    I am new and I am trying to make the jump of PIC 8 Bits for 24F USB Host,
    I am just about to read about USB Host and by chance I have a PIC24FJ64GB002 and I would like to use it to start,
    I could already make the LED flashing and it would be great to be able to using your project as a starting point as a USB host,
    will it be possible to get it?
    #10
    ric
    Super Member
    • Total Posts : 24217
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: PIC24 USB Host to Thermal Printer 2019/10/23 13:22:08 (permalink)
    0
    Don't put text inside code tags, that makes it hard to read.
    Here it is with those tags removed.
    h_ravelo
    Hello, I have read carefully and thank you very much for the information.
    I am new and I am trying to make the jump of PIC 8 Bits for 24F USB Host,
    I am just about to read about USB Host and by chance I have a PIC24FJ64GB002 and I would like to use it to start,
    I could already make the LED flashing and it would be great to be able to using your project as a starting point as a USB host,
    will it be possible to get it?




    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!
    #11
    Jump to:
    © 2019 APG vNext Commercial Version 4.5