Uploaded by A7med Osama

Assignment

advertisement
Zagazig University
Faculty of Engineering
Mechatronics Department
Microcontroller Course
Assignment #01
Deadline : 17th Dec. 2020
‫كل مجموعة لمشروع تقوم بحل التمرين و يتم تسليم الحل يوم امتحان اعمال الفصل علما بأن باالضافة الى التصحيح‬
.‫سوف يتم مناقشة الطلبة فيه يوم مناقشة المشروع لهذا نفس مجموعة المشروع تقوم بحله‬
1- It is required to generate a square wave at a specified pin of any port of
microcontroller (Atmega 32 using timer 0). The time period of square wave is
12 msec (5 msec for high pulse and 7 msec for low pulse). The microcontroller
is connected to a clock generator (8 MHz) and the pre-scaler mode (256) is
activated.
a. Describe how to perform this operation as step in operating the microcontroller to
generate this waveform. For example : if you want to operate a led connected to any
pin 0 so i will output at this pin logic 0 and so on. (Note: no need for any program
code)
b. Estimate the hex-decimal values that will loaded into the counter register to perform
this operation.
2- It is required to output a series of ordered number iteratively (3 to 100) on a
specified port of a microcontroller (Atmega32) connected to 8 MHz. Describe
how to perform this operation using the counter of Timer 0 of the
microcontroller. Estimate all required values loaded into any register.
3- A microcontroller has a 8-bit microprocessor whose bus cycle is the same
duration as that of a 32- bit microprocessor. Assume that, on average, 15% of
the operands and instructions are 16 bits long, 25% are 32 bits long, and 60%
are only 8 bits long.
a. Calculate the number of fetching cycles for 100 instructions for the two
microprocessor.
b. If the number of the two microcontrollers has 4 I/O port (each one is 8-bits), one of
the ports is connected to an address bus of the memory. How many locations can be
accessed by the microcontroller.
c. If there is 8-bits transferred through I/O port each 2 clock cycles. Estimate the data
transfer rate in (MB/sec) if the oscillator connected to microcontroller is 8MHz.
4- Consider a Motorola microcontroller has a microprocessor, with an 8-bit
external data bus and a 16-bit address lines, driven by an 16-MHz input clock.
a. What is the maximum data transfer rate across the bus that this microprocessor can
sustain, in bytes/s?
b. If the external data bits becomes 32 bits, what is the advantage and disadvantage of
this ?
c. If the address bits becomes 8 bits, what is the advantage and disadvantage of this?
5- Consider a microcontroller with a 16-bit each port, driven by 10-MHz input
clock. Assume that this microprocessor has a bus cycle whose minimum
duration equals two input clock cycles. What is the maximum data transfer rate
across the bus that this microcontroller can sustain, in bytes/s?
With my best wishes
Dr. Mohamed Issa
Download