Calculate the total number of bits transferred if 100 pages


1. Write a C18 code to perform the same function performed by the following Assembly code.

COUNT EQU 0x08
COUNTER EQU 0x20
NUM_X EQU 0x21
ORG 0
MOVLW 0
MOVWF NUM_X
MOVLW COUNT
MOVWF COUNTER
REPEAT BTFSS 0x10, 0
INCF NUM_X, F
RRNCF 0x10, F
DECF COUNTER, F
BNZ REPEAT
END

2. Assume that XTAL = 4 MHz. Find the TMR0H:TMR0L value needed to generate a:

a. time delay of 2 ms. Use 16-bit mode, no prescaler mode.

b. time delay of 10 ms. Use 16-bit mode, and the largest prescaler possible.

3. Assuming that XTAL = 10 MHz, and we are generating a square wave on pin RB0 (50% Duty Cycle); find the lowest square wave frequency that we can generate using:

a. Timer0 in 16-bit mode.

b. Timer0 in 8-bit mode.

c. Timer 2

d. Write an Assembly code to generate the wave with lowest frequency among the values you found in parts (a), (b) and (c).

e. Repeat part (d) using C.

4. Program Timer2 in (a) Assembly and (b) C to toggle pin RB0 when it counts up for 0 to 150 assuming XTAL = 4 MHz.

5. Calculate the total number of bits transferred if 100 pages of ASCII data are sent using asynchronous serial data transfer. Assume a data size of 8 bits, 1 stop bit, not parity and each page contains 80x25 text characters. How long would it take to transfer the whole 100 pages serially if the baud rate 9600?

6. Write (a) Assembly and (b) C code to transfer serially the message "I HEAR YOU" continuously at baud rate 1200.

7. (a) Write an Assembly program to receive 10 bytes of data serially and send them to PORTC. Set the baud rate at 57,600. There must be a delay of 1 second before sending each byte to PORTC, so the bytes need to be stored in RAM, and then sent to PORTC in the same order in which they were received, (b) write the a program to perform the same using C.

Solution Preview :

Prepared by a verified Expert
Electrical Engineering: Calculate the total number of bits transferred if 100 pages
Reference No:- TGS0943107

Now Priced at $75 (50% Discount)

Recommended (95%)

Rated (4.7/5)