1 / 16

University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering

University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering. Microcontroller Lab. 4:. Serial communication using USART module. In this session. Review the previous session. How to interface and use LCDs. How to interface Keypads.

penney
Download Presentation

University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering Microcontroller Lab. 4: Serial communication using USART module

  2. In this session • Review the previous session. • How to interface and use LCDs. • How to interface Keypads. • To implement serial communication between MCU and PC using USART.

  3. LCD Device • A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). • They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones.

  4. LCD Device

  5. Keypads

  6. Keypads

  7. Serial Communication • Terminologies • Synchronization of Serial Transmission: allows both the transmitter and receiver to be expecting data transmission/ reception at the same time. • There are two basic methods of maintaining ‘‘sync’’: • - Asynchronous: Framing bits are used at the beginning and end of a data byte which alert the receiver that an incoming data byte has arrived and also signals the completion of the data byte reception. • - Synchronous: Data bits are sent and received on the edge of common clock.

  8. Serial Communication • Terminologies • Baud Rate: Data transmission rates which is specified as a baud or bits per second rate. • Duplex: A single duplex system has a single complement of hardware that must be switched from transmission to reception configuration.

  9. Serial USART • The ATmega32 is equipped with different serial communication subsystems, including the serial USART, SPI, and TWI. • USART: Universal Synchronous and Asynchronous serial Receiver and Transmitter. • - Full duplex. • - It has the capability to be set to a variety of data • transmission rates rate.

  10. Serial USART

  11. Serial USART • The initialization process of USART normally consists of - Setting the baud rate. - Setting frame format. - Enabling the Transmitter or/and the Receiver depending on the usage. - For interrupt driven USART operation, the Global Interrupt Flag should be cleared (and interrupts globally disabled) when doing the initialization

  12. Frame Formatting • A serial frame is defined to be one character of data bits with synchronization bits (start and stop bits), and optionally a parity bit for error checking.

  13. USART Registers - USART I/O Data Register (UDR) The USART Transmit Data Buffer Register and USART Receive Data Buffer Registers share the same I/O address referred to as USART Data Register or UDR. • USART Control and Status Register A – (UCSRA) Bit 7 – RXC: USART Receive Complete This flag bit is set when there are unread data in the receive buffer and cleared when the receive buffer is empty (i.e., does not contain any unread data).

  14. Frame Formatting • - Bit 5 – UDRE: USART Data Register Empty • The UDRE Flag indicates if the transmit buffer (UDR) is ready to receive new data. If UDRE is one, the buffer is empty, and therefore ready to be written.

  15. MAX232 • Logic Convertor

  16. Any Questions

More Related