Embedded Systems Midterm
Embedded Systems Midterm
Embedded Systems Midterm
Abuhaiba
2nd Semester, 2022/2023 Computer Engineering Department
Midterm Exam Faculty of Engineering
60 Minutes Islamic University
Open Paper Textbook Gaza, Palestine
Student's Name: Student's ID:
Keep with you only the paper textbook, and stationary.
Close all communication devices.
Put near the whiteboard all communication devices, laptops, bags, and other things.
Answer in English.
After you submit the answer sheet, take the problem sheet with you.
Solution:
Selected data type must be:
Unsigned: since university number can’t be negative.
With smallest range that includes the maximum possible university number, which is 299999999, since
university numbers consist of 9 decimal digits where the maximum leftmost digit is 2 and remaining 8 digits
may reach 99999999. This saves memory.
The most appropriate ISO C99 data type that satisfies the above constrains is uint32_t. It is unsigned, has a
size of 4 bytes, and has a range from 0 to 4,294,967,295.
Solution:
Mask to enable clock of port A = 0x2000
Mask to disable clock of port E = 0xDFFF = ~0x2000
SIM->SCGC5 = (SIM-> SCGC5 | 0x200) & ~0x2000;
Solution:
Distance between 15th location and 1st location = 15 – 1 = 14 = 0xE
Address command of first location of 3rd line = 0x94.
Address command of the 15th location = 0x94 + 0xE = 0xA2.
Problem Four (10 points)
Assume asynchronous communication is used with one stop bit and odd parity. Draw the frame required to
send a character whose ASCII code is 0x42.
Solution:
0 1 1 0 1 0 0 0 0 1 0 0 1
Space Stop Parity D7 D6 D5 D4 D3 D2 D1 D0 Start mark
Solution:
Counter clock frequency = system clock / prescalar = 32.768 × 103 / 65536 = 0.5 Hz
One count period = 1 / Counter clock frequency = 1 / 0.5 = 2 sec.
Maximum delay = One count period × (maximum MOD value + 1) = 2 × 65536 = 131072 secs
= 2184.53 mins
= 36.41 hours
= 1.517 days