0% found this document useful (0 votes)
5 views

Lecture 3

The document outlines the architecture of microcontrollers (MCUs), focusing on RISC and CISC architectures, with examples of 8-bit controllers from various manufacturers. It details the features and specifications of PIC microcontrollers, particularly the PIC16F877, including its memory structure and key registers. Additionally, it describes programming basics and hardware components associated with PIC microcontroller systems.

Uploaded by

sigma.elev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lecture 3

The document outlines the architecture of microcontrollers (MCUs), focusing on RISC and CISC architectures, with examples of 8-bit controllers from various manufacturers. It details the features and specifications of PIC microcontrollers, particularly the PIC16F877, including its memory structure and key registers. Additionally, it describes programming basics and hardware components associated with PIC microcontroller systems.

Uploaded by

sigma.elev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Lec3: MCU architecture

+
MCU Architecture
 RISC (Harvard)
 Reduced instruction set computer
 Simple operations
 Simple addressing modes
 Longer compiled program but faster to execute
 Uses pipelining

 CISC (Von Neuman)


 Complex instruction set computer
 More complex instructions (closer to high level language support)
+ RISC V/s CISC Processors/Controllers
+ Main 8-bit Controllers
 Microchip-- PIC® Microcontrollers
 RISC architecture (reduced instruction set computer)
 Has sold over 2 billion as of 2002
 Cost effective and rich in peripherals
 Motorola– now Freescale
 CISC architecture
 Has hundreds of instructions
 Examples: 68HC05, 68HC08, 68HC11
 Intel– now Marvell
 CISC architecture
 Has hundreds of instructions
 Examples: 8051, 8052
 Many difference manufacturers: Philips, Dallas/MAXIM Semiconductor, etc.
 Atmel
 RISC architecture (reduced instruction set computer) –
 Cost effective and rich in peripherals
 AVR
+ A Microprocessor-Based Embedded System.

• nonmaskable interrupt (NMI) – that is, an interrupt that


cannot be ignored.
+
PIC Peripheral Interface Controller
+
What is PIC microcontrollers?

 PIC Microcontrollers are small computer on


a chip with some special properties:
 CPU, code memory, data memory and IO
Ports all included on a single chip.
 Dedicated to one task.
 Small and low cost.
 Embedded in many consumer devices.

 Easy to program.

 Low cost.
+
Specifications of PIC
+
PIC Microcontroller product family
+
PIC Microcontroller product family
 The F in a name generally indicates the PIC micro uses flash memory and can be erased electronically.

 The C generally means it can only be erased by exposing the die to ultraviolet light (which is only
possible if a windowed package style is used). An exception to this rule is the PIC16C84 which uses
EEPROM and is therefore electrically erasable.
+ Features for PIC16F877
+ PIC16F877 Internal Block Diagram

 The basic architecture of PIC16F877 consists of Program memory,


file registers and RAM, ALU and CPU registers.
+
Memory of the PIC16F877
 divided into 3 types of memories:
1. Program Memory – A memory that contains the program (which we had written), after
we've burned it. As a reminder, Program Counter executes commands stored in the
program memory, one after the other.
2. Data Memory – This is RAM memory type, which contains a special registers like SFR
(Special Function Register) and GPR (General Purpose Register). The variables that we
store in the Data Memory during the program are deleted after we turn off the micro.
These two memories have separated data buses, which makes the access to each one of
them very easy.
3. Data EEPROM (Electrically Erasable Programmable Read Only Memory) – A memory that
allows storing the variables as a result of burning the written program.
+
PIC16F877A Registers

 Some CPU Registers:


 W
 PC (Program Counter
 FSR(File Selection Register)
 INDF(INDirect through FSR)
 PCL(Program Counter Low Byte)
 PCLATH(Program Counter LATcH)
 STATUS
+
Program Counter
 Program Counter (PC) is 13 bit and capable of addressing an 8K word x 14 bit program memory space.
 PC keeps track of the program execution by holding the address of the current instruction.
 It is automatically incremented to the next instruction during the current instruction execution.

 Program Counter Stack


 an independent 8-level stack is used for the program counter.
 As the PC is 13-bit, the stack is organized as 8x13bit registers.
 When an interrupt occurs, the PC is pushed onto the stack. When the interrupt is being served, other
interrupts remain disabled.
 Hence, other 7 registers of the stack can be used for subroutine calls within an interrupt service routine
or within the mainline program.
+
FSR & INDF

 FSR Register
 (File
Selection Register, address = 04H, 84H) is an 8-bit register
used as data memory address pointer. This is used in indirect
addressing mode.

 INDF Register
 (INDirect through FSR, address = 00H, 80H) INDF is not a physical register.
Accessing INDF is actually access the location pointed to by FSR in indirect
addressing mode.
+ PCL & PCLATH

 PCL Register
 (Program Counter Low Byte, address =02H, 82H)
 PCL is actually the lower 8-bits of the 13-bit Program
Counter. This is a both readable and writable register.
 PCLATH Register
 (Program Counter LATcH, address = 0AH, 8AH)
 PCLATH is a 8-bit register which can be used to decide the
upper 5-bits of the PC. PCLATH is not the upper 5bits of the
PC.
 PCLATH can be read from or written to without affecting
the PC.
 The upper 3 bits of PCLATH remain zero and they serve no
purpose. When PCL is written to, the lower 5bits of PCLATH
are automatically loaded to the upper 5bits of the PC.
+ Memory Map Registers

 Inorder to start programming and build automated system, there is no need


to study all the registers of the memory map, but only a few most important
ones:
 STATUS register – changes/moves from/between the banks.
 PORT registers – assigns logic values (“0”/”1”) to the ports
 TRIS registers – data direction register (input/output)
+
Upstream - BL0011 - 8-Bit PIC Programmer

 The board comes complete with a


powerful PIC16F18877
microcontroller.
 The board presents all port pins
collected together as E-blocks 2
sockets.
 The board takes power from an
external power supply or from the
micro USB port.
+
BL0011 –Block diagram
+
BL0011 Layout
+
+
BL0114 – E-block2 combo board

• 16 individual LEDs
• 16 individual switches
• Quad 7-segment display
• 20 x 4 character alphanumeric LCD
• On-board analogue channels (Light /
Potentiometer)
• Audio output socket
+
Adding digital outputs - Light the LED
 Create a program that lights an LED attached to the microcontroller.
 This program introduces the topic of how to control a digital output.

You might also like