Serial port settings for the Pi

To communicate with the EMS bus you need to understand how the serial port of the Pi works. The Raspberry Pi is generally easy to use, but its serial port might be very confusing.

Raspberry Pi serial port

The Raspberry Pi has one physical serial port on GPIO14 (TX) and GPIO15 (RX). But internally, it has 2 UARTs (serial port controllers) called the ‘mini UART’ and the ‘PL011’. Both of these controllers can be mapped onto the physical serial port. Depending on the Raspberry Pi model you are using, the default mapping can be different.

In Linux these UART’s are reffered to as /dev/ttyS0 and /dev/ttyAMA0 and for these references there are also symlinks serial0 and serial1. Please read the UART documentation page 1 on the Raspberry Pi website carefully before continuing so you have a better understanding of this.

Turning off the Linux serial console

By default, when you boot up the Pi, it creates a Linux console serial port interface on GPIO14 and GPIO15. This needs to be turned off as it interferes with the EMS bus and messes up SSH if the EMS bus is connected to the Pi. See the UART documentation page 1 for instructions.

Which UART to use

You could say the mini UART is the simple UART and PL011 is the advanced UART. The EMS bus has a unique way of signalling the end of messages on the bus. Its called a BREAK signal, but its not a standard BREAK as used in other serial communication. To communicate with the EMS bus this non-convential BREAK signal needs to be both detected and generated by the UART. The mini UART cannot do this, but luckily the PL011 can.

Setting the right UART

So for communicating with the EMS but you need to use the PL011. In order to do so, it needs to be the primary UART in so it will be mapped to GPIO14 and GPIO15. You have to make sure its the PL011 that is the primary UART, but depending on your model of Pi, the PL011 might be connected to the Bluetooth module instead. View the instruction in this article 2 to set it correctly.

1(1,2)

https://www.raspberrypi.org/documentation/configuration/uart.md

2

https://www.abelectronics.co.uk/kb/article/1035/raspberry-pi-3–4-and-zero-w-serial-port-usage