ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 Apr 2017 My Price 9.00

CS 343 LAB7 – Using the 8051 Serial Port and Interrupts

The purpose of this lab is to control and program the serial port of the micro-controller in a given sequence. Two switches SW1 and SW2 are connected to the micro-controller input port bits P1.1 and P1.2. The two switches define the required Baud rate requirements for the serial communication as follows:

 

 

CS 343
LAB7 – Using the 8051 Serial Port and Interrupts
Overview
The purpose of this lab is to control and program the serial port of the
micro-controller in a given sequence. Two switches SW1 and SW2 are
connected to the micro-controller input port bits P1.1 and P1.2. The two
switches define the required Baud rate requirements for the serial
communication as follows:
SW1
0
0
1
1 SW2
0
1
0
1 Baud (bps)
1200
2400
4800
9600 Steps
1. First, write a subroutine ”BCODE” (Baud Code) starting at code
address 200H to detect the setting of SW1 and SW2 and return a
value in accumulator B (0 for 1200, 1 for 2400, 2 for 4800, and 3 for
9600 Baud). It also setup the TH1 register for the requested BAUD
rate.
2. Second, write a subroutine “CONFIG” (Timers, Interrupts, and Serial
Configuration) starting at code address 300H to configure the serial
port for Mode 1, timer 0 for mode 1, and timer 1 for mode 2. Also it
enables the timer 0 interrupt and start timer 0 and timer 1.
.
3. Third, write a subroutine “SDISPLAY”” (Serial Display) starting at
code starting address of 400H to display on the serial port the
message “SERIAL BAUD IS XXXX BPS”. “XXXX” is the actual Baud
rate value selected. The subroutine will use polling on the TI flag.
4. Fourth, write a Timer 0 Interrupt Service Routine “TIMER0H” at
address 500H to provide maximum delay in updating port 3 based on
the status of input port 2.. 5. Test and debug your program. Also document and submit your final
report along with the well documented list file. Monitor the serial port
window and verify the SBUF contents using the ASCII code for the
selected message and associated BAUD rate. You can slow the
SBUF update by controlling the MC clock using the clock window in
the PREPHERALS selection. Make sure to check the “4x” box.
6. Modify the program in order to perform serial character transmission
using the serial port interrupt instead of the use of polling on the TI
flag. The processor will be reading Port 2 (P2) and outputting the
input byte to Port 3 (P3) while the serial message is being
transmitted.
7. Document the new program and explain how the interrupt structure
worked for Timer 0 and the Serial Port.

Attachments:

Answers

(11)
Status NEW Posted 26 Apr 2017 02:04 AM My Price 9.00

-----------

Attachments

file 1493172828-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)