smarter systems and the pic® 18fxx2 chapter one 12.1 – 12.5 dr. gheith abandah1

27
Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah 1

Upload: brianna-dickerson

Post on 22-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Smarter systems and the PIC® 18FXX2

Chapter One12.1 – 12.5

Dr. Gheith Abandah 1

Page 2: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Outline

• Introduction of 18 Series• 18 Series Architecture

– Pin Out– Block Diagram– Status Register

• 18 Series Instruction Set• 18 Series Memory Organization

– Data Memory– Stack– Program Memory– Configuration Words

• SummaryDr. Gheith Abandah 2

Page 3: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

PIC FamiliesPIC Family Stack Size Instruction

Word SizeNo of

InstructionsInterrupt Vectors

12CX/12FX 2 12- or 14-bit 33 None

16C5X/16F5X 2 12-bit 33 None

16CX/16FX 8 14-bit 35 1

17CX 16 16-bit 58 4

18CX/18FX 32 16-bit 75 2

Dr. Gheith Abandah 3

‘C’ implies CMOS technology; Complementary Metal Oxide Semiconductor

‘F’ insert indicates incorporation of Flash memory technology

Example: 16C84 was the first of its kind. It was later reissued as the 16F84, incorporating Flash memory technology. It was then reissued as 16F84A.

Page 4: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The PIC 18 series introduction• Similar to 16 Series

– RISC, pipelined, 8-bit CPU, with single Working (W) and Status registers

– Many peripherals identical or very similar– Similar packages and pinouts– Many Special Function Register (SFR) and bit names

unchanged– All but one of the 16 Series instructions are part of the

18 Series instruction set– Instruction cycle made up of four oscillator cycles.

Dr. Gheith Abandah 4

Page 5: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The PIC 18 series introduction• New for 18 Series

– The number of instructions more than doubled, with 16-bit instruction word

– Enhanced Status register– Hardware 8 × 8 multiply– More external interrupts– Two prioritized interrupt vectors– Radically different approach to memory structures, with increased

memory size– Enhanced address generation for program and data memory– Bigger Stack, with some user access and control– Phase-locked loop (PLL) clock generator.

Dr. Gheith Abandah 5

Page 6: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18FXX2 sub-family

• All 18FXX2 devices have:• an instruction set of 75 instructions,• clock oscillator that can run to 40 MHz,• ‘low-power’ versions of each microcontroller

are available, coded 18LFXX2.

Dr. Gheith Abandah 6

Page 7: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18FXX2 sub-family

Dr. Gheith Abandah 7

Page 8: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Pin Diagrams – 28 pins

Dr. Gheith Abandah 8

18F242 and 18F252

Page 9: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Pin Diagrams – 40 pins

Dr. Gheith Abandah 9

18F442 and 18F452

Page 10: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18F2X2 block diagram 1/3

Dr. Gheith Abandah 10

Page 11: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18F2X2 block diagram 2/3

Dr. Gheith Abandah 11

Page 12: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18F2X2 block diagram 3/3

Dr. Gheith Abandah 12

Page 13: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18FXX2 Status Register

• C: Carry/Borrow’• DC: Digit Carry/Borrow’• Z: Zero• OV: Overflow• N: Negative

Dr. Gheith Abandah 13

Page 14: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18 Series instruction set 1/5

Dr. Gheith Abandah 14

Page 15: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18 Series instruction set 2/5

Dr. Gheith Abandah 15

Page 16: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18 Series instruction set 3/5

Dr. Gheith Abandah 16

Page 17: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18 Series instruction set 4/5

Dr. Gheith Abandah 17

Page 18: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The 18 Series instruction set 5/5

Dr. Gheith Abandah 18

Page 19: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Instruction encoding 1/4

Dr. Gheith Abandah 19

Page 20: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Instruction encoding 2/4

Dr. Gheith Abandah 20

Page 21: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Instruction encoding 3/4

Dr. Gheith Abandah 21

Page 22: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Instruction encoding 4/4

Dr. Gheith Abandah 22

Page 23: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The data memory map

Dr. Gheith Abandah 23

Page 24: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

The PIC 18F242 Special Function Registers

Dr. Gheith Abandah 24

Page 25: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

‘Virtual’ registers used in indirect addressing

Dr. Gheith Abandah 25

Page 26: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Program memory

Dr. Gheith Abandah 26

Page 27: Smarter systems and the PIC® 18FXX2 Chapter One 12.1 – 12.5 Dr. Gheith Abandah1

Summary• The 18 Series microcontrollers represent a very clear step

forward in the PIC design strategy. The CPU and memory structure are radically redeveloped, while many peripherals are retained.

• The instruction set is increased to 75 distinct instructions, with big new capability in arithmetic, program branching, table access and memory usage.

• Data memory is structured to give a much greater RAM capacity and a separate grouping of Special Function Registers.

• Program memory has greatly increased capacity, with larger address bus, and the 16-bit instructions are now split into 2 bytes for storage. The Stack is deeper and more flexible.

Dr. Gheith Abandah 27