A UART is a Universal Asynchronous Receiver-Transmitter. This is essentially what is being referred to when people mention a “serial port” on a computer. As the name expressly states, they are asynchronous which literally means they have no way to synchronise their communication between devices. This creates problems:
- Both sender and receiver must be configured to use the same transmission rate. This means you can’t (easily) switch between devices with different transmission capabilities. Indeed, since they can’t coordinate anything, you can’t have more than one sender and receiver on any communication line since the standard has only one transmit and one receive port and no way to tell if another device is using it.
- Transmission speeds are relatively slow, although, for a 3D printer, they are adequate.
- Since they are asynchronous (do not have a built-in clock signal) they are subject to framing errors wherein a listening device, that didn’t catch the beginning of a transmission, can’t tell where in the string of ones and zeros it is. This can lead to data corruption.
- To avoid the framing errors, Start and Stop bits are added to the transmission. Exactly how many must also be established when configuring the connection.
- If some of the data is lost, the communication will be garbled. For that reason they also often include a data Parity bit.
The UART formed the basis of RS232 communication that was the backbone of computer bulletin board systems, pre-Internet.
That same communication standard gets used in USB communications where the cable has 4 wires: V +D -D GND. Note there is no clock signal. +D and -D (identical but inverted data channels) are used to eliminate electrical noise in the line and thus increase transmission speed.
Hence, when you connect to your printer, you have to tell the terminal software how many data bits you are using, with what type of parity (Even/Odd/None), and how many stop bits.
8 Bits is the most common data length.
Parity bits identify errors, but with short and shielded cables errors are uncommon so you can usually get away setting this to NONE.
At least one stop bit is necessary to prevent framing errors.
Note that adding parity and stop bits increases the amount of data that has to be transmitted and slows down communication. You typically have to transmit 10 signal bits to send 8 bits of data, so there’s a 25% overhead. That was OK in the 80’s but with the data throughput needed these days, it’s a big penalty.
The major disadvantage to UART is that the host computer must be constantly prepared to receive data. If the receiver becomes overworked with other tasks, data will be lost. It’s CPU intensive, and yes, there are hardware work-arounds for this.
SPI is Motorola’s Serial Peripheral Interface. It was designed for use over short distances, often between devices on the same motherboard. It got around the problem that was created as more and more peripherals started populating single motherboards. Think of display drivers, stepper drivers, USB ports, D/A converters, A/D converters, LED controllers, etc. etc.
The number of copper traces needed to interconnect all these devices quickly became unmanageable. The SPI interface enabled peripherals that use it to communicate over a 3+1wire system. Each peripheral uses 1 Chip-Select connection (and hence 1 pin from the microcontroller) but shares the Data Out, Data In and Clock signals with all the other peripherals.
The Chip Select signal tells the peripheral to get ready to send or receive data. The Clock signal tells it exactly when to read a bit on the Data In Pin or send a bit on the Data Out pin.
The CPU that handles all this can start or stop the clock at any time depending on workload and the peripherals will wait. No start/stop or parity bits are needed and the CPU is in total control of the communication. It also has a maximum transmission rate (IIRC) of 12Mhz or about 100 times faster than a UART.
Disadvantage: Uses 1 pin on the CPU for every peripheral although there are workarounds for this.
“Sensorless Homing” is an oxymoron. You can’t tell if the print head is homed if you can’t sense it’s position. If the stall current in the stepper motors is being used to determine that the print head has impacted one barrier or another, then the stepper motors are the sensors.
The only concern I have about using the stepper stall current to sense a limit is that hey involve making the print head collide with something. That just feels wrong in the long run.
I have no words of wisdom wrt the TFT35 screen. I haven’t installed mine yet.