Rs232 Hardware Control

Discussion in 'General Electronics Chat' started by oodes, Apr 22, 2013.

  1. oodes

    Thread Starter New Member

    Apr 3, 2012
    12
    0
    Hello,

    I'm working on a device that sends data to a printer using Rs232. I want to monitor the Printer using the Hardware Control Lines. The Printer is the DTE(specified by the manufacturer) and my device is the DCE.
    Problem is when the printer is busy and i try to send it data , the printer just rejects it and I get a Comms error. So I want to get a Hardware signal from the printer to tell me if its busy.
    As I'm sending data to the printer I cant use the RTS line. Can I use the DTR line to determine if the Printer is busy? Does the DTR line go low when printing and not ready for data? And go high again when ready and free to accept data?
    I'm using a DB9 connection.

    Thanks in Advance
    Des
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,340
    1,022
    DTR is not usually used for handshaking. Its used to indicate to the modem (your device) that the terminal (the printer) is connected and powered on. DSR is used by the modem to the terminal to indicate likewise.

    RTS/CTS are the handshake lines for RS232. When a device cannot receive more data (buffer getting full, etc) it drops the handshake line. The sender detects that and stops transmitting.

    RS232 is notorious for being mis-implemented (a printer as DTE?) so you just have to buzz out the lines and work with it. Be sure that both devices are set up the same (BAUD rate, bits etc.) but also have the same handshaking protocol as well. Options to look for are NONE, RTS/CTS and XON/XOFF.


    Can you configure the printer as DCE?

    See FLOW CONTROL in Wikipedia.
    Most implementations I've seen use RTS/CTS in this way as bi-directional handshaking. Your printer likely does as well.
     
    Last edited: Apr 22, 2013
    panic mode and oodes like this.
  3. oodes

    Thread Starter New Member

    Apr 3, 2012
    12
    0
    Is the RTS not considered an Output on the DTE? I'm sending Data to the DTE. RTS high signals its ready to transmitt. I need a signal to tell me the DTE is ready to recieve. If the RTS line is low/high can I use this as an Indicator that i can send it data? Please say Yes :D

    The device is already functional well with software control, baud rate etc Its just for this particular printer , I get a Comms Error if its busy printing what I sent previous. So I need that extra hardware check built in so I dont send it anything when its busy.

    Thanks
    DEs
     
  4. oodes

    Thread Starter New Member

    Apr 3, 2012
    12
    0
    I've read that in Half Duplex mode I can only send Data from Modem(my Device-DCE) to the Terminal(Printer-DTE) when the RTS line is False/Low. Which is ideal for me , as I can check the voltage on this pin. Problem is Im operating in Full Duplex mode and I'm unsure if this same rule applies
     
  5. oodes

    Thread Starter New Member

    Apr 3, 2012
    12
    0
    "Can you configure the printer as DCE?"

    Unfortunately I cant configure the printer as a DCE, but ill give the bi-directional handshake a bit of testing and see what happens.

    Thanks for the Help

    Des
     
  6. JohnInTX

    Moderator

    Jun 26, 2012
    2,340
    1,022
    Let us know how it goes. If you are still having problems post the printer model and how you have it hooked up.

    It shouldn't be but sometimes async can be a beating.
     
Loading...