嵌入式系统代写代做代考 Embedded Systems Tutorial solutions 2

Tutorial solutions 2
1. An asynchronous communication link sends a 4096 bit file over an RS232 link using 19200 8-E- 2 format.
a) Calculate how long the file takes to send.
The time for each bit sent is 1/19200 = 52 s.
Each word of 8-E-2 contains 8 data bits, 1 parity bit, 1 start bit and 2 stop bits – 12 bits in total
4096 data bits is 512 lots of 8 data bits
Each of these 512 words will in fact require 12 bits sent
So we the send time will be 512 × 12 × 52 s = 319488 s ≈ 0.32 s
b) Calculate the overhead associated with the protocol (i.e. the number of non-data bits sent divided by the total number of bits sent).
We need 4 non-data bits for every 12 bits sent, so the overhead is 4/12 = 33%
2. The letter ‘A’ has the ASCII code 0x41. Show the complete word that would be used to send this character over a serial port link using the 7-O-2 format, sending least significant bit first.
01000001111
3. The sleep mode current is so small as to be almost negligible.
The active mode current draw could be sustained for 1500/20 = 75 hours.
10 weeks is 1680 hours. So the device can be in active mode for 75/1680 = 4.5% of the time
Let’s just check our assumption that the sleep mode current drain really was negligible. The system is in sleep mode for 1680-75 = 1605 hours
The total charge drawn is 1605 × 100 × 10-9 = 0.16 mAh
This is only 0.01% of the total charge drawn, so we are justified in neglecting its effect.
4. R1 = 0b00000001
R2 = 0b00000010
R3 = 0b11111111 = 0xFF (the 2s complement representation of -1)
N=1 (the final result is negative)
Z=0 (the final result is not zero)
V=0 (there is no overflow: the correct final result is representable within 8-bits)
5.
Desired baud rate = Fosc / [16(n+1)]
28800 = 8000000 / [16(n+1)]
n = 8000000/(28800×16) – 1 = 16
Calculated Baud Rate = 8000000 / [16(16+1)] = 29412
Error = (29412-28800) / 28800 = 2.1% – within acceptable bounds