Using LPT port dot matrix printer with PIC


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563

    Unhappy Using LPT port dot matrix printer with PIC

    Hi,

    In one of my application I need to use a classic dot matrix printer. A search on the net revealed the pinouts of the centronics port and procedure to dump data.(/strobe<-PIC side, ack->printer side and so on like )) But I have no idea how the characters need to be sent. (Printer control protocol??) Sending a linefeed, paper feed works , but I couldn't print a single character. I suppose I need to load the printer buffer first with characters and then issue a print command or so. Please guide.

    I also tried to build a parallel port data capture device, a PIC18F452@40MHz with the strobe line connected to RB0/INT. An assembly interrupt grabs the data and puts in a buffer(256 byte array). The buffer is then rolled out @115kbps to the hardware usart. I got some characters but nothing (ASCII) that I sent for printing. I will try the old dos way today.
    So another question ,
    I have found that the strobe is active for atleast 0.5uS and I am running at 100nS Instruction cycle time so by the time I fall into the interrupt and load the data it should be valid. BTW I dump the port data to a temporary variable in the first instruction of the assembly ISR and then find out the right array using indirect addressing and finally load the indexed array from the temporary variable (I still don't know the parallel port timings --> valid data --> strobe--> ack) So is this approach feasible.
    Regards

    Sougata

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sougata View Post
    Hi,

    I got some characters but nothing (ASCII) that I sent for printing.
    From that, it could be timing issue. Also try to send just one character followed by CR and LF. It should absolutely print the character and advance the paper.

    Ioannis

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    See this link.
    http://www.phanderson.com/stamp/i2c/print1.html

    Verify the DIP switches of the printer.
    With some printers, with the DIP switches you can select the printer
    emulation mode. (Epson LQ emulation or IBM emulation).

    Best regards,

    Luciano

  4. #4
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Question DIP switches found ??

    Hi Luciano,

    I found the DIP switches but no idea what they do, not in the manual too. It is a MSP 245.

    Ioannis I have tried making the timing high enouhg but results were same.

    I have found an article in the EPE mag July 2001 called PIC to Printer Interface by John Becker for printing on an EPSON printer. I have also found the epson documentation (escape sequences). I will give them a try and let you all know.

    BTW as far as grabbing data from the parallel port is concerned can anybody suggest me a software that monitors and records a parallel port data just like serial monitor.

    Thanks to everyone for responding.
    Regards

    Sougata

  5. #5
    Join Date
    Oct 2006
    Location
    Cape Town SA
    Posts
    23


    Did you find this post helpful? Yes | No

    Arrow

    There is also a marvelous site on all things serial and parallel at:
    http://www.lvr.com/parport.htm

  6. #6
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Sougata,

    The printer has an Hex Dump mode. This mode will show you
    exactly what codes the printer is receiving.
    (The printer will print each byte in HEX on paper).

    See the printer manual how to enable the HEX dump.

    * * *

    To see if the selected emulation is a problem, boot
    the PC with DOS 6.22 and type:

    Copy myfile.txt > PRN

    (Put first 2 or 3 lines of text in the file myfile.txt).
    If you see the text of myfile.txt printed on paper you are fine.

    (The printer must be connected to LPT1 in order to use PRN).

    * * *

    I was unable to downlaod a manual from the web site.
    http://www.tvs-e.in

    Try to phone them. (India).

    Contact:
    http://www.tvs-e.com/may12-05_contact.asp


    MSP 245 brochure:
    http://www.tvs-e.com/may12-05_downlo.../MSP%20245.pdf

    Note that you can install an optional serial port in this printer.


    Best regards,

    Luciano
    Last edited by Luciano; - 26th January 2007 at 12:47.

Similar Threads

  1. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  2. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. 8 port Signal Loss Detector, possible to use a pic?
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th March 2006, 15:59
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

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