RS232 to Parallel Printer Converter


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257

    Post RS232 to Parallel Printer Converter

    Has any one attempted this one or know a site with info about it?

  2. #2
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61


    Did you find this post helpful? Yes | No

    Default Serial 2 Paraller PRinter Converter

    HI! I don't know if this is what you want but give it a try

    THANKS HARRISON PHAM ,for the codding!

    'Serial to Parallel Printer Converter for Generic Printers
    'By: Harrison Pham March 30, 2003
    '---------------------------------------------------
    'PIC: 16F84 at 4mhz
    '
    ' PIC Printer (DB25 Connector)
    ' Pin A1 Pin 16 (Init)
    ' Pin A0 Pin 1 (strobe)
    ' Pin B0 Pin 2
    ' Pin B1 Pin 3
    ' Pin B2 Pin 4
    ' Pin B3 Pin 5
    ' Pin B4 Pin 6
    ' Pin B5 Pin 7
    ' Pin B6 Pin 8
    ' Pin B7 Pin 9
    ' Pin 17 to gnd (Printer Select)
    ' *Pin 14 to gnd (if needed for autofeed feature)*
    ' Pin 18 to gnd (gnd)
    '----------------------------------------------------
    init con A1
    strobe con A0
    char var byte
    trisb = $00 'set portb to all outputs

    high init 'clear init line
    high strobe 'clear the strobe line
    portb = %11111111 'put all data lines high
    pause 1000 'pause for a second

    low init 'init the printer
    pause 500 'pause 500mill seconds to let printer init
    high init 'clear the line

    main:
    serin A2,N9600,[char] 'get characters with serial
    if char = 13 then 'if detected a cr then insert cr and lf
    PortB = 10 'lf
    low strobe 'tell printer to read in byte
    pauseus 200 'wait 200usec for printer to read in byte
    high strobe 'clear the strobe
    PortB = 13 'cr
    low strobe
    pauseus 200
    high strobe
    endif
    portb = char 'set portb to the char byte
    low strobe
    pauseus 200
    high strobe
    goto main

  3. #3
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Thanks Mate. just what I was after.. I shall give it a try.

    Cheers

  4. #4
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Gave this example a try and can confirm that the code does work, however,

    I woud recomend that Pin 18 not be tied to gound as some printers have a 5 volt supply on it.

    For my application, I found that I needed to use the -BUSY signal so that all chars could be printed and increased the delay to 500... I used this code..

    pauseus 500 'wait 200usec for printer to read in byte
    high strobe 'clear the strobe
    GOSUB READY



    READY:
    IF BUSY = 0 THEN RETURN
    GOTO READY

    Thanks again for the code....

  5. #5
    JosueCas's Avatar
    JosueCas Guest


    Did you find this post helpful? Yes | No

    Exclamation Almost working

    Hi!!.
    I was trying this code with an EPSON printer.
    I am almost there but it seems nothing is being printed until the buffer of the printer is full. Is there any special character that needs to be send in order to execute the printing?

  6. #6
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    if it is an inkjet printer, this is normal behaviour. To print what is in the buffer, send a Form Feed character (FF - ^L I think)

    Jerson

  7. #7


    Did you find this post helpful? Yes | No

    Default It works Now, Thanks

    Although it was not an inkjet printer, this matrix printer executes printing after a line feed (10).

    I was just trying to print dots for a plot

    The code works great, very simple and nice

    Thanks.

Similar Threads

  1. Anybody used EPSON M-42V Daisy wheel Printer
    By sougata in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 7th September 2009, 20:58
  2. UART vs software RS232
    By Michael in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 5th September 2008, 18:27
  3. Paid assistance needed, 16F877A, RS232, Vetra
    By CodeShredder in forum General
    Replies: 2
    Last Post: - 17th May 2008, 10:34
  4. Serial to parallel converter using shiftin
    By daxki in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd April 2007, 15:05
  5. Using LPT port dot matrix printer with PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th January 2007, 11:48

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