====== Exercises ====== The goal is to write a program which is able to perform tasks described below. ===== Warm up exercise ===== * To the computer is sent a number with grows once in a second. The number must be in a form of text and end with a row changing sign (\n). ===== For beginner ===== - For the commands (letter signs) which are coming through RS-232 interface from a computer are being waited. Command “R” lights green LED, “K” lights yellow LED and “P” red LED. “R” is switching all LEDs off. - If a button is pressed, the name of the corresponding button (S1, S2, S3) is received in the computer through the RS-232 interface. ===== For advanced ===== - The communication between two RS-232 controllers. If a button is pressed, the controller transmits to the controller the number of the button. When the number is received the status of a corresponding LED is changed. '1' → green, '2' → yellow, '3' → red. Requires two sets of controllers, but the software is identical for both controllers. - Make a “teletype” – device, which allows changing text messages between two controllers through RS-232 interface. Use LCD for displaying the messages. On the first row must be seen inserted message and on the second the last received message. For inserting the message a potentiometer and/or buttons may be used. ====== Questions ====== - Describe the UART package. - What is the baud rate? - What is the difference between full- and half duplexes. - Find at least 5 different sensors which are using serial interface. - What is the difference between UART and USART interfaces? Which is faster? - How is the SPI interface working? - Name interfaces, which enable connecting at least 100 devices to a single bus. - Name different topologies and explain their differences. - On what voltage level are RS-232 and UART connections happening? - How long time takes to transmit 1 MiB at the baud rate of 9600 bps, when there is 8 data-bits, 1 stop-bit and not parity control?