search.noResults

search.searching

saml.title
dataCollection.invalidEmail
note.createNoteMessage

search.noResults

search.searching

orderForm.title

orderForm.productCode
orderForm.description
orderForm.quantity
orderForm.itemPrice
orderForm.price
orderForm.totalPrice
orderForm.deliveryDetails.billingAddress
orderForm.deliveryDetails.deliveryAddress
orderForm.noItems
Digital & Communication Technology


For instance, when two devices use the same UART frame protocol, there are tendencies that, when connecting to the same UART without checking the configuration, the device will be connected to different pins that may cause malfunctions in the system.


Figure 8. Data bus to the transmitting UART.


Second: The transmitting UART adds the start bit, parity bit, and the stop bit(s) to the data frame.


On the other hand, implementing this ensures security because of the need to parse the information received in alignment with the design frame protocol. Each frame protocol is specifically designed to be unique and secure. In designing a frame protocol, designers can set the desired headers and trailers, including CRC, to different devices. In Figure 13, two (2) bytes are set as part of the header.


Second: Under memory map, check the UART address.


UART operations


When using any hardware communication protocol, it’s a prerequisite to check the data sheet and hardware reference manual. Here are the steps to follow:


First: Check the data sheet interface of the device. Table 2. Baud Rate Example Based on 26 MHz PCLK


there is a 26 MHz PCLK and 16 MHz PCLK available. Notice that OSR, DIV, DIVM, and DIVN varies per device.


Figure 14. Microcontroller data sheet. Table 3. Baud Rate Example Based on 16 MHz PCLK


Sixth: Next part is to check the detailed registers for UART Configuration. Take a look at the parameters in computing the baud rate such as UART_LCR2, UART_DIV, and UART_FBR. Table 4 will lead to a specific register to cover.


Figure 9. UART data frame at the Tx side.


Third: The entire packet is sent serially starting from start bit to stop bit from the transmitting UART to the receiving UART. The receiving UART samples the data line at the preconfigured baud rate.


Figure 13. Sample UART frame protocol.


Based on the sample, you can set a header, trailer, and CRC that are unique to your device.


Figure 15. Microcontroller memory map.


Header 1 (H1 is 0xAB) and Header 2 (H2 is 0xCD)


Header is the unique identifier that determines if you are communicating with the correct device.


Figure 10. UART transmission.


Fourth: The receiving UART discards the start bit, parity bit, and stop bit from the data frame.


Command (CMD) Selection Command will depend on the list of command designed to create the communication between two devices.


Data Length (DL) per Command Data length will be based on the command chosen. You can maximize the length of data depending on the command chosen, so it can vary based on the selection. In that case, the data length can be adjusted.


Figure 11. The UART data frame at the Rx side.


Fifth: The receiving UART converts the serial data back into parallel and transfers it to the data bus on the receiving end.


Data n (Varying Data)


Data is the payload to be transferred from devices.


Trailer 1 (T1 is 0xE1) and Trailer 2 (T2 is 0xE2)


Trailers are data that are added after the transmission is ended. Just like the Header, they can be uniquely identified.


Cyclic Redundancy Checking (CRC Formula)


Figure 12. Receiving UART to data bus. Frame protocol


One key feature that is available in UART yet not fully used is the implementation of a frame protocol. The main use and importance of this is an added value for security and protection on each device.


26 December/January 2021


The cycling redundancy checking formula is an added error detecting mode to detect accidental changes to raw data. The CRC value of the transmitting device must always be equal to the CRC computations on the receiver’s end. It is advisable to add security by implementing frame protocols for each UART device. The frame protocol needs identical configurations on both the transmitting and receiving devices.


Components in Electronics


Third: Check the specific details for the UART PORT such as the operation mode, data bits length, the parity bit, and stop bits. Sample UART port details in data sheet: UART Port The sample MCUs provide a full-duplex UART port, which is fully compatible with PC standard UARTs. The UART port provides a simplified UART interface to other peripherals or hosts, supporting full-duplex, DMA, and asynchronous transfer of serial data. The UART port includes support for five to eight data bits, and none, even, or odd parity. A frame is terminated by one and a half or two stop bits.


Fourth: Check the UART operation details, including the baud rate computation. Baud rate is configured using the following sample formula. This formula varies depending on the microcontroller.


Sample details of UART operations:


• 5 to 8 data bits • 1, 2, or 1 and ½ stop bits • None, or even or odd parity • Programmable oversample rate by 4, 8, 16, 32 • Baud rate = PCLK/((M + N/2048) × 2OSR + 2 × DIV


where, OSR (oversample rate) UART_LCR2.OSR = 0 to 3 DIV (baud rate divider) UART_DIV = 1 to 65535


M (DIVM fractional baud rate M) UART_FBR.DIVM = 1 to 3


N (DIVM fractional baud rate M) UART_FBR.DIVN = 0 to 2047


Fifth: For the baud rate, make sure to check what peripheral clock (PCLK) to use. In this example,


Table 4. UART Register Descriptions


Seventh: Under each register, check the details and substitute the values to compute for the baud rate, then start implementing the UART.


Why is it important?


Familiarity with the UART communication protocol is advantageous when developing robust, quality-driven products. Knowing how to send data using only two wires, as well as how to transport a whole pack of data or a payload, will help ensure that data is transferred and received without error. Since UART is the most commonly used hardware communication protocol, this knowledge can enable design flexibility in future designs.


Use cases


You can use UART for many applications, such as: • Debugging: Early detection of system bugs is important during development. Adding UART can help in this scenario by capturing messages from the system.


• Manufacturing function-level tracing: Logs are very important in manufacturing. They determine functionalities by alerting operators to what is happening on the manufacturing line.


• Customer or client updates: Software updates are highly important. Having complete, dynamic hardware with update- capable software is important to having a complete system.


• Testing/verification: Verifying products before they leave the manufacturing process helps deliver the best quality products possible to customers. analog.com


www.cieonline.co.uk


Page 1  |  Page 2  |  Page 3  |  Page 4  |  Page 5  |  Page 6  |  Page 7  |  Page 8  |  Page 9  |  Page 10  |  Page 11  |  Page 12  |  Page 13  |  Page 14  |  Page 15  |  Page 16  |  Page 17  |  Page 18  |  Page 19  |  Page 20  |  Page 21  |  Page 22  |  Page 23  |  Page 24  |  Page 25  |  Page 26  |  Page 27  |  Page 28  |  Page 29  |  Page 30  |  Page 31  |  Page 32  |  Page 33  |  Page 34  |  Page 35  |  Page 36  |  Page 37  |  Page 38  |  Page 39  |  Page 40  |  Page 41  |  Page 42  |  Page 43  |  Page 44  |  Page 45  |  Page 46  |  Page 47  |  Page 48  |  Page 49  |  Page 50  |  Page 51  |  Page 52  |  Page 53  |  Page 54