SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
Lab 7: 20 points
EE 337: Microprocessors Laboratory (Spring 2021)
Section: S1 (Second year UG)
Indian Institute of Technology Bombay
Date: March 17, 2021
Refer to Prof. Dinesh Sharma’s slides and notes on serial I/O to do this lab.
1. [20 points] In this lab you will understand and use a program for communicating between
Pt-51 and a computer using UART. This program will take inputs from the computer’s key-
board that can be used in programs running on the kit, to perform appropriate operations.
i) To connect the kit to a computer, you will be using the USB-to-UART adapter
Prolific PL2303 (Fig. 1) that was shipped along with the kit. The driver software
for this adapter and the instructions for installing it can be found at the following link:
http://www.miklor.com/COM/UV_Drivers.php
After installing the software, connect the PL2303 adapter to one of the USB ports of
your PC.
Figure 1: USB to UART adapter.
ii) Connect the Pt-51 kit to the USB-to-UART adapter using F-F wires as described
next. In the Pt-51 kit, port pin P3.0 is the serial data input and P3.1 is the serial
data output. Connect P3.0 of the kit to transmit data line (TxD) of the adapter.
Connect P3.1 of the kit to receive data line (RxD) of the adapter. Connect the GND
pin of the kit to GND pin of adapter.
iii) For recognizing keyboard inputs on the computer and transmitting to the kit, through
the serial terminal, you need to use the Realterm software (or any equivalent software).
This software will also be used to display the messages received from the Pt-51 kit on
the PC. A screenshot of Realterm window is shown in Fig. 2.
For Windows, download Realterm at: https://realterm.i2cchip.com
For Linux, you can download putty.
iv) Configure Realterm (or equivalent tool) to use the appropriate COM port and baud
rate. This can be done by clicking on Serial Port/ Port tab and choosing appropriate
COM port as the port to which the USB-to-UART adapter is connected. Set the baud
rate to 1200 (or that used in your program). Then click on Open.
With the kit connected to the computer using the USB-to-UART adapter, you will next
write code to recognize key presses, perform an operation on the kit, and display messages
sent by the kit on the computer.
Use main.c as starting (template) code. This uses serial.c and lcd.h for initialisation of
UART and LCD, respectively. These files are part of the zip file shared with you.
The flow of the program is given below.
1. Complete the function uart init() in serial.c to configure the serial port for UART
communication. Use timer T1 and a baud rate of 1200 bps.
Figure 2: RealTerm: Serial/TCP Terminal
2. The given main.c has code for transmitting a set of strings and to capture a key
press on the PC. Compile the project, dump the hex file on to Pt-51 and run the
program. Launch the Realterm window on your PC and you can see that the following
is displayed on the window.
************************
******8051 Tests********
************************
Press 1 to test the LCD
Press 2 to test the LED
3. Now, Pt-51 should be respond to the key presses on the PC’s keyboard. With Realterm
window in focus (active window), any key press on PC’s keyboard will be captured by
it and transferred to Pt-51.
• When 1 is pressed, it will be detected by Pt-51 and you will see a message “LCD
Ok” on the LCD screen and “LCD tested” display on the Realterm window. This
happens because of the function lcd test in main.c.
• When 2 is pressed, it should be detected by pt-51 and should glow all four LEDs
and display “LED tested” on the Realterm window. For this to happen, you will
have to update the function led test in main.c
• When any other key is pressed, you will see the message “Incorrect key pressed”
displayed on the Realterm window.
TA Checkpoints
1. Verify that the student can demonstrate the UART setup.

Más contenido relacionado

Similar a Pt-51 UART Lab

Rodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationRodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationFelipe Prado
 
Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)Ronza Sameer
 
Larson and toubro
Larson and toubroLarson and toubro
Larson and toubroanoopc1998
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)Mashood
 
XBMC USB Controller for Media Center PCs
XBMC USB Controller for Media Center PCsXBMC USB Controller for Media Center PCs
XBMC USB Controller for Media Center PCsDilshan Jayakody
 
Enabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesEnabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesPiotr Król
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonGabriel Arnautu
 
Bluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything IndiaBluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything IndiaDcube Tech Ventures
 
Embedded Tsunami Warning System
Embedded Tsunami Warning System Embedded Tsunami Warning System
Embedded Tsunami Warning System cscpconf
 
Bluetooth remote control... from your mobile phone
Bluetooth remote control... from your mobile phoneBluetooth remote control... from your mobile phone
Bluetooth remote control... from your mobile phoneBebe Bilguun
 
Process Instrument Explorer Installation Instructions
Process Instrument Explorer Installation InstructionsProcess Instrument Explorer Installation Instructions
Process Instrument Explorer Installation Instructionsnoblex1
 
I need help with this assignment, using atmel studio 7.0Place a l.pdf
I need help with this assignment, using atmel studio 7.0Place a l.pdfI need help with this assignment, using atmel studio 7.0Place a l.pdf
I need help with this assignment, using atmel studio 7.0Place a l.pdfmichaelazach6427
 
Quantum composers white paper ethernet connectivity
Quantum composers white paper  ethernet connectivityQuantum composers white paper  ethernet connectivity
Quantum composers white paper ethernet connectivityQuantum Composers
 
Embedded c lab and keil c manual
Embedded  c  lab  and keil c  manualEmbedded  c  lab  and keil c  manual
Embedded c lab and keil c manualHari K
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docxjack60216
 
IJSRED-V2I2P57
IJSRED-V2I2P57IJSRED-V2I2P57
IJSRED-V2I2P57IJSRED
 
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...IJSRD
 

Similar a Pt-51 UART Lab (20)

Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Rodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationRodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementation
 
Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)
 
Larson and toubro
Larson and toubroLarson and toubro
Larson and toubro
 
Remote control adding
Remote control addingRemote control adding
Remote control adding
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)
 
XBMC USB Controller for Media Center PCs
XBMC USB Controller for Media Center PCsXBMC USB Controller for Media Center PCs
XBMC USB Controller for Media Center PCs
 
Xgt training
Xgt trainingXgt training
Xgt training
 
Enabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesEnabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devices
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel Edison
 
Bluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything IndiaBluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything India
 
Embedded Tsunami Warning System
Embedded Tsunami Warning System Embedded Tsunami Warning System
Embedded Tsunami Warning System
 
Bluetooth remote control... from your mobile phone
Bluetooth remote control... from your mobile phoneBluetooth remote control... from your mobile phone
Bluetooth remote control... from your mobile phone
 
Process Instrument Explorer Installation Instructions
Process Instrument Explorer Installation InstructionsProcess Instrument Explorer Installation Instructions
Process Instrument Explorer Installation Instructions
 
I need help with this assignment, using atmel studio 7.0Place a l.pdf
I need help with this assignment, using atmel studio 7.0Place a l.pdfI need help with this assignment, using atmel studio 7.0Place a l.pdf
I need help with this assignment, using atmel studio 7.0Place a l.pdf
 
Quantum composers white paper ethernet connectivity
Quantum composers white paper  ethernet connectivityQuantum composers white paper  ethernet connectivity
Quantum composers white paper ethernet connectivity
 
Embedded c lab and keil c manual
Embedded  c  lab  and keil c  manualEmbedded  c  lab  and keil c  manual
Embedded c lab and keil c manual
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
 
IJSRED-V2I2P57
IJSRED-V2I2P57IJSRED-V2I2P57
IJSRED-V2I2P57
 
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...
 

Más de rajbabureliance (18)

Lab8 s1
Lab8 s1Lab8 s1
Lab8 s1
 
Lab8 s2
Lab8 s2Lab8 s2
Lab8 s2
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab6 s1
Lab6 s1Lab6 s1
Lab6 s1
 
Lab6 s2
Lab6 s2Lab6 s2
Lab6 s2
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Lab5 s2
Lab5 s2Lab5 s2
Lab5 s2
 
Lab4 s2
Lab4 s2Lab4 s2
Lab4 s2
 
Lab4 s1
Lab4 s1Lab4 s1
Lab4 s1
 
Lab3 s1
Lab3 s1Lab3 s1
Lab3 s1
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-test
 
Lab2 s1
Lab2 s1Lab2 s1
Lab2 s1
 
Lab2 s2
Lab2 s2Lab2 s2
Lab2 s2
 
EE337 Course Introduction
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introduction
 
EE337 Course Introduction
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introduction
 

Último

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Último (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Pt-51 UART Lab

  • 1. Lab 7: 20 points EE 337: Microprocessors Laboratory (Spring 2021) Section: S1 (Second year UG) Indian Institute of Technology Bombay Date: March 17, 2021 Refer to Prof. Dinesh Sharma’s slides and notes on serial I/O to do this lab. 1. [20 points] In this lab you will understand and use a program for communicating between Pt-51 and a computer using UART. This program will take inputs from the computer’s key- board that can be used in programs running on the kit, to perform appropriate operations. i) To connect the kit to a computer, you will be using the USB-to-UART adapter Prolific PL2303 (Fig. 1) that was shipped along with the kit. The driver software for this adapter and the instructions for installing it can be found at the following link: http://www.miklor.com/COM/UV_Drivers.php After installing the software, connect the PL2303 adapter to one of the USB ports of your PC. Figure 1: USB to UART adapter. ii) Connect the Pt-51 kit to the USB-to-UART adapter using F-F wires as described next. In the Pt-51 kit, port pin P3.0 is the serial data input and P3.1 is the serial data output. Connect P3.0 of the kit to transmit data line (TxD) of the adapter. Connect P3.1 of the kit to receive data line (RxD) of the adapter. Connect the GND pin of the kit to GND pin of adapter. iii) For recognizing keyboard inputs on the computer and transmitting to the kit, through the serial terminal, you need to use the Realterm software (or any equivalent software). This software will also be used to display the messages received from the Pt-51 kit on the PC. A screenshot of Realterm window is shown in Fig. 2. For Windows, download Realterm at: https://realterm.i2cchip.com For Linux, you can download putty. iv) Configure Realterm (or equivalent tool) to use the appropriate COM port and baud rate. This can be done by clicking on Serial Port/ Port tab and choosing appropriate COM port as the port to which the USB-to-UART adapter is connected. Set the baud rate to 1200 (or that used in your program). Then click on Open. With the kit connected to the computer using the USB-to-UART adapter, you will next write code to recognize key presses, perform an operation on the kit, and display messages sent by the kit on the computer. Use main.c as starting (template) code. This uses serial.c and lcd.h for initialisation of UART and LCD, respectively. These files are part of the zip file shared with you. The flow of the program is given below. 1. Complete the function uart init() in serial.c to configure the serial port for UART communication. Use timer T1 and a baud rate of 1200 bps.
  • 2. Figure 2: RealTerm: Serial/TCP Terminal 2. The given main.c has code for transmitting a set of strings and to capture a key press on the PC. Compile the project, dump the hex file on to Pt-51 and run the program. Launch the Realterm window on your PC and you can see that the following is displayed on the window. ************************ ******8051 Tests******** ************************ Press 1 to test the LCD Press 2 to test the LED 3. Now, Pt-51 should be respond to the key presses on the PC’s keyboard. With Realterm window in focus (active window), any key press on PC’s keyboard will be captured by it and transferred to Pt-51. • When 1 is pressed, it will be detected by Pt-51 and you will see a message “LCD Ok” on the LCD screen and “LCD tested” display on the Realterm window. This happens because of the function lcd test in main.c. • When 2 is pressed, it should be detected by pt-51 and should glow all four LEDs and display “LED tested” on the Realterm window. For this to happen, you will have to update the function led test in main.c • When any other key is pressed, you will see the message “Incorrect key pressed” displayed on the Realterm window. TA Checkpoints 1. Verify that the student can demonstrate the UART setup.