UNIT-5 QB and scheme.pdf - Google Drive

2 downloads 180 Views 2MB Size Report
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. UNIT-5 QB and scheme.pdf
1. List and explain the structures of all SFR registers associated in setting up PIC18 Time r0.  TMR0H:TMR0L  T0CON  INTCON

2. List and explain the structures of all SFR registers associated in setting up PIC18 UART Serial communication.

3. With a neat complete block diagram. Describe the steps to program Time r0 in 16-bit mode.

4. With a neat complete block diagram. Describe the steps to program Time r0 in 8bit mode.

5. Find the time rs clock frequency and its period for various PIC-18 based system, with the following crystal frequencies. Assume that a prescaler of 1:64 is used. a. 10 MHz b. 16 MHz

6. Assume the crystal frequency of 10 MHz connected to PIC-18, Calculate the maximum 16-bit Timer0 value in seconds for the following.

a. 1:256 prescaler b. 1:128 prescaler

7. Write a C18 program to toggle only the PORTB.4 bit continuously every 50ms. Use Time r0, 16-bit mode, the 1:4 prescalar to create the delay. Assume XTAL = 10MHz.

8. Write a C18 program to gene rate a frequency of 2 Hz only on pin PORTB.5. Use Time r0, 8-bit mode to create the delay.

9. Write a C18 program to gene rate a frequency of 250 Hz on all the bits of PORTC. Using Time r0 16bit mode. Assume XTAL=10MHz.

10. Write the diffe rence between Serial and Parallel communications. Briefly explain different types of serial communication.

11. List DB9 connector pins and explain the RS232 serial communication protocol interface used between DTE and DCE.

12. Given XTAL = 10MHz. find the SPBRG for the following baud rate a. 9600 b. 4800 c. 2400 d. 1200

13. Draw the asynchronous frame structure and wave form for 8-bit data “A” (41H).

14. Describe the steps to program PIC18 to transfer data serially.

15. Describe the steps to program PIC18 to receive data serially.

16. Write an assembly program to transmit the message “SET COLLEGE” serially at 9600 baud rate, 8-bit UART, 1 stop bit and do this forever.

17. Describe the importance of TXIF flag bit of PIC18 in serial communication.

18. Describe the importance of RCIF flag bit of PIC18 in serial communication.

19. Interface DC Motor to PIC-18 through optoisolator ILD74 and explain the H-Bridge DC motor connection.

20. W rite the C18 program to monitor the status of switch connected to RD7 and perform the following If SW = 0 DC motor moves with 50% duty cycle pulse. If SW = 1 DC motor moves with 2 5% duty cycle pulse.

21. Interface 1 6X2 LCD to PIC -18. And write a C18 program to send “JAIN” to the LCD starting at 5th position of line 1.

#include #define rs PORTCbits.RC0 #define rw PORTCbits.RC1 #define en PORTCbits.RC2 void lcddata(unsigned int); void lcdcommand(unsigned int); void lcdinit(void); void MSDelay( int itime); void MSDelay( int itime) { unsigned int i, j; for(i=0;i