Approved Business uses its own and third parties’ cookies in order to improve your experience and our services. These cookies provide a better performance, enhanced features and enable certain functionalities. You can obtain more information and learn how to change the configuration of your browser, including how to block some cookies, in our Privacy Policy. However, you should know that blocking some types of cookies may impact your experience on the site and limit the services we are able to offer.

Xtronix Ltd - Serial Data Comms on Microchip PIC 18Fxxx Series Processors

14 March 2024 | Xtronix Ltd

Xtronix Ltd - Serial Data Comms on Microchip PIC 18Fxxx Series Processors

Xtronix Ltd have extensive experience of serial data communications using the Microchip PIC 18Fxxx series of microprocessors.

A serial data link is often used to command and control a microprocessor system, to send data to and from the system or to provide diagnostics. Typical signals on a serial data link are shown in the picture below:

In the above, the yellow trace shows the transmitted command (the letter ‘V’ followed by Carriage Return) and the green trace shows the received response (‘V’, Carriage Return, Line Feed, ‘Generic 18F47K’).

The two lines at the bottom of the picture are the decode of the signal and show the ASCII characters being transmitted and received. ASCII is a character encoding standard for electronic communication. ASCII codes represent text in computers and other electronic devices.

ASCII stands for American Standard Code for Information Interchange and this is a published standard for information interchange.

There are three common serial data interfaces used at Xtronix:

1) An RS232 Interface
This is the classic serial interface and uses RS232 signal levels to send serial data to and from the system. Most modern computers do not have an RS232 serial port fitted as standard, so it is usual to use an RS232 to USB converter at the computer end. The TTL serial data signals are converted to RS232 levels using a MAX232 chip.

The RS232 signals are capable of driving a cable length of 15 metres and can operate at speeds up to 115,200 Baud.

A Baud is a common unit of measurement of symbol rate, which is one of the components that determine the speed of communication over a data channel. The Baud Rate is the number of bits sent per second. A rough rule of rule of thumb is to divide the Baud Rate by 10 to get the number of characters sent over the data link (a ASCII character is usually 10 bits long). So, if the Baud Rate is 115,200 this corresponds to 11,520 characters per second. A commonly used Baud Rate is 9600 Baud which corresponds to about 960 characters per second.

2) A TTL interface
This is a serial interface using TTL signal levels to send serial data to and from the system rather than RS232 signal levels. Only the Transmit (Txd) and receive (Rxd) signals are supported. The TTL signals are only capable of driving short distances (30 cm) and can operate at speeds up to 115,200 Baud. Most modern computers do not have an RS232 serial port fitted as standard, so it is usual to use an TTL to USB converter at the computer end.

Why would you want to use a TTL serial data interface?
If the serial interface is only used for diagnostic and testing purposes, then you may want to not fit the RS232 chip on the PCB to save space and cost. Many of the controllers developed by Xtronix have two serial interfaces.
One is a classic RS232 serial interface used as a command and control port the other is a TTL serial interface used as a diagnostic port.

3) A USB Interface
The RS232 Serial interface has been with us for more than 50 years. However, it still provides a well proven, robust and useful method of sending data to and from a microprocessor system. The USB interface is now provided on most computers and offers faster data transfer rates but only supports a cable length of 2 to 3 metres.

Xtronix uses various different USB to Serial solutions including the FTDI 232R and the Microchip MCP2221A. These chips offer a simple serial data link (with (Txd) and receive (Rxd) signals) over the USB cable. At the compute end the operating system emulates a traditional Serial COM Port with a Virtual COM Port.

The application software can connect directly to the Virtual Port just as if it was a physical COM Port. This has the advantage that legacy software can still be used with a USB connected controller.

Xtronix Ltd have extensive experience of serial data communications using the Microchip PIC 18Fxxx series of microprocessors both at the Hardware Design and Software design level.