0% found this document useful (0 votes)
48 views21 pages

Pa 4

The document explains the function of the CCP1CON Special Function Register (SFR) in the PIC18FXX microcontroller, detailing its role in compare, capture, and PWM modes using TIMER1, TIMER2, and TIMER3. It describes the structure of the CCP1CON register, including duty cycle bits and mode selection bits, and outlines the operations of compare and capture modes with respect to timer registers. Additionally, it briefly discusses SPI and I2C protocols, RS232 standard, and UART module operations in the context of microcontroller communication.

Uploaded by

devidaspawar4378
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views21 pages

Pa 4

The document explains the function of the CCP1CON Special Function Register (SFR) in the PIC18FXX microcontroller, detailing its role in compare, capture, and PWM modes using TIMER1, TIMER2, and TIMER3. It describes the structure of the CCP1CON register, including duty cycle bits and mode selection bits, and outlines the operations of compare and capture modes with respect to timer registers. Additionally, it briefly discusses SPI and I2C protocols, RS232 standard, and UART module operations in the context of microcontroller communication.

Uploaded by

devidaspawar4378
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Explain function of CCP1CON SFR along with its format

Compare mode, consider 2 timers and 2 signals are given to both, we will compare the signals
of timers, so if both signals match is found after comparing so a particular event is detected.
Capture mode, We will give reference signal to one of the PIN, so that event is capture and
called as capture mode.
We will be using TIMER0, TIMER1 and TIMER3
So for Comparing we will be using TIMER1 or TIMER3
For Capture we will be using TIMER1 or TIMER3
For PWM i.e PWM Waveform generation we will be using TIMER2.
For CCP Mode we will be using 3 Registers
1. CCP1CON Reg of 8 Bit
2. CCPR1High: CCPR1Low of 16bit register
3. Duty Cycle Register of 10 Bit for PWM
CCP1CON Register means CCPWM1Control Register
The all 8 bit registers are used for CCP working
First 2 MSB bits are reserved for future use.
Next 2 bits are DUTY CYCLE Bits named as DC1B1 and DC1B0 Bits which consist of 2 bits
out of 10 bits and remaining 8 bits are taken from CCPR1Low.
i.e DC1B1 and DC1B0 = 2 Bits
CCPR1Low = 8 Bits i.e 2 + 8 = 10 Bits
CCP1M3 to CCP1M0 are compare, capture and Pulse width Modulation
They are 4 bits so 16 Bit combination will form.
e.g 0100 = Capture Mode and down arrow indicate for falling edge.
0101= Capture Mode and up arrow indicate for rising edge.
0110= Capture Mode for 4th rising edge.
0111= Capture Mode for 16th rising edge.
1000= Compare Mode i.e (CCPIF Bit will be 1) i.e CCP pin high.
i.e after comparison the bit will be set to HIGH
1001= It is exactly opposite to bit 1000
i.e CCPIF Bit will be 0 i.e CCP pin low.
i.e after comparison the bit will be set to LOW
1010= Compare Mode CCP Pin NOT affected
1011= Compare Mode Resets timer and starts ADC
11XX= They are used for PWM Mode.

Explain operation of compare mode of PIC18FXX microcontroller with diagram

The values are compared from Timer1 and Timer3 Registers i.e TMR1 and TMR3
Timer1 is divided into Timer 1 High and Timer 1 Low. i.e 8 + 8 = 16 Bits.
Timer3 is divided into Timer 3 High and Timer 3 Low. i.e 8 + 8 = 16 Bits.
CCPR1H of 8 Bits and CCPR1L of 8 Bits i.e both 16 Bits are continuously compared with
TMR1 or TMR3 with the help of Comparator.
When any match is found then CCP1IF Flag is Triggered.
The steps to execute the program is as follows:

Explain operation of capture mode of PIC18FXX microcontroller with diagram

The important point in Capture mode is as we are using CCP1 PIN as I/P Pin. So when it is set
as I/P Pin then the event is CAPTURED.
In Compare mode CCP1 PIN was used O/P Pin.
When an event is detected in TMR1 or TMR3 Register, then it will be captured in CCPR1H
and CCPR1L 16 bit register.
The events can be captured by Rising Edge, Falling Edge, 4th Rising Edge or by 16th Rising
Edge.
The steps to execute the program in Capture mode is as:

Write a short note on SPI Protocol


Here small electronic device means LED, LCD or Analog to Digital Circuit.
So due to SPI Protocol the microcontroller can effectively communicate with the above
devices.
Synchronous Serial Communication means use of Clock Signals for Communication between
each other or while sending and receiving data.
Master to slave transfer of data is bit by bit mode or serial communication.
Data transferred between each other without Start or Stop Bits i.e without interruption.

The above pins are used for communication purpose.


Explain RS232 standard with suitable diagram.

GPIB: General Purpose Interface Bus HDLC (High-Level Data Link Control)
PCI (Peripheral Component Interconnect)
ISA (Industry Standard Architecture)
Write short note on I2C bus protocol

Here I2C is Master and ADC,LCD and Sensor are Slaves.


SDA (Serial Data Line) in Serial Communication
SCL (Serial Clock Line) in Serial Communication
Address Frame: It is the address of Slave
Here the address sent from Master match with Slave 3 i.e 010110
Software Stack: 1 Master Many Slaves, many slaves means multiple tasks, so the
multiple task are stored in stack to process.
Distinguish between synchronous and asynchronous serial communication

Explain UART module in PIC18F.


BAUD RATE: In telecommunications and electronics, baud rate (Bd) measures the
number of signal changes or symbols transmitted per second in a communication channel,
often used in serial communication.

STEP-1

Here UART1 is working as Transmitter and UART2 is working as receiver.


Data Bus is part of Microcontroller, UART1 is protocol to send data.
Data Bus send data bits to UART1 Transmitter.
UART2 is Receiver which receives data.
The data is sent in Parallel Format.
STEP-2
STEP-3

STEP-4
EXAMPLE:

ss
Subject Teacher
Prof Pravin S.Patil

You might also like