Unit - 4
PIC Interfacing -II
Q1) Write a short note on capture mode.
A1)
Q2) Write a ccp pin configuration.
A2)
Q3) Write a short note on pwm mode.
A3)
Fig. PWM mode
Q4) Explain pwm period and pwm duty cycle.
A4) PWM Period
PWM period = [(PR2) + 1] • 4 • TOSC • (TMR2 prescale value), specified in units of time
PWM frequency (FPWM) is defined as 1 / [PWM period].
PWM Duty Cycle
Q5) Explain the dc motor speed control with ccp.
A5)
Q6) What are the time reason for “resistor is not a good choice for controlling speed of a dc motor?
A6) There are three reasons for “Resistor is not a good choice for controlling the speed of a DC Motor”.
Q7) Explain the stepper motor interfacing with PIC.
A7)
Q8) Write advantages and disadvantages of SPI.
A8) ADVANTAGES
DISADVANTAGES
Q9) Explain the UART.
A9)
ADVANTAGES
• No communication protocol is perfect, but UARTs are pretty good at what they do.
• Only uses two wires
• No clock signal is necessary
• Has a parity bit to allow for error checking
• The structure of the data packet can be changed as long as both sides are set up for it
• Well documented and widely used method
DISADVANTAGES
• The size of the data frame is limited to a maximum of 9 bits
• Doesn’t support multiple slave or multiple master systems
• The baud rates of each UART must be within 10% of each other
• Continue on to part three of this series, Basics of the I2C Communication Protocol to learn about another way electronic devices communicate. Or if you haven’t already, check out part one, Basics of the SPI Communication Protocol.
Q10) Write a short note on parallel transfer.
A10)
• In parallel transfer, data is transferred in 8 or more lines. In this wire conductor is used for transferring data to a device that is only a few feet away.\
• Serial communication is mostly used for transmitting and receiving the signal.
• The 8051 microcontroller is consisting of Universal Asynchronous Receiver Transmitter (UART) used for serial communication.
• The signals are transmitted and received by the Rx and Tx pins of microcontroller.
• The UART take individual bytes of data and sends the individual bits in a sequential manner.
• The registers are used for collecting and storing the data inside a memory.
• UART is based on half-duplex protocol. Half-duplex means transferring and receiving the data, but not at the same time.
Serial Vs Parallel
• Data transferred by computer occurs in two ways. They are parallel and serial communication.
• Parallel Communication has 8 or more lines. It is used for transfer of data to a device that is only a short distance, while serial communication is used to transfer data over a long distance.
• The data is sent one bit at a time in serial communication, whereas multiple bits are sent simultaneously in parallel communication.
• The difference between serial communication and parallel communication.
Q11) Explain the serial communicating programming using embedded C.
A11) Serial communication programming using embedded C:
• Set the baud rate at 9600, 8-bit data and 1 stop bit. Use Timer 1 for baud rate generation.
• In this lecture, basics of serial communication is discussed.
• The 8051 control registers for serial communication are shown and the Serial Port programming in Embedded C.
• Computer transfer data in two different ways: -
• Serial transfer: In serial transfer, data is transfer to device located many meters away this method is used for long distance data transfer.
• Parallel transfer: In parallel transfer, data is transferred in 8 or more lines. In this wire conductor is used for transferring data to a device that is only a few feet away.
• Serial communication is mostly used for transmitting and receiving the signal.
• The 8051 microcontroller is consisting of Universal Asynchronous Receiver Transmitter (UART) used for serial communication.
• The signals are transmitted and received by the Rx and Tx pins of microcontroller.
• The UART take individual bytes of data and sends the individual bits in a sequential manner.
• The registers are used for collecting and storing the data inside a memory. UART is based on half-duplex protocol.
• Half-duplex means transferring and receiving the data, but not at the same time.
Serial Vs Parallel
• Data transferred by computer occurs in two ways. They are parallel and serial communication.
• Parallel Communication has 8 or more lines. It is used for transfer of data to a device that is only a short distance, while serial communication is used to transfer data over a long distance.
• The data is sent one bit at a time in serial communication, whereas multiple bits are sent simultaneously in parallel communication.
• The difference between serial communication and parallel communication.