2. WHAT IS A MICROCONTROLLER
• A smaller computer
• On-chip RAM, ROM, I/O ports...
• Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8
and PIC 16X
CPU RAM ROM
A single chip
Serial Microcontroller
I/O
Timer COM
Port
Port
3. HOW IT IS DIFFERENT FROM A
MICROPROCESSOR
General-purpose microprocessor
• CPU for Computers
• No RAM, ROM, I/O on CPU chip itself
• Example:Intel’s x86, Motorola’s 680x0
Data Bus
CPU
General-
Serial
Purpose RAM ROM I/O Timer COM
Micro- Port
Port
processor
Address Bus
5. IMPORTANT FEATURES OF
PIC 16F73
• High performance RISC CPU.
• There is Only 35 single word instructions.
• 4K Bytes Flash Program Memory.
• 192 Bytes RAM.
• Three I/O ports – PORT A = 6 Bit.
PORT B & C = 8 Bit.
• on-chip RC Oscillator.
7. PIC MEMORY
• The PIC 16F73 has 4 kbytes of program
memory.
• 192 Bytes Registers as Data Memory :
Special Function Registers: used to control
peripherals and PIC behaviors.
General Purpose Registers: used for temporary
storage of data.
8. PIC PROGRAM MEMORY
Takes a max of 8 addresses, the
ninth address will write over the
first.
When the controller is
reset, program execution starts
from here.
If interrupted, program execution
continues from here.
9. PIC DATA MEMORY
The most
important
registers
have
addresses
in all the
four
banks
The data memory is divided into 4 memory banks
10. PERIPHERAL FEATURES OF PIC
• Three timers –Timer0: 8-bit timer
Timer1: 16-bit timer
Timer2: 8-bit timer
• Two PWM modules
• 8-bit, 5-channel Analog-to-Digital converter.
• USART And SSP Serial Communication.
• Brown-out detection circuitry with Watchdog
timer.
11. PIC Peripherals: Timers
The PIC16F73 has 3 Timers
They can be used as-
TIMER: When The clock source is the internal crystal
frequency of the PIC.
COUNTER: When an external pulse is given from the
input pin.
For timer0 input pin is pin number 6 i.e TOCKI
For timer1 input pin is pin number 11 i.e T1CKI
12. Special features of timers
Only timer0 and timer1 can be used as a Timer
and Counter. Timer2 is related with PWM
wave generation.
Every timer is associated with pre-scaler factor.
Generate interrupts on timer overflow.
There is a Watchdog Timer with brown out
detection circuit.
16. PIC Peripherals: PWM
PWM stands for pulse width modulation.
It is generally used to slow down the speed of
motors by varying the duty cycle of the period.
DUTY CYCLE is given by- Ton time / T total time
The ratio between ON and OFF
state of the pulse determines the amount of
energy tranferred to the device.
18. PIC Peripherals: ADC
• ADC stands for analog to digital comparator.
• In PIC16F73 there is 8 bit , 5 channels ADC.
Therefore there are 256 combinations
• For conversion of analog voltage to digital
first we have to make a least count matching
between the two devices.
Least Count=Vref. /resolution
19. BLOCK DIAGRAM OF ANALOG TO
DIGITAL CONVERTER
The A/D module has four registers. These registers are:
A/D Result Register (ADRES)
A/D Control Register0 (ADCON0)
A/D Control Register1 (ADCON1)
21. USART REGISTERS
USART stands for synchronous asynchronous serial receiver
and transmitter
IT DEALS WITH TWO REGISTERS:
TXSTA : Transmit status and control register.
RXSTA : Receive status and control register.
In synchronous communication we have to give the same
clock to both the transmitter and receiver whereas
In asynchronous communication we have to make the baud
rate( data transfer rate ) of both the transmitter and
receiver same.