0% found this document useful (0 votes)
28 views15 pages

CSC 2118 EXAM JAN2023 Final

Uploaded by

Sebunya Ronaldo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views15 pages

CSC 2118 EXAM JAN2023 Final

Uploaded by

Sebunya Ronaldo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

MAKERERE UNIVERSITY

COLLEGE OF COMPUTING & INFORMATION


SCIENCES
SCHOOL OF COMPUTING AND INFORMATICS
TECHNOLOGY
END OF SEMESTER I EXAMINATION 2022/2023

PROGRAMME: COMPUTER SCIENCE


YEAR OF STUDY: II
COURSE NAME: EMBEDDED REAL-TIME SYSTEMS
COURSE CODE: CSC 2118
DATE: 27th January 2023 TIME: 08:00AM - 11:00AM

EXAMINATION INSTRUCTIONS
a) ATTEMPT ALL QUESTIONS IN SECTION A (40 MARKS)
b) ATTEMPT THREE (03) QUESTIONS IN SECTION B (60 MARKS)
c) DO NOT OPEN THIS EXAM UNTIL YOU ARE TOLD TO DO SO
d) ATTEMPT EACH QUESTION IN SECTION B ON A NEW PAGE
e) ALL ROUGH WORK SHOULD BE IN YOUR ANSWER BOOKLET
SECTION A

1. What is an embedded system, and what are components of an embedded system?


(2 marks)
2. What is a micro-controller? (2 marks)
3. What is a fundamental difference between micro-controllers and microprocessors?
(2 marks)
4. Give 3 reasons for using a microcontroller instead of general-purpose computer (3
marks)
5. What is security in an embedded system? (2 marks)
6. What is safety in an embedded system? (2 marks)
7. How does security affect safety of an embedded system? (3 marks)
8. What’s the basic difference between RISC and CISC architecture? (2 marks)
9. State 3 challenges that are often faced in designing embedded systems (8 marks)
10. What are the 5 steps of the embedded design methodology? (5 marks)
11. Briefly describe the distinction between requirements and specification of an
embedded system (2 marks)
12. Briefly describe the distinction between specification and architecture of an
embedded system (2 marks)
13. What is quantisation and when is it used in embedded systems? (2 marks)
14. Given an analogue signal varying from 0 to 10V, how many bits of ADC would we
need to achieve a 0.01V (2 decimal points) resolution? (3 marks)
SECTION B
1. Analyze the code snippet below to answer the follow-on questions

a. Explain what the code snippet does. (3 marks)


b. Use a table to make a trace of the values of the variables up to iteration i = 3.
(5 marks)
c. What are pointers in C/C++ and what are they often used for in Embedded
systems (2 marks)
d. Explain the scope of each variable (2.5 marks)
e. What is the difference between the variables of type int and short. How
many bits are commonly used for each type and what is the maximum
unsigned value each can represent (2.5 marks)
f. Re-write the code to use while loops instead of for loops (5 marks)

2. Push buttons are used in a variety of embedded applications to trigger or stop an


action when someone or something presses the switch. However, due to the
mechanical nature of the switches, a single push on the switch might be interpreted
as multiple presses. Using the Atmega 328p and the Appendix:
a. Write a program in C/C++ that monitors and debounces an input switch. (10
marks)
b. Modify your code in 2.a such that a DC motor turns on when a user presses
the switch the first time, and turns off when the user presses the switch a
second time. (10 marks)
3. Time delays are regularly used in embedded systems to determine when a given
operation starts or stops executing. Using the Atmega 328p and Appendix:
a. Use Timer interrupts and counter 1 to make an LED connected on a PIN of
your choice on PORTB to blink on and off. Use the sample code below as a
guide to help you write the complete code in C/C++ needed. (10 marks)

ISR(TIMER1_COMPA_vect)
{
//code
}

int main()
{
//code
TIMSK1 = 0b00000010;
sei(); //enable global interrupts

}
b. What is the clock period when the clock select pins are set to 101 (4 marks)
c. Re-write this program to use an already existing time delay library
_delay_ms() and a polling mechanism (6 marks)

4. As a growing embedded start-up company, you have been approached by a local


government to help them develop an early warning system for wildfires. The client
wants portable wireless smoke detectors that are the size of a smartphone. They
want to deploy the smoke detectors across a forest conservation that spans 200
hectares. The devices need to be easily placed on tree trunks by forest rangers as
they walk through the forest. Due to forest canopy cover, the devices cannot be
solar powered, and neither can they have a GPS module to determine their location
in real time, so it has been proposed that a sector identification number (SiD)
representing different sections of the forest, shall be manually programmed into
each device by the user (forest ranger) at time of deployment. Each unit should cost
no more $10 and will use LoRaWAN to transmit its data. Furthermore, each device
will be battery powered.
a. Write up a requirements document for this embedded system (5 marks)
b. A hectare is approximately 100m length, and 100m width.
i. If each smoke detector can detect smoke in an area of 10000m2 how
many smoke detectors would be needed to cover the whole forest.
(2marks)
ii. How many bits would be needed to store the SiD and in which
memory would this value best be stored considering that batteries
might have to be swapped occasionally. (2 marks)
c. Propose how the SiD can be input into a device, considering the process must
be as user friendly as possible keeping in mind the device constraints.
Augment your answer with pseudo code or flow diagram. (5 marks)
d. Present a high-level Architecture design using block diagrams (6 marks)
Appendix A

Atmega 328P pin out


Appendix B
Appendix C

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy