Rs232 To Usb

Páginas: 5 (1030 palabras) Publicado: 28 de diciembre de 2012
USB to RS232 Converter Circuit Description


1.0 CIRCUIT OVERVIEW


The USB to RS232 Converter board is a PIC microcontroller based device that receives a USB signal from a PC and converts the signal to an RS232 output. The output signal can be sent to any one of three serial ports. Devices which may be connected to the RS232 ports include the ASI Inc. X-Y Stage, the Olympus Z-Focus, andthe Mai Tai LASER.

[pic]

Figure 1: Current PCB Layout


2.0 CIRCUIT DETAILS



2.1 Power


The circuit has two power options available. When the 0Ω Resistor noted above in Figure 1 is in place, the circuit will draw power from the USB +5V line. When the resistor is absent, power is provided via a 2 pin connector, and an AS78L 5V positive voltage regulator is used. This board usesa PIC18F4455 to receive USB commands which are converted to RS232 protocol via a DS275 Line-Powered Transceiver Chip. There is one transceiver chip associated with each RS232 port. This chip’s transmitter draws power from the receive line, so an external power source is not needed to drive the transmitter line at RS232 levels.


2.2 Cables


The connector for each port is a DB9-maleconnector. The type of cable needed varies depending on the device connected to the port. The XY-Stage uses a straight serial cable. The Z-focus uses a null modem cable.


3.0 SOFTWARE DETAILS



3.1 Necessary Files


The PIC software is compiled using the CCS PCWH compiler. The necessary files are listed below.

• rs232.c (main)
• 18F4455.h
• stdio.h
• stdlib.h• pic18_usb.h
• USB_to_RS232_desc _25.h
• usb.c


3.2 RS-232 Settings


The default settings for RS-232 communication are set to 9600 baud, 8 bits, no parity, and no software handshaking. Only the Transmit (TX), Receive (RX), and Ground signals are used. The Request to Send (RTS) and Clear to Send (CTS) signals are tied together at the board level so that devices requiring the CTSsignal will always be enabled to send data. This works because the device will set its own RTS signal high, so connecting these two signals will ensure that CTS will be held high as long as the device is connected. If an attached device requires settings different from the board default, this can be changed in the software with the exception that this board does not accommodate devices thatrequire handshaking beyond the CTS signal.


3.2.1 Olympus Z-Probe Settings


The Z-Probe default RS-232 communication settings are not compatible with this board. However, they may be changed using the front panel DIP switches to match this board’s default settings listed above. Please see the Olympus IX2 Host I/F Specifications Document (IX2cmdNE.pdf) paragraph 4.1 for more details.


3.3UART


The PIC18F4455 has only one hardware UART, but multiple software UARTS can be created. This is accomplished by assigning a different set of transmit and receive pins for each UART. In this device, three UARTs (one hardware and two software) are used, and each one is associated with one of the three RS232 ports. The USB command indicates which port to use, and the software sets theappropriate UART pins before each data transmission.


3.4 Command Set


Each device uses its own unique command set which is described in the device’s user manual or specification document. The purpose of this board is to pass this command on to the device without modification. The data received via USB will contain this command as well as a three-byte precursor that indicates how thecommand should be processed. The first byte will be an ASCII character ‘1’, ‘2’, or ‘3’ to designate the number of the port that the command is intended for. The next two bytes will be a two-character ASCII code which indicates the type of device connected to this port. This allows the embedded software to change any settings for that particular device if necessary. It also enables the host to...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Conversion Usb A Rs232
  • Usb How To
  • Rs232
  • Rs232
  • RS232
  • Rs232
  • que es un usb
  • que es usb

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS