pic18f driving usb printers


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    ephesus's Avatar
    ephesus Guest

    Default pic18f driving usb printers

    hi,
    I am a beginner to USB,
    I need some info about interfacing USB printers.
    I feel better now after reading all "USB 2.0 specifications","USB device class definition for printing devices" and USB threads in forum. A few questions,

    -is a pic18f able to drive USB printers as a host using pbp2.46 USB statements?
    -how about page description language -PDL-?
    -how to send a standard A4 text page from pic18f to printers -hp,canon,xerox etc.-?
    -do all USB printers accept a standart text format or variations needed for different manufacturers?

    My application is a kind of Guard Tour System including a portable recorder and ibuttons or rfid tags
    for security checkpoints. it works well with the interface software on pc or directly reports to rs232 printers.
    Thanks to picbasic pro.
    Now planning to upgrade to USB printers.

    Thank you very much...

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    As i know, a PIC can't drive a Printer. You'll need something like those ALFAT chips.

    See this link
    http://www.picbasic.co.uk/forum/showthread.php?t=2102
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    ephesus's Avatar
    ephesus Guest

    Default

    Steve,
    Yes, there are many interface chips like FTDI's and usb onchip microcontrollers and many adapter solutions. I really wonder if an ascii
    text page based printer driver for any of brands -HP,Canon..- could be written by pbp for 18F family usb pics.
    Thanks

    Serkan

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    PIC are not design to handle external USB device. They are design to work as an external USB device... well, that's the simplest explanation i found.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511

    Default

    Hello ephesis,

    E>> I really wonder if an ascii text page based printer driver for any of brands -HP,Canon..- could be written by pbp for 18F family usb pics. <<

    Yes, very easily done...IF ( I say IF) your printer accepts standard ASCII codes...with BUILT IN FONTS. Most printers do not anymore... your Dot Matrix printers will. I know that the HP1200 will work, and it can be driven by the USB. But when you start messing with printers that do not have built in fonts... you complicate things tremendously for the PIC. Quite a few of the Centronix Printers will have built in fonts.. and sometimes the Centronix printers can be driven by the USB ports.

    Dwayne (either that, I misunderstood your question).
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Dwayne,

    I think the question was:
    is it possible to drive a printer by a PIC via USB?

    not:
    which printer models do have built in fonts?
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511

    Default

    Hello Ralph,

    I think the question was:
    is it possible to drive a printer by a PIC via USB?

    not:
    which printer models do have built in fonts?

    My answer would be yes...*only* if the printer has built in Fonts, and you use standard ASCII to print with to your USB port.
    If it doesn't have built in fonts, you are shooting yourself in the foot.

    Most printers that I know of (That have built in fonts) will accept ASCII data, just like your LCD. (Especially the Dot Matrix). But if they do not have the built in fonts, you will have a tremendous amount of overhead to create and use the fonts. Which IMO is out of the question for the PICs.

    I was probably unclear...sorry.

    Dwayne
    Last edited by Dwayne; - 26th July 2005 at 19:19.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  8. #8
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Quote Originally Posted by Dwayne
    Yes, very easily done...IF ( I say IF) your printer accepts standard ASCII codes...with BUILT IN FONTS.
    Ok, let's assume the target printer has built in fonts.

    Do you have a working code example?

    Quote Originally Posted by Dwayne
    Yes, very easily done...
    come on, it's easy, share the code...

    ;-)
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  9. #9
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511

    Default

    Sending standard ASCII code to the PORTB, just like your LCD.

    ASCII in ASCII out...like a ASCII delimited file.

    PSUEDO CODE

    InputData var byte
    Output Var byte

    Loop:

    Read Inputdata (whether you use SERIN or any other input data method)
    Portb=Inputdata
    toggle your datapin to send your ASCII byte.

    goto Loop

    Made one of these programs many years ago to test printers in DOS format...

    If you take a look at a OLD printer control manual, you will see that Line feeds are Decimal 10... I think top of page was Decimal 12 contolling similar to the LCD...

    Either I am misunderstanding something, or we are not on the same frequency at this very minute Maybe I should go back to bed?

    DWayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 13:43
  2. USB Bootloader.
    By HenrikOlsson in forum USB
    Replies: 22
    Last Post: - 2nd May 2013, 02:46
  3. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 20:17
  4. One USB keyboard to Two USB Ports
    By picnaut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th June 2009, 00:04
  5. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 17:39

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts