QUESTION 1
Not yet answered
Marked out of 3.00
Flag question
QUESTION 2
Not yet answered
Marked out of 4.00
Flag question
Study the following C51 function:
short func1(char a, char b, char c){
__code const char w1 = 3, char w2 = -2;
return (w1 * a + w2 * b + c);
}
i) What is the return value if a = -5, b = 2 and c = 6?
ii) Estimate how many bytes of internal RAM are needed to execute this function once?
You should assume that that return address and arguments are stored on stack, and only A, R0 and R1 are used in the calculation.
Use MCU 8051 IDE to simulate the following 2 codes fragment and determine the time to execute them (use osc. frequency 12 MHz = 12000 kHz).
Loop #1
unsigned char i,  x = 0;
for (i = 1; i <= 200; i++)
x = x + i;
QUESTION 3
Not yet answered
Marked out of 5.00
Flag question
Loop #2
unsigned char i = 200, x = 0;
do {
x = x + i;
} while (--i);
Are the final values of x the same?
Briefly explain the reason for the difference in the execute times.
Study the UART data frame on p.13 of 32-Serial. Suppose that the baud rate is 9600, the transmitter clock is perfectly accurate while the receive clock is 8% faster, and there is no delay in data transmission.Let t=0 be the time of the start bit (1->0 transition).
If the transmitter sends a byte "11010010", calculate the times that the transmitter bit changes (say start bit -> D0, D0 -> D1, etc.)
Also calculate the times that the receiver clock sample the data (assume at the middle of the period of the receiver clock).
What is the received data?
QUESTION 4
Not yet answered
Marked out of 3.00
Flag question
QUESTION 5
Not yet answered
An 8051 system uses oscillator of frequency 8 MHz.
What should be the value of SMOD and the value of TH1 so that a baud rate of 2400 can be reliably achieved? Show your steps.
Marked out of 3.00
Flag question
QUESTION 6
Not yet answered
Marked out of 3.00
Flag question
Suppose that you have a circuit to display a single digit using a common-anode 7-segment display:where (a, b, c, d, e, f, g, dp, anode) are connected to (P1.7, P1.6, ..., P1.0, P0.0) respectively.
Write a short C51 code fragment (2-3 lines) to display digit 6 (without dp).
Also suggest a method to reduce the pin usage to 4.
Study the 4x4 switch matrix (keypad) on p.3 of 33-KeypadDisplay.
Theoretically speaking, can you identify if two buttons are pressed at the same time?
If yes, suggest the steps; if no, explain why.
QUESTION 7
Not yet answered
Marked out of 3.00
Flag questiontruncated zip file怎么解决
Write down the bit frame on the SDA line when a MCU reads a byte 0x7C from a slave of address 0x51.
Use symbols S, P, 0, 1. Underline any bit(s) transmitted by the slave.
Example from p.8 of 34-I2C may be useful.
NEXT
QUIZ NAVIGATION

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。