PIC Microcontroller
PIC Microcontroller
• Program Memory: 32 K
– Address range: 000000 to 007FFFH
• Data Memory: 4 K
– Address range: 000 to FFFH
• Data EEPROM
– Not part of the data memory space
– Addressed through special function registers
2. Data Memory Banks/BSR SELECTION
PIC18 I/O Ports
• Five I/O ports
– PORT A through PORT E
– Most I/O pins are multiplexed
– Generally have eight I/O pins
– Addresses already assigned to these ports
– Each port is identified by its assigned SFR
PIC18 I/O Ports
• The series of PIC16 consists of five ports such as Port A,
Port B, Port C, Port D & Port E.
• Port A is an 16-bit port that can be used as input or output
port based on the status of the TRISA (Tradoc Intelligence
Support Activity) register.
• Port B is an 8- bit port that can be used as both input and
output port.
• Port C is an 8-bit and the input of output operation is
decided by the status of the TRISC register.
• Port D is an 8-bit port acts as a slave port for connection to
the microprocessor BUS.
• Port E is a 3-bit port which serves the additional function
of the control signals to the analog to digital converter
Diagram of I/O Ports
Feature of Timer 0
• 8-bit timer/counter
• Readable and writable
• 8-bit software programmable prescaler
• Internal (4 Mhz) or external clock select
• Interrupt on overflow from FFh to 00h
• Edge select (rising or falling) for external clock
TimerO Control Register
Timer 1 Timer 1 (TMR1)
16-bit timer/counter
Polling
External
System
Interrupts
Software Hardware
Interrupt Interrupt
Request from software Request from external
R.Hariharan AP / EEE - SECE
Hardware device
PIC16C7X family has up to 12 sources of interrupt External
• Timer 0
• Timer 1
• RB Port Change
• Parallel Slave Port Read/Write
• A/D Converter
• USART Receive
• USART Transmit
• Synchronous Serial Port
• CCP1 (Capture, Compare, PWM)
• CCP2 (Capture, Compare, PWM)
• TMR2 to PR2 Match