FL051 DethiCLC20222 De1 Dapan Vi Dieu Khien
FL051 DethiCLC20222 De1 Dapan Vi Dieu Khien
FL051 DethiCLC20222 De1 Dapan Vi Dieu Khien
(Date) (Date)
Lecturer: Approved by:
(Signature & Fullname) (Signature, Position & Fullname)
2. How many memory locations can a 10-bit address bus access? (L.01)
a) 1024 b) 1048576 c) 65536 d) 2097152
4. Does PIC16F877 support analog outputs? If yes, then what’s its range? (L.01)
a) Yes, it does support, and range from 0-5V
b) Do not support
c) Yes, it does support, and range from 0-3V
5. Suppose, for the crystal to use with a frequency of 12MHz, the instruction cycle of the
microcontroller PIC16F877 is: (L.01)
a) 0.2 us b) 0.33 us c) 0.5 us d) 0.53 us
8. What happens when an external voltage higher than 5V is applied to RA0/AN0 (L.02)
a) Operate normally b) Damage the microcontroller c) reset PIC
11. For a pin (PIN) on a microcontroller, choose the most correct statement: (L.01)
a) It is possible to use both Input and Output pins at the same time
b) Can be used to read Encoder, ADC
c) Can be used to communicate RS232, I2C
d) Only 1 function can be used at a time
13. Given the circuit and value of port b: 01100111 then the displayed result is: (L.02)
15. Write statement C setting the PIC ADC so that only RA0 is used as analog input. If assuming
V reference is 12V, 10 bit conversion, calculate resolution (L.04)
a) 4.88mv/bit
b) 11.7mV/bit
c) 1.2mV/bit
d) a, b, c are wrong
16. Suppose the timer1 interrupt declaration in the Header file is # INT_TIMER1, to use the
timer1 interrupt function. We declare as follows: (L.01)
a) enable_interrupts(INT_TIMER1); enable_interrupts(GLOBAL);
b) enable_interrupts(INT_TIMER1);
c) enable_interrupts(INT_TIMER); enable_interrupts(PEIE);
d) enable_interrupts(INT_TIMER0); enable_interrupts(GLOBAL);
18. What is the advantage of using serial communication over I2C with PIC (L.02)
a) Faster speed
b) Least wiring
c) Do not have
d) Both a and b are correct.
19. For microcontroller use is 16F877A; Crystal has a frequency of 20MHz; select the value
presale = 4. If you want timer0 to time a time interval of 60us, the initial value to be set for timer0
is: (L.04)
a) TMR0 = 146 b) TMR0 = 181 c) TMR0 = 75 d) TMR0 = 166
20. Using 16F877A microcontroller, the quartz frequency used is 20MHz. Using timer0, suppose
we want to extend timer0's timing capacity up to 1h or 10h then: (L.04)
a) Can't be done because timer0 is just an 8-bit timer.
b) Can't be done because timer0 8bit can specify the maximum time to 51.2us.
c) It is recommended to use a timer with a larger capacity.
d) Implemented by letting timer0 overflow many times and passing an intermediate variable to
count the number of overflows corresponding to the time it needs to be timed.
21.
22.
If OPTION_REG REGISTER is 0b00011000
23. If PR2= 0xEF, and timer 2 prescaler=4, Crystal =20MHz, the frequency of PWM signal is
(L.04)
a) 19.53 KHz
b) 4.88 KHz
c) 6.53 KHz
d) a, b, c are not correct
24. The clock frequency of the PIC 16F877 is 20MHz. Calculate the feed value for the 16bits
timer (preload value) to generate an 8mms interrupt (L.04)
a) 20000 b) 40000 c) 25536 d) 30000
25. If an ADC has a positive input reference voltage of 2.048V and is 8 bits converted. Specify
the resolution (mV/bit) and the resulting binary number if the converted input voltage is 0.896V
(L.03)
a) 8 mV/bit, 0111 11012
b) 10 mV/bit, 0111 01002
c) 8 mV/bit, 0111 00002
d) 8 mV/bit, 1111 11012
26. If PR2= 207, and timer 2 prescaler=4, Crystal =20MHz, the frequency of PWM signal is
(L.04)
a) 4 KHz
b) 5 KHz
c) 6 KHz
d) a, b, c are not correct
27. If PR2= 207, and timer 2 prescaler=4, Crystal =20MHz, the duty cycle is (L.04)
a) 30%
b) 20%
c) 35%
d) a, b, c are not correct
28. To display number 4 the output value of port b is (L.02)
29 To generate the speed 19200 BAUD RATE for the UART communication, IF BRGH=1,
crystal=20Mhz, the SPBRG value is
a) 60 b) 64 c) 55 d) 50
31. Which of the following statements is not true about external interrupts (L.04)
a) Interrupt occurs when there is a transition from high to low at the external interrupt pin
b) Interrupt occurs when there is a transition from low to high at the external interrupt pin
c) In PIC16F877, the external interrupt pin is RB0
d) external Interrupt occurs when the overflow flag of Timer 1 is set to 1
32. For the UART communication, IF BRGH=1, crystal=20Mhz, the SPBRG value is 64, the
speed for the communication is
33. If the setting of the UART is as following Figure and the setting speed is 1200bps. How
much time does it take to transmit 500 bytes. (L.04)
a) 4.5s b) 5s c) 5.5s d) all are not correct
34. if the wave form of the transmission is shown as following Figure. With the configuration:
one stop bit, no check parity, 8 databits. The number transmit is (L.04)
35. What value should be loaded in the TRISB register if return lines (RB7:RB4) and RB3:RB0
are supposed to be inputs and outputs respectively after the PORT B initialization?. (L.01)
38. To enable interrupts, which module on the 16F877A or 16F877 microcontroller can be used.
a) External interrupt
b) Timer 0
c) Timer 1
d) All are correct
39. The following statement is available: Timer2 interrupt has higher interrupt priority than
Timer1 interrupt. (L.04)
a) Right.
b) Wrong.
c) True if these 2 timers are used at the same time.
40. Which bit permits to enable (if set) or disable (if cleared) all the interrupts in an INTCON
register (L.03)
a) GIE b) ADIE c) RBIE d) TOIE