DEL216D - PIC Chapter 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Microcontroller Introduction

Chapter 1 – PIC Notes

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Aims and Objectives
• Aims:
• To introduce microcontrollers in general
• To introduce the PIC16F627(A) microcontroller

• Objectives
• After completing this chapter you should be able to:
• List the advantages of using a microcontroller in place of several discrete IC's
• List the features of a PIC16F627(A)
• Identify the different packages of the PIC16F627(A)
• Use the PDIP pin diagram to identify and discuss the pin functions of the PIC16F627(A)
• Use the internal block diagram to identify and discuss different internal components found in
the PIC16F627(A)
• Describe and motivate typical application areas for a microcontroller

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Introduction
• A PIC, in this context is a microcontroller circuit manufactured by Microchip Technology
• PICs are usually supplied empty and the programmer must write a program to be
executed
• Various languages exist, although C and Assembler are the most common
• A lot of different PIC families exist with different features and peripherals
• You also do get microcontrollers from other manufacturers i.e. Texas Instruments, etc.
Microcontroller Microprocessor
Own program memory Are the ‘brain’ only
Built in Input / Output ports Needs a lot of external peripheral
Built in Clock oscillator components to realize input/output,
Built in other peripherals i.e. Timers, etc. memory, etc. capabilities

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Advantages of using Microcontrollers
• Takes less space than discrete IC’s therefore
• Costs less to build
• Have a simpler printed circuit board (PCB) and are therefore easier to build
• Will have a reduced overall size
• Higher clock speeds coupled with single word instructions allow faster
data processing
• Power saving
• Less IC’s are being used
• Microcontrollers are CMOS device using very little power

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Features of the PIC16F627(A)
• 15 I/O pins with individual direction control
• High current sink / source for direct LED drive
• Analogue comparator module
• Two independent 8-bit timers
• One 16-bit timer
• Capture / Compare / PWM module
• USART (Universal Synchronous/Asynchronous Receiver/Transmitter)
• 6 Selectable oscillator modes
• Wide operating voltage: 3.0V to 5.5V
• An instruction execution cycle of 1μsec at a clock frequency of 4MHz

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Applications
• The PIC fits many uses:
• Automotive industries
• Home appliances
• Remote sensors
• Electronic door locks and other safety devices
• It is flexible in applications due to:
• EEPROM which is used to permanently save parameters for codes and
calibration data
• In-Circuit Serial Programming allows the device to be programmed while in
the end circuit.

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Package Description
• The PIC comes in a variety of packages

DIP SOIC SSOP QFN


(Dual In-Line Package) (Small Outline IC) (Shrink Small-Outline Package) (Quad Flat Pack No Leads

Figure 1.1 Different Package Types (not to scale) (Spies, 2020, p4)

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
PDIP Pinouts and Descriptions

Figure 1.2 PDIP Pinouts (Spies, 2020, p4)

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Internal Architecture
• Built using the Harvard Architecture where:
• Separate buses and memories for program and data, increasing bandwidth
• Data bus is 8-bits wide
• Instruction opcodes are 14-bits wide
• Program memory is 14-bits wide
• 2-stage pipeline which overlaps fetch and execution of each instruction. All
instructions, except branching instructions, are executed in 1 cycle
• FLASH Program Size = 1024 x 14
• RAM Data = 224 x 8
• EEPROM Data = 128 x 8

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Block Diagram
• Shows a selection of
internal components
• It is easy to see where the
buses are and how the
different components
connect to each other

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
FLASH Program
Memory
• It is where the program is
stored
• Can be reprogrammed
• Size is 1024 x 14 bits
• One instruction per
memory location equals
1024 lines of code
• Other PICs have different
memory sizes

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
RAM File Registers
• Contains addressable
locations of Special
Function Registers and
General Purpose Registers
• Divided into 4 banks

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
PortA(5h) and PortB(6h)
• These are IO ports used to
communicate with the
outside world
• PORTA and PORTB is 8-bits
• The bits inside the
associated registers controls
the data on the physical
pins

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
Timers 0, 1, 2
• Timer 0 and 2 is 8-bit timers
• Timer 1 is 16-bit
• Can be used as timers or
counters

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
Comparator
• Contains 2 analogue
comparator modules
• Inputs are multiplexed with
pins on PORTA
• The output of the
comparators is mapped to
the CMCON register

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Voltage reference
• Provides a selectable
voltage reference for the
comparator module

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
Data EEPROM
• Readable and Writeable
EEPROM memory for non-
volatile storage
• Size: 127 x 8 bits

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
W register
• An 8-bit register used by
the ALU
• ALL data go through the W
register

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
Program Counter
• Is a 13-bit counter
• Can address 8k x 14-bit
program memory
• The PC points to the
instruction that must be
executed

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
Figure 2.1 Block Diagram (Microchip, 2003. p8)
Summary
• In this chapter, the PIC16F627 was introduced by looking at
• What a microcontroller is,
• Advantages of using a microcontroller,
• Where it can be used,
• The purpose of the pins found on the DIP package,
• And we identified the principal parts of the PIC by discussing the internal
block diagram

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
End of Chapter
Any Questions?

Faculty of Information and Communication Technology


Department of Computer Systems Engineering
References
• Microchip, 2003. PIC16F62X Data Sheet. [online] Microchip
Technology. Available at:
<https://ww1.microchip.com/downloads/en/DeviceDoc/40300c.pdf>
[Accessed 4 June 2020].
• Spies, J., 2022. An Introduction To Microcontroller Concepts Using The
PIC Microcontroller.

Faculty of Information and Communication Technology


Department of Computer Systems Engineering

You might also like