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

Bulk transfer of Data via USB (Host side)

Hi everyone,

I am using a LM3S5951 controllers for one of my projects in which I need to implement a host side driver for Dot Matrix printer .

I am done with enumeration of the printer, but now I would like to know how can I send data to printers using bulk transfers. I am using the Stellaries USB Library for the same where I found some host side codes for keyboard and pendrive. I would like to know, how to go about this.

Regards

Dhanush

Parents
  • Connect your printer to a PC, on which genuine printer driver is installed,
    and trace the USB traffic using a sniffer. The driver should poll the printer status.

    a) How does the driver poll the status, over GET_PORT_STATUS request, or over the bulk IN endpoint?

    b) How does the status change, at on/off of "Select" button, and Paper empty?

    Tsuneo

Reply
  • Connect your printer to a PC, on which genuine printer driver is installed,
    and trace the USB traffic using a sniffer. The driver should poll the printer status.

    a) How does the driver poll the status, over GET_PORT_STATUS request, or over the bulk IN endpoint?

    b) How does the status change, at on/off of "Select" button, and Paper empty?

    Tsuneo

Children
  • HI,

    Here instead of calling the getportstatus every 100 ms i call the func before printing the data.

    Now when I first send data to be printed w/o paper inserted i get no error i.e. 00011000 .

    Second time if I do the same i get error i.e. 00110000

    My question is why it does not give an error for the first time.

    And my requirement is once i give data to be printed and no paper is inserted it the code should wait till the paper is not inserted and once the paper is inserted it should start printing.

    For parallel port I do this using the busy flag of the centronics port. I keep on checking the busy flag till it gets low, Once the paper is inserted the printer makes the busy flag zero and then I start sending data to be printed.

    How can I achieve this on USB . I Know the only way I have is polling the printer status continuously.

    Regards
    Dhanush

  • Did you trace the USB traffic of the "genuine" PC driver for the printer?
    You can trace it with any free USB sniffer, like
    http://freeusbanalyzer.com/
    sourceforge.net/.../
    etc.

    The "genuine" PC driver should regularly poll the printer status.
    It may apply bulk IN endpoint or any vendor-specific request other than GET_PORT_STATUS.

    Tsuneo

  • Hi,

    I want to implement a USB module as V drive for pendrive where I can get commands through uart such as make directory ,open file etc and then dump the file onto pendrive. I am aware of how USB works, I want to know the feasibility of this project and a starting guide to how can it be achieved.

    Regards
    Sanket

  • Hi,

    I am using a TM4c123 series controllers with 1 USB host port. Now I am using the same port using the a USB switch to use the keyboard and pendrive. But i want to use them both without switching. I guess this is possible if a USB HUB controller with 2 or 3 downstream ports is available. So how should go about it, are there any controllers which such capabilities available.

    Regards

    Sanket