PIC (Peripheral Interface Controller) PIC Is A Family of Harvard Architecture Microcontrollers Made by
PIC (Peripheral Interface Controller) PIC Is A Family of Harvard Architecture Microcontrollers Made by
PIC (Peripheral Interface Controller) PIC Is A Family of Harvard Architecture Microcontrollers Made by
INTRODUCTION
PIC is a family of Harvard architecture microcontrollers made by
Microchip Technology, derived from the PIC1640 originally developed
by General Instrument's Microelectronics Division. The name PIC
initially referred to "Peripheral Interface Controller"
PICs are popular with both industrial developers and hobbyists alike
due to their low cost, wide availability, large user base, extensive
collection of application notes, availability of low cost or free
development tools, and serial programming (and re-programming
with flash memory) capability.
CORE ARCHITECTURE
The PIC architecture is characterized by its multiple attributes:
Code space
The code space is generally implemented as ROM, EPROM or flash
ROM. In general, external code memory is not directly addressable
due to the lack of an external memory interface. The exceptions are
PIC17 and select high pin count PIC18 devices.
Word size
All PICs handle (and address) data in 8-bit chunks. However, the unit
of addressability of the code space is not generally the same as the
data space. For example, PICs in the baseline and mid-range families
have program memory addressable in the same wordsize as the
instruction width, i.e. 12 or 14 bits respectively. In contrast, in the
PIC18 series, the program memory is addressed in 8-bit increments
(bytes), which differs from the instruction width of 16 bits.
In order to be clear, the program memory capacity is usually stated in
number of (single word) instructions, rather than in bytes.
Stacks
PICs have a hardware call stack, which is used to save return
addresses. The hardware stack is not software accessible on earlier
devices, but this changed with the 18 series devices.
Hardware support for a general purpose parameter stack was lacking
in early series, but this greatly improved in the 18 series, making the
18 series architecture more friendly to high level language compilers.
Instruction set
A PIC's instructions vary from about 35 instructions for the low-end
PICs to over 80 instructions for the high-end PICs. The instruction set
includes instructions to perform a variety of operations on registers
directly, the accumulator and a literal constant or the accumulator and
a register, as well as for conditional execution, and program
branching.
Some operations, such as bit setting and testing, can be performed
on any numbered register, but bi-operand arithmetic operations
always involve W (the accumulator), writing the result back to either
W or the other operand register. To load a constant, it is necessary to
load it into W before it can be moved into another register. On the
older cores, all register moves needed to pass through W, but this
changed on the "high end" cores.
PIC cores have skip instructions which are used for conditional
execution and branching. The skip instructions are 'skip if bit set' and
'skip if bit not set'. Because cores before PIC18 had only
unconditional branch instructions, conditional jumps are implemented
by a conditional skip (with the opposite condition) followed by an
unconditional branch. Skips are also of utility for conditional execution
of any immediate single following instruction.
The 18 series implemented shadow registers which save several
important registers during an interrupt, providing hardware support for
automatically saving processor state when servicing interrupts.
In general, PIC instructions fall into 5 classes:
One accumulator
Register-bank switching is required to access the entire RAM of
many devices
Operations and registers are not orthogonal; some instructions
can address RAM and/or immediate constants, while others can
only use the accumulator