I've been studying about USARTs and I haven't seen a consensus on synchronous USART implementation among MCU producers.

First of all, there are transmit and receiver clock lines on some serial connectors (e.g. 25-pin RS-232 connector). However, I couldn't find any USART device (within a MCU) which provides both of these lines.

Secondly, as far as I learn, synchronous mode doesn't define start and stop bits but some synchronous USART devices use these bits.

Thirdly, some synchronous USART devices, such as in PIC16F882 (page 171), use a bidirectional data line to transmit and receive data. Hence, only half-duplex synchronous transmission is possible with these devices.

I want hands on experience on a complete synchronous USART device using a common serial connector like 25-pin RS-232. Here are some ideas come to my mind.

Bit banging may be an appropriate way to study about protocol (but not device itself).

Custom hardware design would be a good experience but it's pretty harder than dealing with ready devices.

Combining two PIC16F882s, one for receive only and one for transmit only may be a solution.

My problem is I cannot find a complete(!) device to study USART, write some code, inspect registers etc. I need suggestions and I'm open to new suggestions and references.

  • 4
    \$\begingroup\$ Do you have a specific question? For one thing, you are conflating RS-232, which is a standard, with the function of a UART/USART, which is not standardized. These are two completely separate things. \$\endgroup\$ – Elliot Alderson Aug 11 '19 at 21:01
  • \$\begingroup\$ @ElliotAlderson My problem is I cannot find a complete(!) device to study USART, write some code, inspect registers etc. I need suggestions. \$\endgroup\$ – JeJoRic Aug 11 '19 at 21:05
  • \$\begingroup\$ I am voting to close this as unclear what you are asking. Can I suggest that you learn how to use one of the digital simulator packages and code this in VHDL or Verilog. This will give you a good insight into how this type of device works as well as some skill in modern implementation of digital logic. This is very broad advice and is intended to give you an alternative direction. \$\endgroup\$ – RoyC Aug 13 '19 at 14:28
  • \$\begingroup\$ @RoyC At the end of the day, I've learned that there is no ready/common MCU compatible with 25-pin RS-232 (thanks to SE and you guys) since 25-pin RS-232 isn't a common protocol nowadays, and if someone needs to use 25-pin they have to implement it in hardware. I'm a beginner and this question helped me to come to this conclusion. If you experienced users decide to close, it's ok for me but if you think there will be others like me and keep the post, it is also ok for me. Thanks anyway. \$\endgroup\$ – JeJoRic Aug 13 '19 at 17:36
  • 1
    \$\begingroup\$ You are looking at a 25 pin connector that allows a multitude of devices to be connected like modems, but at it's core RS-232 is a serial, low frequency, short distance protocol. No UART / USART design would implement the full 25 pins protocol. You'd have to dig into specifications and actual designs to see how the standard was actually interpreted by manufacturers. \$\endgroup\$ – StainlessSteelRat Aug 13 '19 at 19:45

Unlike RS-232, which is a standard, an "USART" is not a standard in any way. An MCU containing an USART peripheral, as its name says, contains a "Universal Synchronous-Asynchronous Receiver/Transmitter". This is what the peripheral does: it can send and receive data either with a clock line or without. That's it. The specification of the actual implementation is up to the chip manufacturer. Configuration registers, possible configurations, the fact that the port has half or full duplex, etc., depend on the specific implementation. Generally those peripherals are flexible enough to be used to communicate with RS-232 (through a voltage converter of course), IrDA infrared ports, smartcards, serial buses like LIN, etc.

Compare for example the USART descriptions in the datasheets of different MCUs (I chose those MCUs because I have some familiarity with their datasheets, but it can be any other ones containing an USART...):

  • ATMega328P (see "USART0" on page 143)
  • PIC18F66K80 (see "EUSART0" on page 339, also note that it is named an "EUSART" here, where the E stays for enhanced, as it has more functions than other USARTs from the same MCU range)
  • STM32F4xx (see "USART" on page 965)

You will see that these peripherals have a lot of common functionality, but are implemented in different (although relatively similar) ways.

To study USARTs, therefore have a look at different MCUs so you will have a more general idea.

| improve this answer | |
  • \$\begingroup\$ It's so strange. There isn't any MCU with synchronous USART device that is fully compatible with a 25-pin RS-232. Also, there are lots of UART controller examples but there is no USART example. \$\endgroup\$ – JeJoRic Aug 12 '19 at 12:02
  • \$\begingroup\$ @JeJoRic As far as I know the 25-pin RS-232 port is almost never used nowadays, industrial equipment with a serial port usually uses the (asynchronous) 9-pin DE-9 connector. Are you aware of any equipment using a 25-pin RS-232 port that actually uses synchronous communication? \$\endgroup\$ – Ale Aug 12 '19 at 13:23
  • \$\begingroup\$ No, I'm not aware. I'm just curious about internals of these devices and trying to learn how these protocols work. Thanks for your help. \$\endgroup\$ – JeJoRic Aug 12 '19 at 13:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.