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 Summary Dr. Gheith Abandah2
PIC Families PIC FamilyStack SizeInstruction Word Size No of Instructions Interrupt Vectors 12CX/12FX212- or 14-bit33None 16C5X/16F5X212-bit33None 16CX/16FX814-bit351 17CX1616-bit584 18CX/18FX3216-bit752 Dr. Gheith Abandah3 ‘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.
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 Abandah4
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 Abandah5
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 Abandah6
The 18FXX2 sub-family Dr. Gheith Abandah7
Pin Diagrams – 28 pins Dr. Gheith Abandah8 18F242 and 18F252
Pin Diagrams – 40 pins Dr. Gheith Abandah9 18F442 and 18F452
The 18F2X2 block diagram 1/3 Dr. Gheith Abandah10
The 18F2X2 block diagram 2/3 Dr. Gheith Abandah11
The 18F2X2 block diagram 3/3 Dr. Gheith Abandah12
The 18FXX2 Status Register C: Carry/Borrow’ DC: Digit Carry/Borrow’ Z: Zero OV: Overflow N: Negative Dr. Gheith Abandah13
The 18 Series instruction set 1/5 Dr. Gheith Abandah14
The 18 Series instruction set 2/5 Dr. Gheith Abandah15
The 18 Series instruction set 3/5 Dr. Gheith Abandah16
The 18 Series instruction set 4/5 Dr. Gheith Abandah17
The 18 Series instruction set 5/5 Dr. Gheith Abandah18
Instruction encoding 1/4 Dr. Gheith Abandah19
Instruction encoding 2/4 Dr. Gheith Abandah20
Instruction encoding 3/4 Dr. Gheith Abandah21
Instruction encoding 4/4 Dr. Gheith Abandah22
The data memory map Dr. Gheith Abandah23
The PIC 18F242 Special Function Registers Dr. Gheith Abandah24
‘Virtual’ registers used in indirect addressing Dr. Gheith Abandah25
Program memory Dr. Gheith Abandah26
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 Abandah27