SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
Lab 8: 20 points
EE 337: Microprocessors Laboratory (Spring 2022)
Indian Institute of Technology Bombay
Date: March 15, 2022
From this lab, you will be starting to use embedded C instead of assembly language to write
your programs. Please note the following.
• The Moodle announcement of this lab has a zip file attached containing skeleton code for
this lab.
• If you face issues with connecting the USB-to-UART adapter to your laptop, please contact
WEL staff member Mahesh Bhaganagare mab@ee.iitb.ac.in to get access to a WEL PC.
Apple laptop users may face this issue. The lab PCs are busy during other lab slots. So,
do not wait till the last minute to contact Mahesh.
1. [5 points] In this question, you shall once again interface the speaker using 8051, but instead
of playing a song, you shall generate the Morse Code of 5 different symbols, which shall
be given as input using the switches. To choose the symbol using input, use a priority
encoder type logic as shown below. Note that the below code is Python-style pseudocode
and cannot be used for the 8051. You have to rewrite this logic in C.
if P1_0:
symbol1
elif P1_1:
symbol2
elif P1_2:
symbol3
elif P1_3:
symbol4
else:
symbol5
In the above logic, the following is true.
• symbol1 represents the letter ’A’
• symbol2 represents the letter ’B’
• symbol3 represents the letter ’C’
• symbol4 represents the letter ’D’
• symbol5 represents the letter ’E’.
The Morse code for these symbols can be found at https://en.wikipedia.org/wiki/
Morse_code.
A Dot should be represented by 750ms duration of a single frequency and a Dash by 1500ms
of the same frequency. The exact frequency are irrelevant. Between consecutive sounds,
there must be a 1000ms pause. Additionally, the character should be displayed on the LCD
screen as well. Use the functions provided in ’LCD.h’ to achieve the same.
The Morse code for the corresponding symbol should play only once per reset. At reset, the
symbol must be played as per the value on the switches and to play a new symbol, switch
positions must be changed.
You may use the skeleton code provided for this question. Shoot a 30 second video of
your kit emitting all five symbols. Make sure your face appears at the beginning
of the video. The video needs to be uploaded using the Video upload link for lab 8
assignment in the course team on MS Teams (it has an option to attach files). The file size
cannot exceed 200 MB.
2. [15 points] Refer to Prof. Dinesh Sharma’s slides and notes on serial I/O to do this question.
https://ee337.github.io/dks.html#serial-io
In this question, 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 keyboard
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 4800 (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 4800 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 “EE
337” 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
serially (In any order you like) with a gap of 500ms and display “LED tested” on
the Realterm window after the pattern is shown. 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. For question 1, check that the student has used the correct logic to generate the sounds.
2. For question 2, verify that the student can demonstrate the UART setup.

Más contenido relacionado

La actualidad más candente

Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interruptTech_MX
 
Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testrajbabureliance
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 prsamurti
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 prsamurti
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Sivaranjan Goswami
 
Assembly programming
Assembly programmingAssembly programming
Assembly programmingOmar Sanchez
 
10 chapter05 counters_fa14
10 chapter05 counters_fa1410 chapter05 counters_fa14
10 chapter05 counters_fa14John Todora
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler ProgrammingOmar Sanchez
 
8051 assembly programming
8051 assembly programming8051 assembly programming
8051 assembly programmingsergeiseq
 

La actualidad más candente (19)

Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interrupt
 
Lab8 s1
Lab8 s1Lab8 s1
Lab8 s1
 
Lab7 s2
Lab7 s2Lab7 s2
Lab7 s2
 
Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-test
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab6 s1
Lab6 s1Lab6 s1
Lab6 s1
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
 
Lab4 s2
Lab4 s2Lab4 s2
Lab4 s2
 
Lab3 s1
Lab3 s1Lab3 s1
Lab3 s1
 
C programming part2
C programming part2C programming part2
C programming part2
 
Mp lab manual
Mp lab manualMp lab manual
Mp lab manual
 
Lab6 s2
Lab6 s2Lab6 s2
Lab6 s2
 
Assembly programming
Assembly programmingAssembly programming
Assembly programming
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
10 chapter05 counters_fa14
10 chapter05 counters_fa1410 chapter05 counters_fa14
10 chapter05 counters_fa14
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler Programming
 
8051 assembly programming
8051 assembly programming8051 assembly programming
8051 assembly programming
 

Similar a Lab8 of EE337 Microprocessors Lab, 2022, IIT Bombay

Larson and toubro
Larson and toubroLarson and toubro
Larson and toubroanoopc1998
 
Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)Ronza Sameer
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)Mashood
 
3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesisThanh Nguyen
 
Bascom avr-course
Bascom avr-courseBascom avr-course
Bascom avr-coursehandson28
 
Tutorial Penggunaan CodeVision AVR dengan Bahasa C
Tutorial Penggunaan CodeVision AVR dengan Bahasa CTutorial Penggunaan CodeVision AVR dengan Bahasa C
Tutorial Penggunaan CodeVision AVR dengan Bahasa CMuhammad Kennedy Ginting
 
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
 
Cpu224 xp eth-ethernet_interface
Cpu224 xp eth-ethernet_interfaceCpu224 xp eth-ethernet_interface
Cpu224 xp eth-ethernet_interfacearco zhang
 
Quantum composers white paper ethernet connectivity
Quantum composers white paper  ethernet connectivityQuantum composers white paper  ethernet connectivity
Quantum composers white paper ethernet connectivityQuantum Composers
 
Cvavr getting started with atmel studio
Cvavr getting started with atmel studioCvavr getting started with atmel studio
Cvavr getting started with atmel studioBayu Agung
 
Bill redirect manual
Bill redirect manualBill redirect manual
Bill redirect manualtopomax
 
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
 
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
 
Instructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docxInstructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docxnormanibarber20063
 
Assembly Language In Electronics
Assembly Language In ElectronicsAssembly Language In Electronics
Assembly Language In ElectronicsAsaduzzaman Kanok
 

Similar a Lab8 of EE337 Microprocessors Lab, 2022, IIT Bombay (20)

Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Larson and toubro
Larson and toubroLarson and toubro
Larson and toubro
 
Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)Report 2 microp.(microprocessor)
Report 2 microp.(microprocessor)
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)
 
3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis
 
Bascom avr-course
Bascom avr-courseBascom avr-course
Bascom avr-course
 
Tutorial Penggunaan CodeVision AVR dengan Bahasa C
Tutorial Penggunaan CodeVision AVR dengan Bahasa CTutorial Penggunaan CodeVision AVR dengan Bahasa C
Tutorial Penggunaan CodeVision AVR dengan Bahasa C
 
Resume
ResumeResume
Resume
 
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
 
Cpu224 xp eth-ethernet_interface
Cpu224 xp eth-ethernet_interfaceCpu224 xp eth-ethernet_interface
Cpu224 xp eth-ethernet_interface
 
Quantum composers white paper ethernet connectivity
Quantum composers white paper  ethernet connectivityQuantum composers white paper  ethernet connectivity
Quantum composers white paper ethernet connectivity
 
Cvavr getting started with atmel studio
Cvavr getting started with atmel studioCvavr getting started with atmel studio
Cvavr getting started with atmel studio
 
Bill redirect manual
Bill redirect manualBill redirect manual
Bill redirect manual
 
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
 
Embedded concepts
Embedded conceptsEmbedded concepts
Embedded concepts
 
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
 
Instructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docxInstructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docx
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to Microcontrollers
 
Assembly Language In Electronics
Assembly Language In ElectronicsAssembly Language In Electronics
Assembly Language In Electronics
 

Más de SaravananVijayakumar4

Más de SaravananVijayakumar4 (15)

EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5
 
EE337 Spring 2023 Lab1
EE337 Spring 2023 Lab1EE337 Spring 2023 Lab1
EE337 Spring 2023 Lab1
 
EE337 Microprocessor Lab, Course Outline, Spring 2023
EE337 Microprocessor Lab, Course Outline, Spring 2023EE337 Microprocessor Lab, Course Outline, Spring 2023
EE337 Microprocessor Lab, Course Outline, Spring 2023
 
EE337 Course introduction 2021
EE337 Course introduction 2021EE337 Course introduction 2021
EE337 Course introduction 2021
 
Pt 51 ver-1.3_user_manual
Pt 51 ver-1.3_user_manualPt 51 ver-1.3_user_manual
Pt 51 ver-1.3_user_manual
 
EE 337 Lab 1 for Section 1 (2nd year UG)
 EE 337 Lab 1 for Section 1 (2nd year UG) EE 337 Lab 1 for Section 1 (2nd year UG)
EE 337 Lab 1 for Section 1 (2nd year UG)
 
EE 337 Lab 1 for Section 2 (3rd year UG)
EE 337 Lab 1 for Section 2 (3rd year UG)EE 337 Lab 1 for Section 2 (3rd year UG)
EE 337 Lab 1 for Section 2 (3rd year UG)
 
Getting started with Keil uVision 2020
Getting started with Keil uVision 2020Getting started with Keil uVision 2020
Getting started with Keil uVision 2020
 
EE337 Course introduction 2021
EE337 Course introduction 2021EE337 Course introduction 2021
EE337 Course introduction 2021
 
Hex file creation using Keil uVision
Hex file creation using Keil uVisionHex file creation using Keil uVision
Hex file creation using Keil uVision
 
Debugging programs with Keil uVision
Debugging programs with Keil uVisionDebugging programs with Keil uVision
Debugging programs with Keil uVision
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
89c5131datasheet
89c5131datasheet89c5131datasheet
89c5131datasheet
 
Pt-51 User Manual
Pt-51 User ManualPt-51 User Manual
Pt-51 User Manual
 
EE337 Course introduction 2018
EE337 Course introduction 2018EE337 Course introduction 2018
EE337 Course introduction 2018
 

Último

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
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
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Último (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
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
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
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
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
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 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Lab8 of EE337 Microprocessors Lab, 2022, IIT Bombay

  • 1. Lab 8: 20 points EE 337: Microprocessors Laboratory (Spring 2022) Indian Institute of Technology Bombay Date: March 15, 2022 From this lab, you will be starting to use embedded C instead of assembly language to write your programs. Please note the following. • The Moodle announcement of this lab has a zip file attached containing skeleton code for this lab. • If you face issues with connecting the USB-to-UART adapter to your laptop, please contact WEL staff member Mahesh Bhaganagare mab@ee.iitb.ac.in to get access to a WEL PC. Apple laptop users may face this issue. The lab PCs are busy during other lab slots. So, do not wait till the last minute to contact Mahesh. 1. [5 points] In this question, you shall once again interface the speaker using 8051, but instead of playing a song, you shall generate the Morse Code of 5 different symbols, which shall be given as input using the switches. To choose the symbol using input, use a priority encoder type logic as shown below. Note that the below code is Python-style pseudocode and cannot be used for the 8051. You have to rewrite this logic in C. if P1_0: symbol1 elif P1_1: symbol2 elif P1_2: symbol3 elif P1_3: symbol4 else: symbol5 In the above logic, the following is true. • symbol1 represents the letter ’A’ • symbol2 represents the letter ’B’ • symbol3 represents the letter ’C’ • symbol4 represents the letter ’D’ • symbol5 represents the letter ’E’. The Morse code for these symbols can be found at https://en.wikipedia.org/wiki/ Morse_code. A Dot should be represented by 750ms duration of a single frequency and a Dash by 1500ms of the same frequency. The exact frequency are irrelevant. Between consecutive sounds, there must be a 1000ms pause. Additionally, the character should be displayed on the LCD screen as well. Use the functions provided in ’LCD.h’ to achieve the same. The Morse code for the corresponding symbol should play only once per reset. At reset, the symbol must be played as per the value on the switches and to play a new symbol, switch positions must be changed. You may use the skeleton code provided for this question. Shoot a 30 second video of your kit emitting all five symbols. Make sure your face appears at the beginning of the video. The video needs to be uploaded using the Video upload link for lab 8 assignment in the course team on MS Teams (it has an option to attach files). The file size cannot exceed 200 MB.
  • 2. 2. [15 points] Refer to Prof. Dinesh Sharma’s slides and notes on serial I/O to do this question. https://ee337.github.io/dks.html#serial-io In this question, 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 keyboard 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 4800 (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 4800 bps.
  • 3. 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 “EE 337” 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 serially (In any order you like) with a gap of 500ms and display “LED tested” on the Realterm window after the pattern is shown. 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. For question 1, check that the student has used the correct logic to generate the sounds.
  • 4. 2. For question 2, verify that the student can demonstrate the UART setup.