14 Kasım 2017 Salı

Universal Asynchronous Receiver Transmitter - UART

Giriş
Programlama dili ile yapılan ayarlar temelde seri portu yöneten UART çipinin programlaması anlamına geliyor. UART çipine benzeyen IIC'ye de bakabilirsiniz.

UART Çipi
Açıklaması şöyle
The serial port contains a special chip responsible for input and output of characters, as well as conversion of data words to their corresponding serial interface signals. This chip is called UART (Universal Asynchronous Receiver Transmitter). Another common name for the UART is SIO or "Serial Input/Output".
UART Çipindeki Register'lar
Açıklaması şöyle
The UART chip contains ten registers that are accessable externally(through software). A few additional registers, such as the receiver shift register and the transmitter shift register, can only be accessed internally. These registers are crucial for sending and receiving characters. When the UART receives a character, the incoming bits firs "pile up" in the reciever shift register until a complete data word has arrived. If no error has occurred, the byte is  then routed to the receive register, where it can be read by software.

In the opposite direction, the software first writes the data word to be sent to the transmitter holding register. From there the UART moves it into the internal transmitter shift register, from which the individual bits can be sent sequentially down the line. Therefore, the transmitter holding and receiver data registers are the most important in UART data transmission. However, we cannot ignore the other registers because they're needed to initialize the UART and check the transmission and line status.
UART'ın Yavaş Olmasının Sebebi
Açıklaması şöyle
The low speed interfaces assume full-swing logic level signals. When the speed becomes too high for the medium to maintain a good pulse shape, they give up. The high speed signals are small swing and assumed to be degraded by the transmission medium, and both transmitter and receiver take steps to mitigate this (pre-emphasis and equalisation respectively).

The low speed interfaces are single-ended, the high speed ones differential. At high speeds, you can't rely on a well controlled ground at the far end, you need to look at the difference in voltage between two signal lines.

The low speed interfaces have the clock generated from just one end. In read mode, that requires an out and back round trip of the transmission distance, severely limiting the data rate. The high speed interfaces are source synchronous, clock and data (sometimes) or data with clock/timing embedded in it (more common) are sent from whichever node is transmitting.

Some interfaces make use of some of these improvements, but it really takes all of them to increase speeds significantly. UART for instance uses timing embedded in the data.
UART Tek Seri İletişim Yöntemi Değildir
Açıklaması şöyle
A UART (Universal Asynchronous Receiver-Transmitter) is a particular kind of hardware device that uses digital sampling to convert serial data that uses embedded start and stop bits for synchronization into and from parallel data. Not all forms serial communication use start and stop bits, and not all devices that use this form of serial communication uses some sort of UART hardware. A serial port could be something completely different.
Seri İletişim için kullanılan diğer yöntemler şöyle
However it also possible to implement an asynchronous serial device in software using a technique called bit banging. This was done on old computers like the Commodore 64 in order to save money, and is still done from time to time in modern embedded applications for the same reason.

Finally there are other ways of transmitting data serially, like synchronous serial communication methods where a separate clock signal is transmitted alongside the serial data. In fact many modern computer interfaces, like USB, Serial ATA and PCI Express are actually serial devices. So while a "serial port" normally refers to an asynchronous serial device usually implemented with some sort of UART, strictly speaking it could potentially mean a wide range of devices. By calling the hardware device used a "UART", and the software driver for it a "UART driver" the diagram you've shown in your question is being more precise about what its describing.
Bit Sırası
Eğer osiloskop ile bakarsak önce LSB bitlerin gönderildiği görülebilir. Açıklaması şöyle.
UARTs usually send the least-significant bit first

Hiç yorum yok:

Yorum Gönder