Question
Part A. [30 points] For this lab, you will implement serial communications with 8051. For this purpose, you will be using two virtual terminals (under
Part A. [30 points]
For this lab, you will implement serial communications with 8051. For this purpose, you will be using two virtual terminals (under instruments tab, same place that you picked oscilloscope.) For the first part, you will send and receive a string. When the string is input from the first terminal, you should record and send the part beginning with the character # and ending with the character *. Then, this recorded part will be sent to the receiving second terminal. For example, if the string my#str* is the input from the first terminal, you should send str to the second terminal. Note that the sub-string between the characters # and * will always be at most 20 characters.
Also note that you will use a Baud Rate of 9600 bps, and should set the terminal accordingly. You should also set the clock frequency of the microcontroller to 11.0592 MHz; otherwise, you will likely send and receive garbage data from the terminal.
Part B [70 points]
In this part, you will implement a simple encryption algorithm using two terminals. The input will be given from the first terminal, labeled input terminal, and an encrypted or de-crypted version of the input will be sent to the second terminal, labeled output terminal. For this purpose, you will use the Columnar Transposition encryption. The link containing detailed information about this encryption method is given below.
The input message will always be in the form of KEY:ABCD#INPUT_STRING* where ABCD will be a four character key for the Columnar Transposition, and INPUT_STRING will be 16 character message that will be either encrypted or decrypted.
You will implement a button to switch between encryption and decryption modes. The microcontroller will be in the encryption mode initially, and if the button pressed it will go into decryption mode. Note that, the button can be pressed as many as desired.
A sample input-output map is given below:
MODE | Input Terminal | Output Terminal |
Encryption Mode | KEY:DUCK#ITISASAMPLEINPUT* | IAEUIAPNSMITTSLP |
Decryption Mode | KEY:DUCK#IAEUIAPNSMITTSLP* | ITISASAMPLEINPUT |
Information on Columnar Transposition:
https://en.wikipedia.org/wiki/Transposition_cipher
Hints:
- To switch between Encryption and Decryption Modes you might want to use a flag, which might change between 0 and 1 when the button is pressed. You can use Interrupts for this purpose.
- To communicate with the terminals, you should connect the TX pin of the Input Terminal to the RX pin of your microcontroller, and the RX pin of the Output Terminal to the TX pin of your microcontroller. The RTS and CTS pins are not used.
- If you are getting garbage outputs at your terminal, make sure the Baud Rate of the terminals is set to 9600 and the Clock Frequency of your microcontroller is set to 11.0592 MHz.
-We are using 8051 microcontroller using assembly. This question is about 8051 interrupt interface and serial port programming.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started