SlideShare a Scribd company logo
1 of 2
Download to read offline
Lab 7: 20 points
EE 337: Microprocessors Laboratory (Spring 2021)
Section: S2 (Third year UG)
Indian Institute of Technology Bombay
Date: March 12, 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.

More Related Content

What's hot (17)

Lab8 s1
Lab8 s1Lab8 s1
Lab8 s1
 
Lab8 s2
Lab8 s2Lab8 s2
Lab8 s2
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Lab6 s1
Lab6 s1Lab6 s1
Lab6 s1
 
Lab5 s2
Lab5 s2Lab5 s2
Lab5 s2
 
8051 Interrupts
8051 Interrupts8051 Interrupts
8051 Interrupts
 
Lab6 s2
Lab6 s2Lab6 s2
Lab6 s2
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)
 
Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-test
 
Intel Hex Format
Intel Hex FormatIntel Hex Format
Intel Hex Format
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentation
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
 
8051 Timers
8051 Timers8051 Timers
8051 Timers
 
Ecet 340 Teaching Effectively--tutorialrank.com
Ecet 340 Teaching Effectively--tutorialrank.comEcet 340 Teaching Effectively--tutorialrank.com
Ecet 340 Teaching Effectively--tutorialrank.com
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 p
 
Serial IO for 8051
Serial IO for 8051Serial IO for 8051
Serial IO for 8051
 
Embedded System Practical manual (1)
Embedded System Practical manual (1)Embedded System Practical manual (1)
Embedded System Practical manual (1)
 

Similar to Lab7 s2

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
 
RCCreator Guidance. Remote control adding (copy codes from your original remo...
RCCreator Guidance. Remote control adding (copy codes from your original remo...RCCreator Guidance. Remote control adding (copy codes from your original remo...
RCCreator Guidance. Remote control adding (copy codes from your original remo...Lidiia Nesterenko
 
Export option (copy codes from your original RC)
Export option (copy codes from your original RC)Export option (copy codes from your original RC)
Export option (copy codes from your original RC)Lidiia Nesterenko
 
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
 
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
 
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
 
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
 
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
 
Process Instrument Explorer Installation Instructions
Process Instrument Explorer Installation InstructionsProcess Instrument Explorer Installation Instructions
Process Instrument Explorer Installation Instructionsnoblex1
 
codesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUES
codesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUEScodesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUES
codesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUESEMERSON EDUARDO RODRIGUES
 
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
 
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
 
IJSRED-V2I2P57
IJSRED-V2I2P57IJSRED-V2I2P57
IJSRED-V2I2P57IJSRED
 

Similar to Lab7 s2 (20)

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
 
RCCreator Guidance. Remote control adding (copy codes from your original remo...
RCCreator Guidance. Remote control adding (copy codes from your original remo...RCCreator Guidance. Remote control adding (copy codes from your original remo...
RCCreator Guidance. Remote control adding (copy codes from your original remo...
 
Remote control adding
Remote control addingRemote control adding
Remote control adding
 
Export option (copy codes from your original RC)
Export option (copy codes from your original RC)Export option (copy codes from your original RC)
Export option (copy codes from your original RC)
 
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
 
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
 
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
 
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
 
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
 
Process Instrument Explorer Installation Instructions
Process Instrument Explorer Installation InstructionsProcess Instrument Explorer Installation Instructions
Process Instrument Explorer Installation Instructions
 
codesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUES
codesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUEScodesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUES
codesys-cmt-quick-start-guide EMERSON EDUARDO RODRIGUES
 
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...
 
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...
 
IJSRED-V2I2P57
IJSRED-V2I2P57IJSRED-V2I2P57
IJSRED-V2I2P57
 

More from rajbabureliance (8)

Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
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
 

Recently uploaded

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

Lab7 s2

  • 1. Lab 7: 20 points EE 337: Microprocessors Laboratory (Spring 2021) Section: S2 (Third year UG) Indian Institute of Technology Bombay Date: March 12, 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.