Serial Communication With LPC2148

by embeddedbymedhavi in Circuits > Microcontrollers

74 Views, 0 Favorites, 0 Comments

Serial Communication With LPC2148

seriall.png

BASICS OF SERIAL COMMUNICATION:·

  • Serial communication uses single data line making it much cheaper·
  • enables two computers in different cities to communicate over the telephone·
  • Byte of data must be converted to serial bits using a parallel-in-serial-out shift register and transmitted over a single data line·
  • Receiving end there must be a serial-in-parallel-out shift register·
  • If transferred on the telephone line, it must be converted to audio tones by modem·
  • For short distance the signal can be transferred using wire·
  • how PC keyboards transfer data to the motherboard·
  • 2 methods, asynchronous and synchronous·
  • synchronous method transfers a block of data (characters) at a time·
  • asynchronous method transfers a single byte at a time·
  • Uses special IC chips called UART (universal asynchronous receiver-transmitter) and USART (universal synchronous asynchronous receiver-transmitter)

Data Transfer Rate

seriel 4.png

  • rate of data transfer bps (bits per second)
  • widely used terminology for bps is baud rate ·
  • baud and bps rates are not necessarily equal ·
  • baud rate is defined as the number of signal changes per second

RS232 Standards

serial 4.png
serrial 5.png

  • most widely used serial I/O interfacing standard
  • input and output voltage levels are not TTL compatible ·
  • 1 bit is represented by -3 to -25 V ·
  • 0 bit is +3 to +25 V ·
  • -3 to +3 is undefined ·
  • to connect RS232 to a microcontroller system must use voltage converters such as MAX232 to convert the TTL logic levels to the RS232 voltage levels, and vice versa ·
  • MAX232 IC chips are commonly referred to as line drivers

Data Communication Classification

serial6.png

  • DTE (data terminal equipment)·
  • DCE (data communication equipment)·
  • DTE - terminals and computers that send and receive data·
  • DCE - communication equipment responsible for transferring the data·
  • Simplest connection between a PC and microcontroller requires a minimum of three pins, TxD, RxD, and ground

ARM SERIAL PORT PROGRAMMING IN C:

  • Baud rate in the LPC2148:·
  • serial communications of the LPC2148 with the COM port of the PC·
  • must make sure that the baud rate of the LPC2148 system matches the baud rate of the PC's COM port·
  • can use Windows HyperTerminal program

Write a Program to Transfer Letter 'A' Serially at 9600 Baud, Continuously.

armtrans1.png

Simulation of transfer letter "A" is given in above.

C Code of transfer letter "A" :

Downloads

Write a Program to Transfer Letter "WELCOME TO ALL" and "GOD BLESS YOU " Serially at 9600 Baud, Continuously.

armtrans2.png

Simulation of transfer letter "WELCOME TO ALL" is given in above.

C Code of transfer letter "WELCOME TO ALL" :

Downloads

Program the LPC2148 to Receive Bytes of Data Serially and Put Them on LCD. Set the Baud Rate at 9600, 8-bit Data, and 1 Stop Bit.

avrreceive.png

Simulation of receive is given in above.

C Code of receive :

Downloads

Any Query related Embedded System , IOT and Raspberry PI go to My Blog:

embeddedbymedhavi