Você está na página 1de 10

NAME: N.KEERTHIKA YEAR,SEM: III-IV REG,NO:83109133507 SUB.CODE: EC301 ASSIGNMENT NO.: TOPIC: PIC & ARM DATE:12.09.

2011

INTRODUCTION PROCESSOR

TO

ARM

ARM is a 32-bit reduced instruction set computer (RISC) instruction set architecture (ISA) developed by ARM Holdings. It was known as the Advanced RISC Machine, and before that as the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in terms of numbers produced. Originally conceived by Acorn Computers for use in its personal computers, the first ARM-based products were the Acorn Archimedes range introduced in 1987. The relative simplicity of ARM processors makes them suitable for low power applications. As a result, they have become dominant in the mobile and embedded electronics market, as relatively low-cost, small microprocessors and microcontrollers. In 2005, about 98% of the more than one billion mobile phones sold each year used at least one ARM processor. As of 2009, ARM processors account for approximately 90% of all embedded 32-bit RISC processors. PIPELINES AND OTHER IMPLEMENTATION ISSUES The ARM7 and earlier implementations have a three stage pipeline; the stages being fetch, decode, and execute. Higher performance designs, such as the ARM9, have deeper pipelines: Cortex-A8 has thirteen stages.
2

Additional implementation changes for higher performance include a faster adder, and more extensive branch prediction logic. The difference between the ARM7DI and ARM7DMI cores, for example, was an improved multiplier (hence the added "M") COPROCESSORS The architecture provides a nonintrusive way of extending the instruction set using "coprocessors" which can be addressed using MCR, MRC, MRRC, MCRR, and similar instructions. The coprocessor space is divided logically into 16 coprocessors with numbers from 0 to 15, coprocessor 15 (cp15) being reserved for some typical control functions like managing the caches and MMU operation (on processors that have one). In ARM-based machines, peripheral devices are usually attached to the processor by mapping their physical registers into ARM memory space or into the coprocessor space or connecting to another device (a bus) which in turn attaches to the processor. Coprocessor accesses have lower latency so some peripherals (for example XScale interrupt controller) are designed to be accessible in both ways (through memory and through coprocessors).

In other cases, chip designers only integrate hardware using the coprocessor mechanism. For example, an image processing engine might be a small ARM7TDMI core combined with a coprocessor that has specialized operations to support a specific set of HDTV transcoding primitives. APPLICATIONS OF ARM consumer electronics including PDAs mobile phones digital media and music players hand-held game consoles calculators and computer peripherals such as hard drives and routers. ARM cores are used in a number of products, particularly various smartphones. Some computing examples are the Acorn Archimedes, Apple iPad and ASUS Eee Pad Transformer. Some other uses are the Apple iPod portable media player, Canon PowerShot A470 digital camera, Nintendo DS handheld games console and TomTom automotive navigation system. Since 2005, ARM was also involved in Manchester University's computer, SpiNNaker, which used ARM cores to simulate the human brain

can combine to give efficient code. None of these methods saves a great deal of execution time (although they may save some), mostly they just save code. Using the conditional instructions 1 using conditionals for logical OR CMP Rn,#p ; GOTO Label BEQ Label CMP Rm,#q BEQ Label can be replaced by CMP Rn,#p CMPNE Rm,#q ; BEQ Label 2 absolute value TEQ Rn,#0 ;test sign RSBMI Rn,Rn,#0 ;and 2's complement if necessary 3 multiplication by 4, 5 or 6 (run time) MOV Rc,Ra,LSL#2; ;multiply by 4 CMP Rb,#5 ; test value ADDCS Rc,Rc,Ra ; complete multiply by 5 ADDHI Rc,Rc,Ra ; complete multiply by 6 4 combining discrete and range tests TEQ Rc,#127 ; CMPNE Rc,# -1; MOVLS Rc,#. 5 division and remainder A number of divide routines for specific applications are provided in source form as part of the ANSI C library provided with the ARM Cross Development Toolkit,
3

INSTRUCTION SET EXAMPLES The following examples show ways in which the basic ARM processor instructions

available from your supplier. A short general purpose divide routine follows. MICROCONTROLLER A micro-controller can be compared to a small stand alone computer, it is a very powerful device, which is capable of executing a series of pre-programmed tasks and interacting with other hardware devices. Being packed in a tiny integrated circuit (IC) whose size and weight is usually negligible, it is becoming the perfect controller for robots or any machines requiring some kind of intelligent automation. A single microcontroller can be sufficient to control a small mobile robot, an automatic washer machine or a security system. Any microcontroller contains a memory to store the program to be executed, and a number of input/output lines that can be used to interact with other devices, like reading the state of a sensor or controlling a motor. Nowadays, microcontrollers are so cheap and easily available that it is common to use them instead of simple logic circuits like counters for the sole purpose of gaining some design flexibility and saving some space. Some machines and robots will even rely on a multitude of microcontrollers, each one dedicated to a certain task. Most recent microcontrollers are 'In System Programmable', meaning that you can modify the program being executed, without removing the microcontroller from its place. Today, microcontrollers are an indispensable tool for the robotics hobbyist as well as for the engineer. Starting in this field can be a little difficult, because you usually can't understand how everything works inside that
4

integrated circuit, so you have to study the system gradually, a small part at a time, until you can figure out the whole image and understand how the system works.

PIC MICROCONTROLLER

Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650 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 reprogramming with flash memory) capability. Microchip announced on February 2008 the shipment of its six billionth PIC processor.

EVOLUTION OF PIC The original PIC was built to be used with General Instruments' new 16-bit CPU, the CP1600. While generally a good CPU, the CP1600 had poor I/O performance, and the 8-bit PIC was developed in 1975 to improve performance of the overall system by offloading I/O tasks from the CPU. The PIC used simple microcode stored in ROM to perform its tasks, and although the term was not used at the time, it shares some common features with RISC designs. In 1985, General Instruments spun off their microelectronics division and the new ownership cancelled almost everything which by this time was mostly out-ofdate. The PIC, however, was upgraded with internal EPROM to produce a programmable channel controller and today a huge variety of PICs are available with various on-board peripherals (serial communication modules, UARTs, motor control kernels, etc.) and program memory from 256 words to 64k words and more (a "word" is one assembly language instruction, varying from 12, 14 or 16 bits depending on the specific PIC micro family). PIC and PICmicro are registered trademarks of Microchip Technology. It is generally thought that PIC stands for Peripheral Interface Controller, although General Instruments' original acronym for the initial PIC1640 and PIC1650 devices was "Programmable Interface Controller".
5

The acronym was quickly replaced with "Programmable Intelligent Computer".

Various older microcontrollers are

(EPROM)

PIC

The Microchip 16C84 (PIC16x84), introduced in 1993 , was the first Microchip CPU with on-chip EEPROM memory. This electrically erasable memory made it cost less than CPUs that required a quartz "erase window" for erasing EPROM. MULTIPLE ATTRIBUTES OF PIC:

Separate code and data spaces (Harvard architecture) for devices other than PIC32, which has a Von Neumann architecture. A small number of fixed length instructions Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in 8bit models), with one delay cycle on branches and skips One accumulator (W0), the use of which (as source operand) is implied (i.e. is not encoded in the opcode) All RAM locations function as registers as both source and/or destination of math and other functions.

A hardware stack for storing return addresses A fairly small amount of addressable data space (typically 256 bytes), extended through banking Data space mapped CPU, port, and peripheral registers The program counter is also mapped into the data space and writable (this is used to implement indirect jumps).

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.

There is no distinction between memory space and register space because the RAM serves the job of both memory and registers, and the RAM is usually just referred to as the register file or simply as the registers 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 word size 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 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
6

ARCHITECTURE OF PIC

processor. This also stores carry, zero and digit carry bits. STATUS - address 03H, 83H

STATUS register C = Carry bit DC = Digit carry (same as auxiliary carry) Z = Zero bit NOT_TO and NOT_PD - Used in conjunction with PIC's sleep mode The basic architecture of PIC is shown in above figure. The architecture consists of Program memory, file registers and RAM, ALU and CPU registers. It should be noted that the program Counter is 13 - bit and the program memory is organized as 14 - bit word. Hence the program Memory capacity is 8k x 14 bit. Each instruction of PIC is 14 - bit long. The various CPU registers are discussed here. CPU registers (registers commonly used by the CPU) W, the working register, is used by many instructions as the source of an operand. This is similar to accumulator in 8051. It may also serve as the destination for the result of the instruction execution. It is an 8 bit register. STATUS Register The STATUS register is a 8-bit register that stores the status of the
7

RP0- Register bank select bit used in conjunction with direct addressing mode. (File Selection Register, address = 04H, 84H) FSR 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 access is the location pointed to by FSR in indirect addressing mode. 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 5bits of the program counter. PCLATH is not the upper 5bits of the program counter. PCLATH can be read from or written to without affecting the program counter. The upper 3bits 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 program counter, as shown in the figure.

Register File Map

Schematic of how PCL is loaded from PCLATH Program Counter Stack An independent 8-level stack is used for the program counter. As the program counter is 13bit, the stack is organized as 8x13bit registers. When an interrupt occurs, the program counter is pushed onto the stack. When the interrupt is being serviced, 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. Register File Map It can be noted that some of the special purpose registers are available both in Bank0 and Bank-1. These registers have the same value in both banks. Changing the register content in one bank automatically changes its content in the other bank. 89C51 PIC PIN DIAGRAM:

according to your need. This device have 4K of ROM space to store the program, and 256Bytes of RAM space, this device have ability to interface with TTL based devices and also with the external MEMORY to increase its data space, but when your are using external MEMORY the 2 ports of 89c51 microcontroller are used for this purpose. Port Structure and Pin Configuration of PIC As mentioned earlier, there is a large variety of PIC microcontrollers. However, the midrange architectures are widely used. Our discussion will mainly confine to PIC16C74A whose architecture has most of the required features of a mid-range PIC microcontroller. Study of any other mid-range PIC microcontroller will not cause much variation from the basic architecture of PIC. PIC has 5 I/O Ports. Each port is a bidirectional I/O port. In addition, they have the following alternate functions.

8051 Microcontroller is a programmable device which is used for controlling purpose. Basically 8051 controller is Mask programmable means it will programmed at the time of manufacturing and will not programmed again, there is a derivative of 8051 microcontroller, 89c51 microcontroller which is reprogrammable up to 10000 times, here is small description about the 89c51 microcontroller. It have 4 ports which are used as input or output according to your need. These prots are also programmed as bit wise pattern, means you can use each bit of microcontroller saperatelly as input or output. This 89c51 is 8-bit device mean each port have 8-bits for I/O, total of 32-bits in the controller. This device also have Timer, Serial Port interface and Interrupt controlling you can use these
9

In addition to I/O pins, there is a Master clear pin (MCLR) which is equivalent to reset in 8051. However, unlike 8051, MCLR should be pulled low to reset the micro controller. Since PIC16C74Ahas inherent power-on reset, no special connection is

required with MCLR pin to reset the micro controller on power-on. There are two VDD pins and two VSS pins. There are two pins (OSC1 and OSC2) for connecting the crystal oscillator/ RC oscillator. Hence the total number of pins with a 16C74A is 33+7=40. This IC is commonly available in a dual-in-pin (DIP) package. CLOCK CONCEPT The clock concept is found in all modern digital electronics, it is a simple circuit that will generate pulses of electricity at a very specific frequency. Those pulses will cadence all the events happening inside a microcontroller, those pulses will also assure the synchronization of the events between various components inside the microcontroller. For example, if the CPU is waiting for some result of mathematical operation from the ALU (Arithmetic and Logic Unit), it will be known - according to very specific protocol - when and where the resulting data will be delivered to the CPU.The synchronization of those two devices is maintained because they share the same clock. The clock has another very important role which is to enable the microcontroller to count timing. without a precise clock, it would be impossible to build a 'Real Time System', or any other device that relies on time measurements. It can be deduced that the precision of the timing of a
10

microcontroller depends on the frequency of its clock. In the 89S52 microcontroller, the clock can be fixed to different value by connecting a crystal to the pins 18 and 19. Those crystals are sold with the frequency written on them in Mega Hertz. The maximum operating frequency of the AT89S52 is 33 Mhz, however other manufacturers like philips built similar 8051 microcontrollers that can run at frequencies up to 120 Mhz. ADVANTAGES The PIC have these advantages:

Small instruction set to learn RISC architecture Built in oscillator with selectable speeds Easy entry level, in circuit programming plus in circuit debugging PIC Kit units available from Microchip.com for less than $50 Inexpensive microcontrollers Wide range of interfaces including IC, SPI, USB, USART, A/D, programmable comparators, PWM, LIN, CAN, PSP, and Ethernet.

Você também pode gostar