How to Interface UART with LPC2148-ARM7 Friendly

UART Interfacing With ARM7 Friendly

Tags: ARM7 LPC2148 Evaluation Board, Interfacing UART, Interfacing UART to Microcontroller, Interfacing UART with LPC2148 ARM7 Evaluation Board,Schematics to Interface UART with LPC2148 ARM7 Evaluation Board,C Program to display a text in PC from LPC2148 thr,
Overall rating
ARM7 LPC2148 Evaluation Board

The ARM7 LPC2148 Evaluation board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports in system programming (ISP) which is done through serial port.

NXP’s ARM7 (LPC2148), ARM Evaluation Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 32-bit Microcontrollers.


UART (Universal Asynchronous Receiver Transmitter) are one of the basic interfaces which provide a cost effective simple and reliable communication between one controller to another controller or between a controller and PC.

RS-232 Level Converter

Usually all the digital ICs work on TTL or CMOS voltage levels which cannot be used to communicate over RS-232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage levels. The most commonly used RS-232 level converter is MAX232.

This IC includes charge pump which can generate RS232 voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two transmitters and is capable of full-duplex UART/USART communication.

  • RS-232 communication enables point-to-point data transfer. It is commonly used in data acquisition applications, for the transfer of data between the microcontroller and a PC.
  • The voltage levels of a microcontroller and PC are not directly compatible with those of RS-232, a level transition buffer such as MAX232 be used.

Interfacing UART

Fig. 1 shows how to interface the UART to microcontroller. To communicate over UART or USART, we just need three basic signals which are namely, RXD (receive), TXD (transmit), GND (common ground). So to interface UART with LPC2148, we just need the basic signals.


Fig. 1 Interfacing UART to Microcontroller

Interfacing UART with LPC2148

Display a text in PC from LPC2148 Evaluation Board by using UART module. In LPC2148 Evaluation Board contains two serial interfaces that are UART0 & UART1. Here we are using UART1. The Transmitter pins send the data into PC and the receiver pin receives the data from PC.

Pin Assignment with LPC2148



UART DB-9 Connector


Processor Lines

Serial Port Section















Circuit Diagram to Interface UART with LPC2148


Source Code

The Interfacing UART with LPC2148 program is very simple and straight forward, which display a text in PC from LPC2148 Evaluation Board through UART1. Some delay is occurring when a single data is sent to PC.

C Program to display a text in PC from LPC2148


Title : Program to display a text in PC from LPC2148 through UART1




#define  CR  0x0D

#include <lpc214x.h>

#include <stdio.h>


void init_serial (void);


int putchar (int ch);

int getchar (void);

unsigned char test;

int main(void)


char *Ptr = "*** UART1 Demo ***\n\n\rType Characters to be echoed!!\n\n\r";

       VPBDIV = 0x02;




               while (*Ptr)








void init_serial (void)


      PINSEL0    = 0x00050005;

      U1LCR    = 0x00000083;

   U1DLL    = 0x000000C3;

      U1LCR    = 0x00000003;



int putchar (int ch)


         if (ch == '\n')


  while (!(U1LSR & 0x20));

  U1THR = CR;


   while (!(U1LSR & 0x20));

   return (U1THR = ch);



int getchar (void)


   while (!(U1LSR & 0x01));

   return (U1RBR);




To compile the above C code you need the KEIL software. They must be properly set up and a project with correct settings must be created in order to compile the code. To compile the above code, the C file must be added to the project.

In Keil, you want to develop or debug the project without any hardware setup. You must compile the code for generating HEX file. In debugging Mode, you want to check the port output without LPC2148 Evaluation Board.

The Flash Magic software is used to download the hex file into your microcontroller IC LPC2148 through UART0.

Testing the UART1 with LPC2148

Give +3.3V power supply to LPC2148 Evaluation Board; the serial cable is connected between the LPC2148 Evaluation Board and PC. Open the Hyper Terminal screen, select which port you are using and set the default settings. Now the screen should show some text messages.

If you not reading any text from UART0, then you just check the jumper connections & just check the serial cable is working. Otherwise you just check the code with debugging mode in Keil. If you want to see more details about debugging just see the videos in below link.

General Information

Join the World's Largest Technical Community

we respect your privacy.