Author Topic: DCD pin Handle over USB  (Read 10359 times)

Antonio Cabral

  • Member
  • ***
  • Posts: 1
DCD pin Handle over USB
« on: April 09, 2020, 01:37:44 pm »
I am developing an application that I did not find any information regarding how to generate the DCD info to the USB.
 It happens that in my application I need to send to the PC the change information of the "DCD" pin of the connected serial port, but I have not found any information on how to implement this command from the USB side.
 I know that there are some USB chips like FTDI and CP2102 that have the "DCD" pin ready to be used and so I think there must be a specific "frame" that the chip sends to the PC to inform the change of that pin.
 I did several tests using RealTerm using a chip that has the DCD pin.
 When I change the state of this pin, RealTerm identifies this change in the panel, but I would like to know what information the chip sends to the PC so that this function is signaled. I appreciate your help. Thanks a lot!!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: DCD pin Handle over USB
« Reply #1 on: April 09, 2020, 02:09:18 pm »

Renate

  • Frequent Contributor
  • ****
  • Posts: 97
Re: DCD pin Handle over USB
« Reply #2 on: April 15, 2020, 08:12:05 pm »
If I understand what you are asking, for the FTDI, it sends two bytes at the start of every UART received data transmission.
From the Linux kernel source code:
https://elixir.bootlin.com/linux/latest/source/drivers/usb/serial/ftdi_sio.h
Code: [Select]
* IN Endpoint
 *
 * The device reserves the first two bytes of data on this endpoint to contain
 * the current values of the modem and line status registers. In the absence of
 * data, the device generates a message consisting of these two status bytes
 * every 40 ms
 *
 * Byte 0: Modem Status
 *
 * Offset Description
 * B0 Reserved - must be 1
 * B1 Reserved - must be 0
 * B2 Reserved - must be 0
 * B3 Reserved - must be 0
 * B4 Clear to Send (CTS)
 * B5 Data Set Ready (DSR)
 * B6 Ring Indicator (RI)
 * B7 Receive Line Signal Detect (RLSD)
 *
 * Byte 1: Line Status
 *
 * Offset Description
 * B0 Data Ready (DR)
 * B1 Overrun Error (OE)
 * B2 Parity Error (PE)
 * B3 Framing Error (FE)
 * B4 Break Interrupt (BI)
 * B5 Transmitter Holding Register (THRE)
 * B6 Transmitter Empty (TEMT)
 * B7 Error in RCVR FIFO
« Last Edit: April 15, 2020, 08:24:27 pm by Renate »