Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit 2 MCQ

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

1) There are total of __ ports in the PIC18F458.

a) 4 b) 3 c) 5 d) 6
Ans: C

2) All of the PIC18F458 ports have 8 pins


a) True b) False
Ans: b

3) Upon power-up, the VO pins are configured as output ports.


a) True b) False
Ans : a

4) To make Port B an output port, we must place_______in register _


a) 0, TRIS B b) 1 ,TRIS B C) 0,LAT B d) 1,LAT B
ANS: a

5) To make Port B an input port, we must place_______in register _


a) 0, TRIS B b) 1 ,TRIS B C) 0,LAT B d) 1,LAT B
Ans: b

6) Meaning of instruction “BSF PORTB, 5”


a) Set HIGH bit 5 of PORT B b) set LOW bit 5 of PORTB
c) SET all bits of PORTB to HIGH except bit 5 d) None
Ans: a

7) Meaning of Instruction “BCF PORTC ,2”


a) Clear the all bits except bit 2 of PORTC
b) set HIGH bit 2 of PORTC
c) Clear bit 2 of PORTC
d) clear the all bit of PORTC
ans: C

8) The PICI 8F458 has a DIP package of pins.


a) 6 b) 4 c) 5 d)2
Ans: C

9) In PIC 18F458, how many pins are assigned to Vcc and GND?
a) 1 b) 4 c) 3 d)2
ans: b

10) In the PIC18F458, how many pins arc designated as I/O port pins?
a) 33 b)35 c) 31 d) 36
ANS: a

11) How many pins are designated as PORTA in the 40-pin DIP package .
a) 8 b) 6 c)7 d) 5
ans: C

12) How many pins are designated as PORTD in the 40-pin DIP package.
a) 8 b) 9 c)7 d) 5
ans: a

13 ) The control register of timer0 i.e. T0CON is _____________ bit register.


a) 8 b) 6 c)7 d) 16
ans: a

14) Write an instruction in C language to clear the Timer0 interrupt flag?


a) T0CONbits. TMR0IF =0
b) T0CONbits. TMR0IF =1
c) INTCONbits.TMR0IF = 0
d) INTCONbits.TMR0IF = 1
Ans:

15) If the TRISB = 0x00; then PORTB will be set as ______


a) Input port b) output port c) Bidirectional Port d) Work as
buffer
Ans: b

16) If the TRISB = 0x00; then PORTD will be set as ______


a) Input port b) Work as buffer c) Bidirectional Port d)
output port
Ans: d

17) Which instruction is used to clear single bit?


a) BSF b) BCF c) BTFSS d) BTFSC
Ans: b
18) PORTx, TRISx and LATx are which type of registers associated with ports?
a) GPRs b) SFRs c) FSRs d) CPURs
ans:

19) Timer0 supports the highest prescaler val ue of _


a) 2 b) 1 c) 3 d) 4
Ans: C

20) How many timers are in the PJCI 8F458?


a) 1 b) 5 c) 4 d)6
Ans: b

21. PIC 18f452 Microcontroller has Timer modules


a. 1 b.2 c.3 d.4
Ans: d

22. PORT names of PIC18F452 are


a. 0,1 b. 0,1,2,3,4 c. A,B,C,D,E d. A,B,C
Ans: C

23. Timer 0 module of PIC 18F458 uses


a. 8-bit/16-bit timer/counter with 8-bit programmable prescaler
b. 16-bit timer/counter
c. 8-bit timer/counter with 8-bit period register
d. 8-bit timer/counter
Ans: a

24. Timer 1 module of PIC 18F458 uses


a. 8-bit/16-bit timer/counter with 8-bit programmable prescaler
b. 16-bit timer/counter
c. 8-bit timer/counter with 8-bit period register
d. 8-bit timer/counter
Ans: b

25.Timer 2 module of PIC 18F458 uses


a. 8-bit/16-bit timer/counter with 8-bit programmable prescaler
b. 16-bit timer/counter
c. 8-bit timer/counter with 8-bit period register
d. 8-bit timer/counter
Ans: C

26. Timer 3 module of PIC 18F458 uses


a. 8-bit/16-bit timer/counter with 8-bit programmable prescaler
b. 16-bit timer/counter
c. 8-bit timer/counter with 8-bit period register
d. 16-bit timer/counter
Ans: d

27. T0CON Register of Timer is______


a. TIMER0 CONTINUOUS REGISTER b. TIMER0 CONSTANT REGISTER
c. TIMER0 CONTROL REGISTER d. TIMER0 CONFIG. REGISTER
Ans: C

28. In T1CON register , BIT 0 is and BIT1 is _____


a. T1CKPS1,T1CKPS0 b. TMR1CS,TMR1ON
c. T1CKPS0,T1CKPS1 d. TMR1ON,TMR1CS
Ans: d

29. TMR0H and TMR0L registers of PIC 18F458 are used


a. to control On and OFF of TIMER0
b. to set bits of Timer Control Register
c. To store the Hex values to generate delay of specific time
d. to initialize the Timer settings
Ans: C

30. "INTCONbits.TMR0IF = 0" statement for PIC 18F458 :


a. Clears Timer0 overflow flag
b. Clear Timer0 Interrupt enable flag
c. Clear Timer0
d. Overflow detect
Ans: a

31. If the TRISB = 0x00; then PORTB will be set as ___ _


a. Input Port b. Bidirectional Port
C. Output Port d. work as buffer
Ans:C

32. Description of this MOVFF PORTC, PORTB is


a. This instruction will copy the contents of PORTC to the PORTB
b. This instruction will copy the contents of PORTB to the PORTC
c. Both of these
d. None of these
ANS : a

33. CLRF TMR0H means……………..


a) CLRF = TMR0H
b) TMR0H = 00H
c) TMR0H = FFH
d) None of these
ANS : b)

34.First load WREG =55H, then moves this value around to various SFRs of ports A,B,C,
and D then contents of A,B,C & D are ……………
a) A= 00H ; B= 00H ; C= 00H ; D = 00H
b) A= FFH ; B= FFH ; C= FFH ; D = FFH
c) A= 55H ; B= 55H ; C= 55H ; D = 55H
d) None of these
ANS : c)

35. BTFSC stand for …………………..


a. Byte Test File Select if Set
b. Byte Test File Select if Counter
c. Bit Test File Skip if Clear
d. None of these
ANS : a

36. BSF TRISC,2 is a………….


a. Bit Level Instruction
b. Byte Level Instruction
c. Both of these
d. None of these
ANS : a

37. CLRF TRISC indicates…………………………


a. Port C is used as output port
b. Port C is used as input port
c. Both of these
d. None of these
Ans: a

38. To start the Timer in Timer 1 …….. bit should be set.


a) TMR0ON
b) TMR1ON
c) Both of these
d) None of these
ANS ; b)

39. In Timer 1 Control Register, if RD = 1 then,………………….


a) Enables Timer 1 in 16 bit operation.
b) Enables Timer 1 in two 8 bit operation.
c) Both of these
d) None of these
ANS : a)

40. Maximum value of prescaler in Timer 1 is ……………..


a) 1:1
b) 1:2
c) 1:4
d) 1:8
ANS : d)
41. SFR of Timer 3 is………………. Register.
a) T0CON
b) T1CON
c) T2CON
d) T3CON
ANS : d)

42.Postscale and prescale select bits are present only …….


a) T0CON
b) T1CON
c) T2CON
d) T3CON
ANS : c)

43. Which is the correct instruction written in C language which will start Timer 3
a. T3CONbits.TMR3 ON=1;
b. T3CONBITS.TMR3ON=1;
c. T3CONbits.tmr3on=1;
d. t3conbits.tmr3on=1;
Ans: a

44. TOUTPS3 stands for……………..


a) Timer 0 output post scale select Bits
b) Timer 1 output post scale select Bits
c) Timer 2 output post scale select Bits
d) Timer 3 output post scale select Bits
ANS : c)

45. After executing BSF T0CON,TMR0ON instruction………………..


a) Start Timer 0
b) Start Timer 1
c) A Start Timer 2
d) Start Timer 3
ANS : a)

46. After executing BCF TRISC,2 instruction………………..


a) RC2
b) RC2 = OUTPUT PIN
c) Both of these
d) None of these
ANS : b)

47. After executing PIR1bits.TMR1IF= 0 instruction………………..


a) Clear Timer 0 IF
b) Clear Timer 1IF
c) Clear Timer 2 IF
d) Clear Timer 3 IF
ANS : b)
48. In a PWM mode , when does the TMR2IF flag Set

a. When contents of TMR2 is equal to PR2 register


b. When contents of TMR2 is equal to CCPR1H register
c. When contents of TMR2 is equal to CCPR1L register
d. When contents of TMR2 is not equal to PR2 register
Ans: a

49. What will happen If CCP1CON is loaded by 0X30,


a. CCP1 module is disabled
b. Comare mode is activated
c. Capture mode is activated
d. PWM mode is activated
Ans: a

You might also like