Top Banner
PIC16C7X 8 BIT MICROCONTROLLERS WITH A/D CONVERTERS
36
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PIC16C7X

PIC16C7X

8 BIT MICROCONTROLLERS WITH A/D CONVERTERS

Page 2: PIC16C7X

Core Features of PIC16C7X High performance RISC (Reduced Instruction Set

Computing) CPU 35 single word instructions 20MHz clock input – internally divided by 4 200ns instruction cycle Harvard architecture In built Program Memory

PIC16C72 2K X 14 words PIC16C73/73A 4K X 14 words PIC16C74/74A 4K X 14 words PIC16C76/77 8K X 14 words

Page 3: PIC16C7X

• In built Data Memory PIC16C72 128 X 8 PIC16C73/73A/74/74A 192 X 8 PIC16C76/77 368 X 8

• External & Internal interrupt capability• 8 level deep stack• Direct, Indirect & Relative addressing modes• Power saving SLEEP mode• Power On Reset (POR)• PWRT, OST, WDT• Programmable Code protection

Page 4: PIC16C7X

Peripheral Features of PIC16C7X• I/O pins

PIC16C72/73/73A/76 22 pins (Ports A, B, C)PIC16C74/74A/77 33 pins (Ports A, B, C, D, E)

• 2 Capture/Compare/PWM Modules• 3 Timer Modules • A/D Channels

PIC16C72/73/73A/76 5 channelsPIC16C74/74A/77 8 channels

• Serial Communication – SPI, I2 C, USART• Brown Out Reset except in PIC16C73/74• Interrupt Sources

PIC16C72 8 sourcesPIC16C73/73A/76 11 sourcesPIC16C74/74A/77 12 sources

• 8 bits wide Parallel Slave Port – available in PIC16C74/74A/77

Page 5: PIC16C7X

Architecture of PIC16C72

Page 6: PIC16C7X

Architecture of PIC16C73/73A/76

Page 7: PIC16C7X

Architecture of PIC16C74/74A/77

Page 8: PIC16C7X

Clocking Scheme

• Clock input is internally divided by 4 (Q1, Q2, Q3 and Q4) each of 5MHz.

• PC is incremented for every Q1

• Instruction is latched for every Q4

Page 9: PIC16C7X

Stack & Program Memory Organization

PIC16C72 PIC16C73/73A/74/74A

Page 10: PIC16C7X

PIC16C76/77 – Program Memory & Stack

Page 11: PIC16C7X

Data Memory Organization

• Multiple bank organization with General Purpose registers and Special Purpose registers

• Each bank capacity – 128 bytes (00 – 7FH )

• General Purpose registers – (20H - 7FH )

• Special Purpose registers – (00 – 1FH)

• Banks are selected using RP1 & RP0 in status register

Page 12: PIC16C7X

Data MemoryPIC16C72 Register File Map PIC16C73/73A/74/74A Register File Map

Page 13: PIC16C7X

PIC16C76/77 – Data memory

Page 14: PIC16C7X

Special Function Registers• PORT A / TRIS A – 6 bits wide• Setting a bit in Data Direction Register TRISB – hi-impedance input

mode• Clearing a bit in TRIS B – output mode• PORT A is multiplexed with analog inputs• Operation of each pin is selected by clearing or setting ADCON1

register RA0/AN0 – Input / Output or Analog Input RA1/AN1 – Input / Output or Analog Input RA2/AN2 – Input / Output or Analog Input RA3/AN3/Vref – Input / Output or Analog Input or V reference RA4/T0CK1 – Input / Output or External Clock input for Timer 0 RA5/AN4/SS – Input / Output or Analog Input or slave select input for SSP

Page 15: PIC16C7X

• PORT B – 8 bit bidirectional portData Direction Register – TRIS BSetting a bit in Data Direction Register TRISB – hi-

impedance input modeClearing a bit in TRIS B – output modePort B pins have a weak internal pull up. The pull

ups are enabled by RBPU in OPTION register.The pins can be programmed as input or output.

Page 16: PIC16C7X

• PORT C – 8 bit bidirectional port• Data Direction Register – TRIS C• Each pin can be configured as I/O using TRIS C register• Peripheral functions are multiplexed with Port C

RC0/T1OSO/T1CK1 – I/O or Timer 1 Oscillator Output or Timer 1 Clock input RC1/T1OSI/CCP2 – I/O or Timer 1 Oscillator input or Capture2 input,

Compare2 output, PWM2 output RC2/CCP1 - I/O or Capture1 input, Compare1 output, PWM1 output RC3/SCK/SCL – I/O or Synchronous serial clock for both SPI and I2C modes RC4/SDI/SDA – I/O or SPI Data input in SPI mode or data I/O in I2C mode RC5/SDO – I/O or SSP data output RC6/TX/CK - I/O or USART asynchronous transmit or USART synchronous

clock RC7/RX/DT - I/O or USART asynchronous receive or USART synchronous clock

• Some peripherals may override TRISC. So, TRISC destination should be avoided

Page 17: PIC16C7X

• PORT D – applicable to PIC16C74/74A/77• Data Direction Register - TRISD• Can be programmed as Input or Output• Configured as 8 bit wide Microprocessor –

Parallel Slave Port• The PSP mode can be selected by setting bit 4

in TRISE register

Page 18: PIC16C7X

• PORT E – applicable to PIC16C74/74A/77

• Data Direction Register – TRISE• Port E is the control port for the

Parallel slave port (Port D)• Port E pins are multiplexed with

analog inputs• PORT E - RE0/RD/AN5,

RE1/WR/AN6and RE2/CS/AN7

Page 19: PIC16C7X

STATUS Register

Page 20: PIC16C7X

OPTION Register

Page 21: PIC16C7X

INTCON Register

Page 22: PIC16C7X

PIE1 Register – PIC16C72

Page 23: PIC16C7X

PIE1 Register - PIC16C73/73A/74/74A/76/77

Page 24: PIC16C7X

PIR1 Register – PIC16C72

Page 25: PIC16C7X

PIR1 Register - PIC16C73/73A/74/74A/76/77

Page 26: PIC16C7X

PIE2 Register – PIC16C72

Page 27: PIC16C7X

PIR2 Register – PIC16C72

Page 28: PIC16C7X

PCON Register

Page 29: PIC16C7X

Program Counter

PCL & PCLATH• PC register – 13 bits wide• PCL (0 – 7) – readable &

writable• PCH (8 – 12) – not readable• PCH – writable using

PCLATH register

Page 30: PIC16C7X

Addressing Modes

• The method of specifying the data to be used in the instruction

• Types• Direct Addressing Mode• Indirect Addressing Mode• Relative Addressing Mode

Page 31: PIC16C7X

Direct Addressing Mode

• Uses RP0 and RP1 of STATUS Register to select RAM memory banks

• Done through 9 bit address – bits 0 to 7 indicates the address of bank, and bits 8,9 indicate bank selection bits

Page 32: PIC16C7X

Indirect Addressing Mode

• Uses IRP bit of STATUS Register to select RAM memory banks

• Done through 8 bit address – bits 0 to 7 indicates the address of bank, and bit 8 indicate the bank selection bit

• Used for erasing a part of RAM memory

• Used while programming in serial communication

Page 33: PIC16C7X

Relative Addressing Mode

• Used to specify the number of locations to be shifted from the current address of PC

• Locations to be shifted is specified by an offset• New PC address = next PC address + offset• Example : GOTO k

CALL k

Page 34: PIC16C7X

Instruction Set

Page 35: PIC16C7X

Instruction Set

Page 36: PIC16C7X

Instruction Set