This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usb pritner interfacing

hello all,
i have microcontroller of c8051f020 and serial to usb module
i want to interface the usb printer to microcontroller
can u guide me for the usb printer protocol used for microcontroller?
thank you all
take care

Parents
  • The microcontroller is irrelevant - the USB Printer Protocol is defined by the USB Spec and is totally independent of what device is used to implement it!

    Note that driving a USB Printer will require a USB Host or OTG (On-The-Go) port...

Reply
  • The microcontroller is irrelevant - the USB Printer Protocol is defined by the USB Spec and is totally independent of what device is used to implement it!

    Note that driving a USB Printer will require a USB Host or OTG (On-The-Go) port...

Children
  • thanx for reply andy,
    can u give me any website for usb printer interfacing
    with microcontroller. i will take care of hardware.
    i will use c8051f020 and serial to usb converter as uart is presnt and then connect printer to usb so i require usb protocol for printer
    i m going through usb protocol pdf. is that enough or does it have anything more to do with it?
    pls guide me.
    thank you once again
    take care
    regards

  • Before starting your USB study, I recommend you to examine your printer, first.

    Nowadays, low-cost printers depend on Windows process heavily.
    Before sending data to a printer, Windows device driver for the printer renders page images. And then, compressed images are sent to the printer. The printer just places dots on papers following the images, like a copy machine. On this type of printers, you can't print documents by sending ASCII character codes from your MCU like in old days.

    If your printer is this type, find an old printer.

    Tsuneo

  • How I know which type is my printer? If my printer is using rander image compressed as you describe then is it possible to control it via microcontroller? thanx.

  • And how would you know what protocol the printer would use for transfering the data?

  • > How I know which type is my printer?
    > And how would you know what protocol the printer would use for transfering the data?

    Firstly, examine printer's technical manual well.

    Good for MCU connection
    Epson FX-890 - Impact printer with USB
    " href= "http://files.support.epson.com/pdf/dfx5k_/dfx5k_td.pdf">files.support.epson.com/.../dfx5k_td.pdf

    This pdf lists up these features
    - ESC/P (ESC/P 2) control code
    - built-in fonts

    Control code or PDL (Page Description Language) is explicitly documented, and it is well-known one. Built-in font suggests that this printer has a page-rendering engine on it.

    Bad for MCU connection
    HP LaserJet P1000 and P1500 Series Software Technical Reference
    h10032.www1.hp.com/.../c01295069.pdf

    Introduction to host-based printing (p74)
    The HP LaserJet P1000 and P1500 Series printers are host-based devices. Host-based printing differs from PCL printing by rendering the print job on the host computer rather than on the device formatter.

    As a host-based printing system, the HP LaserJet P1000 and P1500 Series print drivers use the Windows operating system to convert the graphics device interface (GDI) or device driver interface (DDI) calls from software programs into JBIG (standard-compression) compressed pages. These pages are sent in “chunks†through the driver to the device formatter.

    This one is a typical "Windows" printer.
    You have to run Windows on your MCU...



    Next, for printers at your hand, capture printer's ID string using a hardware USB analyzer or software sniffer. On enumeration, host reads out IEEE1248 device ID string using Get_Device_ID request from the printer. In this string, "CMD:" tag reports supported control code or PDL

    Good for MCU connection
    This an excerption from enumeration sequence of an old laser printer (Epson LP-2400) on my desk.

    ...
    ...
    - Set_Configuration
    - Get_Descriptor( Device )
    - Get_Device_ID (A1 00 00 00 00 00 F1 03) - printer class-specific request
    - IN
    00 6B 4D 46 47 3A 45 50 53 4F 4E 3B 43 4D 44 3A   .kMFG:EPSON;CMD:
    45 4A 4C 2C 45 53 43 50 32 34 4A 2D 38 34 2C 45   EJL,ESCP24J-84,E
    53 43 50 41 47 45 4A 2D 30 34 2C 45 53 43 50 53   SCPAGEJ-04,ESCPS
    55 50 45 52 2D 30 30 2C 50 52 32 30 31 2D 30 30   UPER-00,PR201-00
    3B 4D 44 4C 3A 4C 50 2D 32 34 30 30 3B 43 4C 53   ;MDL:LP-2400;CLS
    3A 50 52 49 4E 54 45 52 3B 44 45 53 3A 45 50 53   :PRINTER;DES:EPS
    4F 4E 20 4C 50 2D 32 34 30 30 3B                  ON LP-2400;
    


    This printer supports ESC/P 24-J84 (Dot printer emulation) and PR201 emulation. Also, HP PCL5 is a good protocol for MCU.

    [Software sniffers]
    USBlyzer (1 month trial)
    http://www.usblyzer.com/
    SourceUSB (1 month trial)
    http://www.sourcequest.com/

    [References]
    Epson ESC/P reference manual
    support.epson.ru/.../part1.pdf

    HP PCL5
    CD-ROM: HP PCL/PJL Technical Reference Manuals
    h20000.www2.hp.com/.../SoftwareDescription.jsp

    Tsuneo