Engineering Assignment Sample on An Assignment on Microcontroller

Introduction Epidemiology Sample Assignments

You can download the sample Engineering case study on An Assignment on Microcontroller with the following question for free at the end of this page. For further assistance with Engineering Assignment help, please check our offerings in Engineering assignment solutions. Our subject-matter experts provide online assignment help to Engineering students from across the world and deliver plagiarism free solution with a free Turnitin report with every solution.

(AssignmentEssayHelp does not recommend anyone to use this sample as their own work.)

Engineering Assignment Questions

1. Flowchart for temperature Monitoring system.

2. A microprocessor system has RAM from locations $00 to $ FF. Write a program that will write a value of $ A5 to each of the locations in RAM.

3. A microprocessor system has RAM from location $DF00 to $DFFF. Write a program that will clear the lower 4 bits of all locations in RAM.

4. A microprocessor system has a ROM from locations $A000 to $ AFFF and RAM from locations $D000 to $DFFF. Write a subroutine to perform each of the following.
You must state, the calling registers and return registers for each subroutine.

Engineering Assignment Solution on An Assignment on Microcontroller


Outcome 2.1

Answer: The flowchart description is as follows

The initial input is taken from the three sensors, which is further converted into digital form for processing into the microprocessor.
The LCD is now initialized and the value is displayed on the LCD monitor display
There are two relays which are set to 0 and 1. Based on the output value of temperature relay 1 and 2 are OFF or ON. i.e temp > setpoint

Outcome: 2.2

Answer 2:
LDA $ A5 : “Get the contents of memory location $ A5 into accumulator”
STA $ 00 : “Copy accumulator contents at address $ 00”
STA $ FF : “Copy accumulator contents at address $ FF”
HLT : “Terminate program execution”

Answer 3:
LHLD $DF00 : “Get first 8-bit number in HL”
XCHG : “Save first 8-bit number in DE”
LHLD $DFFF : “Get second 8-bit number in HL”
MOV A, E : “Get lower 4 bits of the first number”
SUB L $DF00 : “Subtract lower 4 bits of the $DF00 number”
SUB L $DFFF : “Subtract lower 4 bits of the $DFFF number”
MOV L, A : “Store the result in L register”
SHLD $DF00 : “Store 4-bit result in memory locations $DF00 and $DFFF”
HLT : “Terminate program execution”

Read more in the complete solution PDF document at the end of this page.

Outcome 2.1

Answer 4:
Subroutine is executed in order to make the stack register store the current address temporarily so that it can be recovered at a later point in the program. The addresses are restored to the PC in the reverse order called a stack to which they were stored, that is, ‘last in, first out’ (LIFO), like a stack of plates. Subroutines are used to carry out discrete program functions.

Read more in the complete solution PDF document at the end of this page.

Outcome 2.2


LXI SP, $08 : “Initialize SP register pair as a pointer to memory location $08.”
LXI H, $F0 : “Initialize HL register pair as a pointer to memory location $F0.”
LXI B, $37 : “Initialize HL register pair as a pointer to memory location $37.”
CALL SUB : Calling Subroutine ACCA
STAX $1404 : “Store the contents of ACCA register into memory location $1404.”
HLT : “Terminate program execution.”

Read more in the complete solution PDF document at the end of this page.

Outcome 2.3

Subroutine program to verify:
LXI B, $08
LXI H, $F0
SHLD $37

Read more in the complete solution PDF document at the end of this page.


Outcome: 3.1

1. The RS232 is a common serial port on most PCs
(a) Explain how the RS232 communication works?

RS232 protocol helps in transferring data between two devices using few wires for asynchronous communication protocol. For bidirectional communication it needs two wires for data transmission between electronic devices else only single wire and one for ground reference makes it a total of three wires.


In RS232 data transmitted over a pair of wires serially in one direction. The data going outward is labeled as Tx and Rx indicate reception. For two way communication system through RS232 Tx, Rx and GND (ground) wire are required.

Figure: The signal level inversion (logic 1 is -12V and logic 0 is +12V). (Microcontrollers 2012)
Working of RS232 in Baud Rate:
Baud Rate defines the frequency of each bit period. In the transmission of 2400 (2400 bps) the frequency is 2400Hz and the bit period is 1/2400 or 416.6us.


Transmitting data bit stream in RS232
RS232 works over high voltages for transmission over long cables. A logical one is sent as -12V and a space (logical zero) is sent as +12V i.e. The logic sense is inverted. (Microcontrollers 2012)

Rs232 to receive a logic zero has input voltage levels as ±3V. This compensates losses that signal suffers in the cable and provides noise immunity against spurious noise up to a level of ±3V can be tolerated.

Start Bit in RS232
RS232 uses a different method of clock recovery is used with asynchronous protocol and no clock signal.

Data bits in RS232
Data has seven to eight LSB data bits transmitted first with the eighth bit as the character set of graphical symbols and for text only needs 7 bits to increase transmission speed and save bits while transmitting large blocks of data.

Read more in the complete solution PDF document at the end of this page.

(b) What are the registers in the 68HC11 that are used for serial communications?

There are 5 control registers for serial communication in MC68HC11 as shown below figure. This figure also shows the logical names for individual bits in the registers.

To set the serial link’s baud rate, BAUD register is used and contains two control bits for factory testing. There are two control registers in MC68HC11, SCCR1 and SCCR2 that specify that how the SCI should work. SCCR1 includes three bits associated with the optional 9-bit data format. The WAKE bit is used to select one of two methods of receiver wake up. SCCR2 contains the main SCI controls. The upper four bits are used for local interrupt enable controls, which determine whether SCI status flags will be polled or will generate a hardware interrupt requests. The TE and RE bits are the respective transmitter and receiver subsystem enable controls. The RWU bit allows software to put the receiver into sleep and hardware to automatically wake it up by clearing this bit. The send break SBK bit allows software to generate break characters on the TxD line.

The transmitter generates flags for TDRE and TC. The receiver generates flags for RDRF, OR, idle-line detect (IDLE), a noise flag (NF), and a framing error (FE) indication. Finally, there is the data register SCDR that holds the transmitted or received information bits in MC68HC11. The SCDR is actually two separate registers. TDR is a write-only transmit data buffer register, and RDR is a read-only receive data buffer register. When software reads SCDR, it is accessing RDR; when software writes to SCDR, it is accessing TDR…

Read more in the complete solution PDF document at the end of this page.

Outcome 3.2

2. Explain the ports that are available on the 68HC11. What can the ports are used for?

The MC68HC11A8 has a total of 40 I/O pins. All these pins are shared between general-purpose I/O usage and at least one other on-chip peripheral function.
Port A includes general-purpose I/O, the main timer system, and the pulse accumulator system. Port A has three fixed-direction input pins, four fixed direction output pins, and one bidirectional pin. The direction of the PA7 pin is controlled by the data direction register A bit 7 control bit (DDRA7) in the pulse accumulator control (PACTL) register. Port A data is read from and written to the PORTA register. Meaningful data may be read from port A even when the pins are configured for an alternate timer or pulse accumulator function. Data written to port A does not directly affect port A pins configured for an alternate timer output function, but the data are remembered in an internal latch so that, if the alternate function is disabled later, the last data written to port A will be driven out of the associated output pin.
Ports B and C and the strobe A (STRA) and strobe B (STRB) pins should be considered together because their function depends on the basic operating mode of the MC68HC11A8.

3. Port B of the 68HC11 is connected to a common – cathode 7 – Segment LED as shown in Figure-1
(a) Design and Build the interface showing the pin connection between Port B and the 7- segment LED.

Answer a)

The basic function of the system shown is to store and display numbers which are input on the keypad. The microcontroller chip can be programmed to scan the keypad and identify any key which has been pressed. The keys are connected in a 3×4 grid of rows and columns, so that a row and a column are connected together when the key is pressed. The microcontroller can identify the key by selecting a row and checking the columns for a connection. Thus, four input lines and three outputs are required for connection to the microcontroller. In order to simplify the drawing, these parallel connections are represented by the block arrows.

Seven-segment displays show the input numbers as they are stored in the microcontroller. Each display digit consists of seven light emitting diodes (LEDs) which show as a line segment of the number when lit. Each number from 0 to 9 is displayed as a suitable pattern of lit segments.

The basic display program could work as follows: when a key is pressed, the digit is displayed on the right (least significant) digit, and subsequent keystrokes will cause the previously entered digit to shift to the left, to allow decimal numbers up to 99 to be stored and displayed.
Calculations could then be performed on the data, and the result displayed.

Read more in the complete solution PDF document at the end of this page.

(b) Write a program to display the numbers from 0 to 9 on the 7 – Segment LED.

Answer b)

Circuit diagram of 7-Segment Display Interfacing to ARM Cortex M0 microcontroller powered LPCXpresso board:
The below circuit connects the 7-Segment display with port-2 and port-3 of microcontroller.

Read more in the complete solution PDF document at the end of this page.

Question: You are part of the R&D team in leading Audio Company, Sound-Spark. The company has just decided to create its first MP3 player.
As the lead designer, you have been given the responsibility to evaluate the MC68HC11 as a possible CPU for the MP3 Player. You are to submit a report that should include the following:

Part 1:

Advantages of using the MC68HC11
1. Traditional architecture- MC68HC11 have traditional architecture than other products which makes it easier to learn and develop on.
2. It includes such as A/D, PWM and many I/O lines on a single chip.
3. It is very inexpensive and its development tools are available in wide range both freeware and commercial.
4. MC68HC11 offers less rigid handshaking protocols such as pulse mode handshaking, employing the rigid level sensitive protocol allowed for easier debugging of communications problems.
5. Microcontrollers act as a microcomputer without any digital parts.
6. As the higher integration inside microcontroller reduce cost and size of the system.
7. Usage of microcontroller is simple, easy to troubleshoot and system maintaining.
8. Most of the pins are programmable by the user for performing different functions.
9. Easily interface with additional RAM, ROM, I/O ports.
10. Low time required for performing operations

Read more in the complete solution PDF document at the end of this page.

Question: Block Diagram stating the connections of the microprocessor to other components.

Part 4:

Disadvantages / Difficulties of using the MC68HC11 and any suggestions to overcome them.

Answer: (Freescale 2014)

1. Any integrated circuit can be damaged or destroyed by exposure to illegal voltages or Conditions. A product can even be designed to tolerate common end-user errors by designing protective interface circuits. The two main goals of any protective interface are to prevent high currents from flowing and to prevent illegal voltage levels at a pin. A low-pass filter can often satisfy both goals. In less common situations, it may also be necessary to provide diode clamps to prevent high voltages at some pins.
2. Zap and latchup are terms familiar to failure analysis engineers that work on CMOS integrated circuits. Zap refers to damage caused by very high-voltage static-electricity exposure. Static-electricity (zap) damage usually appears as a breakdown of the relatively thin oxide layers that causes leakage or shorts. Often secondary damage occurs after an initial zap failure causes a short. Latchup refers to a usually catastrophic condition caused by turning on an unintentional, bipolar, silicon-controlled rectifier (SCR). A latchup SCR is formed by N and P regions in the layout of the integrated circuit, which act as the collector, base, and emitters of unintentional, parasitic transistors. Bulk resistance of silicon in the wells and substrate acts as resistors in the SCR circuit. Application of voltages above VDD or below VSS, in conjunction with enough current to develop voltage drops across the parasitic resistors in the unintentional SCR circuit, can cause the SCR to turn on. Once this SCR is turned on, it can normally only be turned off by removing all power from the integrated circuit. The on-impedance of the SCR can overheat and destroy the integrated circuit. Improvements in layout and processing techniques have made newer HCMOS devices, such as the MC68HC11A8, much less likely to suffer damage from zap and latchup. Because of the destructive nature of these mechanisms, it is impossible to test every device for zap and latchup limits the way timing and drive levels are tested. To assure product reliability, sample groups of devices are destructively tested…

Read more in the complete solution PDF document at the end of this page.

Outcome: 1.2

Suggest 3 other applications for microcontrollers. For your suggestions, do you think that the 68HC11 is a good candidate to be the microcontroller?

Answer: (Atmel 2014)
1. Optical players
2. Digital camcorders
3. LCD/LED display units
4. Used in biomedical instrumentation
5. Widely used in communication systems
6. Used as peripheral controller
7. Used in robotics
8. Used in automobile fields.


Download Free Sample AEH

(Some parts of the solution has been blurred due to privacy protection policy)

Check More Samples

Order Now


Being a devout academician Audrey has published research papers in many academic journals. Audrey has completed over 2000+ assignments dabbling in subjects like Teaching , Academics , Sociology and Psychology.