0% found this document useful (0 votes)
24 views16 pages

CSC 2118 Exam Dec2023

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)
24 views16 pages

CSC 2118 Exam Dec2023

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/ 16

MAKERERE UNIVERSITY

COLLEGE OF COMPUTING & INFORMATION


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

PROGRAMME: COMPUTER SCIENCE


YEAR OF STUDY: II
COURSE NAME: EMBEDDED REAL-TIME SYSTEMS
COURSE CODE: CSC 2118
DATE: 20th Dec 2023 TIME: 12:00PM - 3:00PM

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 a micro-controller? (3 marks)


2. What are bare-metal micro-controllers? (3 marks)
3. How do RTOS-based micro-controller systems differ from bare-metal micro-controller
systems (4 marks)
4. What unit/component of a micro-controller is used to digitize analog signals (2 marks)
5. How does security affect safety of an embedded system? (4 marks)
6. What’s the basic difference between RISC and CISC architecture? (3 marks)
7. Which Instruction set architecture from the previous question, is most used in Harvard
and AVR micro-controllers, and why? (4 marks)
8. What unit/component of a micro-controller is used for synchronization? (2 marks)
9. list the 5 steps of the embedded design methodology? (5 marks)
10. Which mode of communication delivers higher data transfer rates, parallel or serial?
(2 marks)
11. How does I2C differ from SPI? (4 marks)
12. What is quantisation and when is it used in embedded systems? (2 marks)
13. What unit/component of a micro-controller is used to implement delay functions? (2
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. What are pointers in C/C++ and what are they often used for in Embedded
systems? (2 marks)
c. Explain the scope of each variable in the NewDelay function (4 marks)
d. What is the purpose of the ‘volatile’ key word? (2 marks)
e. What do the following Boolean equations equate to? (4 marks)
i. X.1
ii. X.0
iii. X^1
iv. X^0
f. Identify and correct the errors stopping this code from running as it ought to.
(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. Assuming an input button
on port B bit 2 is already externally debounced, use the Atmega 328p and the
Appendix A and B for the following questions:
a. Use C/C++ to configure port B bit 2 as an input with pull-up enabled, and bit 5
as an output. Poll the input pin to determine when the button is pushed. (10
marks)
b. Modify your code in 2.a such that an LED connected on the output pin will
flash at every odd press of the button and switch off at every even press of
the pushbutton. In addition, the LED should increase its flashing rate by 1 Hz
on each odd press. For example, the first time the button is pressed, the LED
should flash at 1Hz, the second time the button is pressed, the LED should go
off, the third time the LED is pressed, the light should flash at 2Hz, and so on.
(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, B and C:
a. What bit configuration in which register, is needed to have a clock period of
16 microseconds for Timer Counter1? (4 marks)
b. Calculate the number of counts needed from the counter to make 1 second
with the configuration stated in 3.a. (4 marks)
c. Use Counter 1 and one of its associated compare registers to make a custom
delay function that takes in an integer as a parameter representing number
of seconds. Show your entire code in C/C++ (12 marks)

4. A robotics company called RobodyneMetal is developing a new steel alloy made up


of interstitially infused carbon in iron. This process requires placing a
5m(length)X5m(width)X0.002m(thickness) iron sheet into a 25m3 carbon bath in a
kiln (a big oven) at a steady temperature of 200oC for 5hrs. The temperature must
not deviate beyond a maximum of 0.5oC above or below the set temperature for a
period longer than 60 seconds, within which corrective measures need to be taken
to bring the temperature back to the set value. You have been tasked with designing
and building an embedded system that monitors and controls the temperature of
the kiln. The design of the embedded system should permit for other alloys to be
made in the kiln, i.e the system should monitor temperature values from 100oC to
500oC and allow user input to set the operating parameters.

a. Sketch out a high-level architectural diagram of your proposed embedded


system design (5 marks)
b. List the components explaining their uses to the system. (5 marks)
c. Given that your system needs to monitor temperature changes at a
resolution of 0.1oC in order to make corrective measures before the
maximum 0.5oC deviation, how many bits would you need for the ADC and
how often would you need to measure the temperature, given that it takes
the heating and cooling elements 10 seconds to cause a 1oC change to the
kiln. Explain your working. (5 marks)
d. Draw a flow diagram for your embedded system (5 marks)
Appendix A

Atmega 328P pin out


Appendix B
Appendix C

You might also like