0% found this document useful (0 votes)
2 views22 pages

Uart 1

The document outlines the course 'ARM Processor & Applications' with specific outcomes for students, including programming in assembly language and developing C code for interfacing peripherals. It provides an overview of the LPC 2148 controller and details on the Universal Asynchronous Receiver and Transmitter (UART), including its registers and baud rate calculation. Additionally, it includes an algorithm for programming UART0 and a sample code for serial communication.

Uploaded by

Siddhu Narona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views22 pages

Uart 1

The document outlines the course 'ARM Processor & Applications' with specific outcomes for students, including programming in assembly language and developing C code for interfacing peripherals. It provides an overview of the LPC 2148 controller and details on the Universal Asynchronous Receiver and Transmitter (UART), including its registers and baud rate calculation. Additionally, it includes an algorithm for programming UART0 and a sample code for serial communication.

Uploaded by

Siddhu Narona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Course: ARM Processor & Applications

(15EECC207)

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 1


ATION ENGINEERING
Course: ARM Processor & Applications

Course Outcomes (COs):


At the end of the course the student should be able to:

i. Discuss advanced microprocessor architecture and


pipeline structure.
ii. Write assembly language programs with a tradeoff
between size and complexity and test it using
development tools.
iii. Develop an assembly level program for the given
application using ARM or THUMB or both instruction set.
iv. Discuss the concept of interrupt and their application.
v. Develop a C code for interfacing different ON/OFF board
peripheral devices to LPC 2148 controller.
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 2
ATION ENGINEERING
Unit-3
LPC 2148 Controller Architectural overview

Universal Asynchronous Receiver and


Transmitter (UART)

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 3


ATION ENGINEERING
Introduction

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 4


ATION ENGINEERING
Introduction
• Serial communication is classified into

• Synchronous Serial Communication

• Asynchronous Serial Communication

Universal Asynchronous Receiver and Transmitter (UART)

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 5


ATION ENGINEERING
Introduction
• The Universal Asynchronous Receiver/ Transmitter is the key
component of serial communications subsystem of a
computer.

• The UART takes bytes of data and transmits the individual bits
in a sequential fashion.

• At the destination, a second UART re-assembles the bits into


complete bytes.

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 6


ATION ENGINEERING
Introduction
• Agreed on message format-Frame Format
– Start and Stop bits
– Parity bit
• Agreed on speed

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 7


ATION ENGINEERING
UART Registers
1. Line Control Register (U0LCR & U1LCR)
2. Divisor Latch Register (U0DLL,U0DLM&U1DLL,U1DLM)

3. Transmit Buffer Register(U0THR & U1THR)

4. Receive Buffer Register(U0RBR & U1RBR)

5. Line Status Register(U0LSR & U1LSR)

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 8


ATION ENGINEERING
With these bit setting the
value in U0LCR =0x83

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 9


ATION ENGINEERING
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 10
ATION ENGINEERING
Baud Rate Calculation for UART0

• PCLK = 15MHz. For baud rate 9600, without using


fractional divider register, from the baud rate
formula, we have,

On reset, MulVal = 1 and DivAddVal = 0 in the Fractional Divider Register.


Hence,

• (256 x U0DLM + U0DLL) = 97.65 ~ 97= 0x61

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 11


ATION ENGINEERING
This will give U0DLM = 0x00
&
U0DLL =0x61

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 12


ATION ENGINEERING
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 13
ATION ENGINEERING
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 14
ATION ENGINEERING
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 15
ATION ENGINEERING
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 16
ATION ENGINEERING
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 17
ATION ENGINEERING
PINSEL0= 0x00000005
0 0 0 - - - 0 1 0 1

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 18


ATION ENGINEERING
Algorithm to Program UART0

• Configure P0.0 and P0.1 as TXD0 and RXD0 by writing 01 to


the corresponding bits in PINSEL0.
PINSEL0=0x00000005
• Using U0LCR register, make DLAB = 1. Also, select 8-bit
character length and 1 stop bit.
U0LCR=0x83
• Set appropriate values in U0DLL and U0DLM depending on
the PCLK value and the baud rate desired.
U0DLL=0x61

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 19


ATION ENGINEERING
#include<LPC21xx.h>

void delay(void);
void serial(void);
unsigned char mg; void serial()
{
int main() PINSEL0 = 0x00000005;
{
U0LCR = 0x83;
unsigned int i;
unsigned char msg[]={"BVB"}; U0DLL = 0x61;
serial(); U0LCR = 0x03;
}
while(1)
{
for(i=0;i<3;i++)
{
while(!(U0LSR & 0x20));
U0THR = msg[i];
} void delay()
{
while(!(U0LSR & 0x01)); unsigned int i;
mg=U0RBR;
for(i=0;i<10000;i++);
U0THR=mg;
delay(); }
}
}
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 20
ATION ENGINEERING
Summary
• What is Serial & Parallel Communication
• Asynchronous Serial Communication
– UART
• UART Registers
– LCR, DLL & DLM, THR, RBR, LSR
• UART Program

19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 21


ATION ENGINEERING
THANK
YOU
19/06/2025 SCHOOL OF ELECTRONICS AND COMMUNIC 22
ATION ENGINEERING

You might also like