EEE4001 Microprocessor and Microcontroller
Assignment II
1) Write a program to read an 8-bit pattern from Port 1 and output it to Port 2 if the
number is odd, to Port 3 if the number is even.
2) Assume 10 bytes of data are stored from RAM locations 50H. Write a program to
compute the average of these numbers and store the result at memory location 40H.
For the code fragment, compute the size and the time needed assuming 11.0592 MHz
crystal.
3) Assuming that XTAL=16MHz, show a program to generate a 0.25 second time delay.
Use any timer you want.
4) How is the TMOD register modified to make each of the timers operate as counters?
5) Program Timer 0 to be an event counter. Use mode 2 and display the binary count
on P2 continuously. Set the initial count to 20.
6) Assuming that clock pulses are fed into pin Tl, write a program for counter 1 in
mode 2 to count the pulses and display the state of the TL1 count on P2.