21
Microcontrollers ECE Senior Design 14 February 2018 Introduction to the PIC 8-bit Midrange Family

Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Microcontrollers

ECE Senior Design

14 February 2018

Introduction to the

PIC 8-bit Midrange Family

Page 2: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Popular Microcontrollers

• 8051 – Intel then Everyone (8-bit old)

• PIC – Microchip (8, 16 & 32bit)

• AVR – Atmel (8 & 32bit)

• MSP430 – TI (low power 16-bit)

• ARM Cortex – ARM Limited (32 bit)

• 68HCSxx – Motorola/freescale-NXP (old)

• PSoC – Cypress (M8C, 8051,ARM)

• Nios II / MicroBlaze – Altera / Xilinx (sc)

Blue = commonly used in Senior Design

Page 3: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)
Page 4: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

What the does PIC stand for anyway?

PIC – “Peripheral Interface Controller”

The original PIC was

designed to be a

Peripheral Interface

Controller for 6502

microcontroller from

Rockwell late 70's.

Page 5: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Why did we choose Microchip

PIC Family of Microcontrollers?

• Free development software MPLAB IDE (Includes a Simulator)

• Low cost development hardware (Boards starting at $10)

• Devices are easy to obtain through distributors and can be sampled

• A wide range of devices are available with varying feature sets

• Microchip is in continuous development of new PIC devices

• Has a large online support community

• Wide acceptance in industry over 15 Billion units shipped (1B/yr)

Page 6: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Datasheet Feature Page 16F18324

• Datasheet PIC16F18324

• Processor Structure of the PIC16F18324

• Device Pins for the PIC16F18324

Page 7: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Microcontroller Block Diagram

Page 8: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

GPIO PIC16F18324

• Port A (RA0, RA1, RA2, RA3, RA4, RA5)

• Port C (RC0, RC1, RC2, RC3, RC4, RC5)

Page 9: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Generic Port Structure

Page 10: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

TRIS: Hi-Z (input)

Page 11: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

TRIS: Output

Page 12: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

TRISIA Register

Page 13: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Blink an LED

Page 14: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Blink an LED

Page 15: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

LATA Register

Page 16: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Read a Switch

Page 17: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Read a Switch

Page 18: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

PORTA Register

Page 19: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

ANSELA Register

Page 20: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Program Memory

Map and Stack

• Reset Vector - 0000h

• Interrupt Vector - 0004h

• Program Memory - 4096

• Stack Depth - 16

Page 21: Introduction to the PIC 8-bit Midrange Familyseniordesignlab.com › ... › Microcontrollers...the-PIC.pdf · Popular Microcontrollers • 8051 –Intel then Everyone (8-bit old)

Data Memory (32 Banks total)