Tải bản đầy đủ (.pdf) (1 trang)

VI XỬ LÝ Homework 6 new 2012 04 28

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (29.14 KB, 1 trang )

Microprocessing Systems
Homework 6 (updated on April 28, 2012)
1. Problem 20 Chapter 3 Textbook MacKenzie
2. There are two 16-bit numbers x and y: x is stored at location 2000H and 2001H of
external RAM, y is stored at location 2002H and 2003H of external RAM (using little
endian). Write a program that compare x and y. if x > y then create F0 = 1, otherwise F0
=0
3. Write a subroutine named ABSOLUTE that checks data stored in location 32H of
internal RAM, if they are negative numbers, change to positive numbers.
4. Write a program that receives continuously data from Port 1. If data are ASCII codes
of numbers then writes data to external RAM at address starting from 3300H. Hint:
ASCII codes of ‘0’, ‘1’, …, ‘9’ are 30H, 31H, …, 39H, respectively.
5. A string of signed 8-bit numbers is in internal RAM at address starting from 20H. The
last number of this string is -1. Write a program that sends this string to Port 0.
6. Use only Timer to create two square waves on P1.0 and P1.1 which are given in the
following diagram. Write the program in Keil and build the hex file, and then use Proteus
ISIS (use the file Blinky.dsn) to simulate the result (use the oscilloscope to see the
waveforms).
P1.0
100 ms

100 ms

P1.1

25ms 100 ms

100 ms

7. One square wave f = 10 Hz is connected to pin T1 of the 8051. Write a program using
Counter 1 to increment the content of location 40H of internal RAM after every 1 minute.


At the beginning, the content of location 40H is zero. Hint: count the number of pulses at
pin T1 in order to determine the duration of 1 minute.



×