Feb 9, 2010

8085 Instruction Set


I am going to go through an in-depth explaination of ALL the 8085 instructions.

Instructions can be categorized according to their method of addressing the hardware registers and/or memory.

Data Transfer Croup:

The data transfer instructions move data between registers or between memory and registers.



MOV Move

MVI Move Immediate

LDA Load Accumulator Directly from Memory

STA Store Accumulator Directly in Memory

LHLD Load H & L Registers Directly from Memory

SHLD Store H & L Registers Directly in Memory



An 'X' in the name of a data transfer instruction implies that it deals with a register pair (16-bits);



LXI Load Register Pair with Immediate data

LDAX Load Accumulator from Address in Register Pair

STAX Store Accumulator in Address in Register Pair

XCHG Exchange H & L with D & E

XTHL Exchange Top of Stack with H & L



Arithmetic Group:

The arithmetic instructions add, subtract, increment, or decrement data in registers or memory.



ADD Add to Accumulator

ADI Add Immediate Data to Accumulator

ADC Add to Accumulator Using Carry Flag

ACI Add Immediate data to Accumulator Using Carry

SUB Subtract from Accumulator

SUI Subtract Immediate Data from Accumulator

SBB Subtract from Accumulator Using Borrow (Carry) Flag

SBI Subtract Immediate from Accumulator Using Borrow (Carry) Flag

INR Increment Specified Byte by One

DCR Decrement Specified Byte by One

INX Increment Register Pair by One

DCX Decrement Register Pair by One

DAD Double Register Add; Add Content of Register

Pair to H & L Register Pair



Logical Group:

This group performs logical (Boolean) operations on data in registers and memory and on condition flags.



The logical AND, OR, and Exclusive OR instructions enable you to set specific bits in the accumulator ON or OFF.



ANA Logical AND with Accumulator

ANI Logical AND with Accumulator Using Immediate Data

ORA Logical OR with Accumulator

OR Logical OR with Accumulator Using Immediate Data

XRA Exclusive Logical OR with Accumulator

XRI Exclusive OR Using Immediate Data



The Compare instructions compare the content of an 8-bit value with the contents of the accumulator;



CMP Compare

CPI Compare Using Immediate Data



The rotate instructions shift the contents of the accumulator one bit position to the left or right:



RLC Rotate Accumulator Left

RRC Rotate Accumulator Right

RAL Rotate Left Through Carry

RAR Rotate Right Through Carry



Complement and carry flag instructions:



CMA Complement Accumulator

CMC Complement Carry Flag

STC Set Carry Flag



Branch Group:

The branching instructions alter normal sequential program flow, either unconditionally or conditionally. The unconditional branching instructions are as follows:



JMP Jump

CALL Call

RET Return



Conditional branching instructions examine the status of one of four condition flags to determine whether the specified branch is to be executed. The conditions that may be specified are as follows:



NZ Not Zero (Z = 0)

Z Zero (Z = 1)

NC No Carry (C = 0)

C Carry (C = 1)

PO Parity Odd (P = 0)

PE Parity Even (P = 1)

P Plus (S = 0)

M Minus (S = 1)



Thus, the conditional branching instructions are specified as follows:



Jumps Calls Returns

C CC RC (Carry)

INC CNC RNC (No Carry)

JZ CZ RZ (Zero)

JNZ CNZ RNZ (Not Zero)

JP CP RP (Plus)

JM CM RM (Minus)

JPE CPE RPE (Parity Even)

JP0 CPO RPO (Parity Odd)



Two other instructions can affect a branch by replacing the contents or the program counter:



PCHL Move H & L to Program Counter

RST Special Restart Instruction Used

with Interrupts



Stack I/O, and Machine Control Instructions:

The following instructions affect the Stack and/or Stack Pointer:



PUSH Push Two bytes of Data onto the Stack

POP Pop Two Bytes of Data off the Stack

XTHL Exchange Top of Stack with H & L

SPHL Move content of H & L to Stack Pointer



The I/0 instructions are as follows:



IN Initiate Input Operation

OUT Initiate Output Operation



The Machine Control instructions are as follows:

EI Enable Interrupt System

DI Disable Interrupt System

HLT Halt

NOP No Operation

Feb 8, 2010

Basic Components


















Some basic components in uP & uC

1. An electronic circuit board can contain millions of transistors and many other tiny electronic parts. But what are these parts and what do they do? Take a close look at what goes inside electronics and learn the function of each component.

2. Transistors
Transistors come in several different types and amplify electric current. They can also turn electricity on or off. The electronic component on the next page has the opposite function.

3. Resistors
Resistors control the flow of electrical current, and are commonly used to control volume in electronic devices like TVs. If you aren't careful, the power in the next component might kill you if you handle it improperly.

4. Electrolytic Capacitors
Capacitors are like batteries, but they dump their entire charge in a tiny fraction of a second, where a battery would take minutes. They are commonly used for anything that requires a flash, such as a camera. They can also be used to even out voltage or block DC current. See other types of capacitors next.

5. Other Capacitors
While the electrolytic capacitor on the previous page is the most popular, other common capacitor types include ceramic, plastic film types and tantalum. They are often less expensive than electrolytic capacitors and better for electronics that don't require intensity. Protect your circuit with the next part.

6. Diodes
Diodes allow electricity to flow in one direction and are usually used as a form of protection. Above, the diodes are red with resistors on the left. Take a look at a LED next.

7. Light-emitting Diode (LED)
Basically, LEDs are just tiny light bulbs that fit easily into an electrical circuit. Some uses of LEDs include forming the numbers on digital clocks, transmiting information from remote controls, lighting up watches and telling you when your appliances are turned on. Collected together, they can illuminate a traffic light. Learn what inductors do next.

8. Inductors
An inductor is about as simple as an electronic component can get -- it is simply a coil of wire. It is used in traffic light sensors and if you team up an inductor with a capacitor you create an oscillator. Learn everyday things that use oscillators next.

9. Oscillator
Oscillators move energy back and forth between two forms. A quartz watch uses a quartz oscillator to keep track of what time it is. An AM radio transmitter uses an oscillator to create the carrier wave for the station and there are also oscillators in computers, metal detectors and stun guns. Next, see the component that made computing possible.

10. Semiconductor Chip/Integrated Circuit
An integrated circuit, also called a chip, may contain millions of transistors and other components surrounded by a plastic or ceramic case. It connects to a circuit board via the metal pins seen above. Chips are often used in cars, computers, calculators and more. Next, learn about microcontrollers.

11. Microcontrollers
Most modern electronic devices -- TVs, VCRs, microwaves and so on -- contain an embedded microcontroller It's basically a dedicated computer. Next, see a microprocessor, which is a key component in computers.

12. Microprocessors
A microprocessor -- also known as a CPU or central processing unit -- is a complete computation engine that is fabricated on a single chip. Pictured above is the back side of the Core i7 chip with Nehalem microarchitecture. You can also fire up your electronics engine with the next component.

13. Brushless Electric Motor
In a brushless DC motor (BLDC), you put the permanent magnets on the rotor and you move the electromagnets to the stator. Then you use a computer (connected to high-power transistors) to charge up the electromagnets as the shaft turns. You'll likely need the next part to even get your motor started.

14. Relays
A relay is a simple electromechanical switch made up of an electromagnet and a set of contacts. Relays are quite common in home appliances where there is an electronic control turning on something like a motor or a light. See what device is used to get electricity to your gadgets next.

15. Chip on top with a transistor and LED below. Pictured above is another LED surrounded by resistors and diodes.

16. Power-cube Transformer
The purpose of a transformer is to convert one AC voltage to another AC voltage. A typical home probably has five to 10 of these little transformers plugged into the wall at any given time, and they are used with printers, speakers, cell phone chargers, electric drills and more.

8085 Architecture



The 8085 is a conventional von Neumann design based on the Intel 8080. Unlike the 8080 it had no state signals multiplexed onto the data bus, but the 8-bit data bus was instead multiplexed with the lower part of the 16-bit address bus (in order to limit the number of pins to 40). The processor was designed using nMOS circuitry and the later "H" versions were implemented in Intel's enhanced nMOS process called HMOS, originally developed for fast static RAM products. The 8085 used approximately 6,500 transistors

INTEL 8085



INTEL 8085

The Intel 8085 is an 8-bit microprocessor introduced by Intel in 1977. It was binary-compatible with the more-famous Intel 8080 but required less supporting hardware, thus allowing simpler and less expensive microcomputer systems to be built.

The "5" in the model number came from the fact that the 8085 required only a +5-volt (V) power supply rather than the +5V, -5V and +12V supplies the 8080 needed. Both processors were sometimes used in computers running the CP/M operating system, and the 8085 later saw use as a microcontroller (much by virtue of its component count reducing feature). Both designs were eclipsed for desktop computers by the compatible but more capable Zilog Z80, which took over most of the CP/M computer market as well as taking a large share of the booming home computer market in the early-to-mid-1980s.

The 8085 had a very long life as a controller. Once designed into such products as the DECtape controller and the VT100 video terminal in the late 1970s, it continued to serve for new production throughout the life span of those products (generally many times longer than the new manufacture lifespan of desktop computers).

Why Microcontroller?




Microcontrollers are hidden inside a surprising number of products these days. If your microwave oven has an LED or LCD screen and a keypad, it contains a microcontroller. All modern automobiles contain at least one microcontroller, and can have as many as six or seven: The engine is controlled by a microcontroller, as are the anti-lock brakes, the cruise control and so on. Any device that has a remote control almost certainly contains a microcontroller: TVs, VCRs and high-end stereo systems all fall into this category. Nice SLR and digital cameras, cell phones, camcorders, answering machines, laser printers, telephones (the ones with caller ID, 20-number memory, etc.), pagers, and feature-laden refrigerators, dishwashers, washers and dryers (the ones with displays and keypads)... You get the idea. Basically, any product or device that interacts with its user has a microcontroller buried inside.

In this article, i just want to share the general information on microcontroller (uC) so that you can understand what they are and how they work.

More on microcontroller


Why microcontroller is needed?

A microprocessor can't work as a stand alone unit so to make it work we have to interface memory and input out devices and so the PCB of microprocessor based system will be larger. Microcontroller consists of:
1. Processor,
2. Memory and peripherals on a single chip and so needs no interfacing.
Microcontroller can be programmed for any specific task.

More on microcontroller

Why microcontroller is needed?

A microprocessor cant work as a stand alone unit so to make it work we have to interface memory and input out devices and so the PCB of microprocessor based system will be larger. Otherwise Microcontroller consists of processor, memory and peripherals on a single chip and so needs no interfacing.The other things, Microcontroller can be programmed for any specific task and can operated by battery.

Feb 7, 2010

Introduction


What is microprocessor?

A device that integrates the functions of the central processing unit (CPU) of a computer onto one semiconductor chip or integrated circuit (IC). In essence, the microprocessor contains the core elements of a computer system, its computation and control engine. Only a power supply, memory, peripheral interface ICs, and peripherals (typically input/output and storage devices) need be added to build a complete computer system. See also Computer peripheral devices.

A microprocessor consists of multiple internal function units. A basic design has an arithmetic logic unit (ALU), a control unit, a memory interface, an interrupt or exception controller, and an internal cache. More sophisticated microprocessors might also contain extra units that assist in floating-point match calculations, program branching, or vector processing (see illustration).


A microprocessor consists of multiple independent function units. The memory interface fetches instructions from, and writes data to, external memory. The control unit issues one or more instructions to other function units. These units process the instructions in parallel to boost performance.

The ALU performs all basic computational operations: arithmetic, logical, and comparisons.

The control unit orchestrates the operation of the other units. It fetches instructions from the on-chip cache, decodes them, and then executes them. Each instruction has the control unit direct the other function units through a sequence of steps that carry out the instruction's intent. The execution path taken by the control unit can depend upon status bits produced by the arithmetic logic unit or the floating-point unit (FPU) after the instruction sequence completes. This capability implements conditional execution control flow, which is a critical element for general-purpose computation. See also Bit.

The memory interface enables the microprocessor to maintain two-way communication with off-chip semiconductor memory, which stores programs and data. This interface typically supports memory reads and writes in blocks of words (the number of bits that the processor operates on at one time). The block size facilitates burst data transfers to and from the chip's internal cache. See also Semiconductor memories.

The interrupt or exception controller enables the microprocessor to respond to requests from the external environment or to error conditions by allowing interruptions of the ongoing operation. An interrupt might be an external peripheral requesting service, while an exception typically consists of a floating-point math error or an unrecognized instruction. The interrupt controller can prioritize and selectively handle these interrupts.

The internal cache is an on-chip memory storage area that holds recently used data values or instruction sequences that are likely to be used again in the near future. Since this information is already on-chip, it can be accessed rapidly, thereby accelerating the computation rate. Items not in the cache can take several or more extra operations to access, which significantly degrades the computation rate. Software writers often organize a program's code and data structures so that the most frequently used elements often occupy the cache, thus maintaining a high level of computational throughput. See also Computer storage technology; Computer systems architecture.

The design of instruction sets (the commands that produce basic work when executed by the microprocessor) often influences the design of the microprocessor itself. Instruction sets—and as a consequence, the microprocessor architecture—are of two types: reduced instruction set computers (RISC) and complex instruction set computers (CISC). Because of the limits of early computer technology, most computers were by necessity RISC machines. Since most of the software was written in assembly language (that is, a programming language that represented the program's intent in actual machine instructions), there was a drive to build instruction sets of greater sophistication and complexity. These new CISC instruction sets made assembly language programming easier, but they also made it difficult to build high-speed computer hardware. First, CISC instructions were harder to decode. In addition, since CISC instructions involved long and complex operation sequences, they incurred a major cost by requiring more complicated logic to implement. Second, such instructions were also difficult to interrupt or abort if an exception occurred. Finally, such instructions usually carried many data dependencies that made it more difficult to support advanced architectural techniques. By returning to a RISC design, much faster computers can be built. In fact, an enhancement in performance by a factor of 2 to 3 has been attributed to this simple organizational change. To achieve these efficiencies, most of the RISC microprocessor's function units must be kept as busy as possible. This requires optimizing compilers that can translate a program's high-level source code and then reorder the resulting low-level instructions in such a way as to ensure the high throughput. See also Computer programming; Programming languages.

Microprocessors are found in virtually every consumer product that requires electric power, such as microwave ovens, automobiles, video recorders, cellular telephones, digital cameras, and hand-held computers. High-performance microprocessors implement the servers that store and distribute Web content, such as streaming audio and video, desktop computers, and the high-speed network switches that constitute the Web's infrastructure. More modest-powered microprocessors are at the heart of notebook computers and electronic games. Low-power microprocessors provide the control and flow logic of hand-held devices, digital cameras, cellular and cordless phones, pagers, and the diagnostic and pollution control of automobile engines.

What is microcontroller?

A single chip that contains the processor (the CPU), non-volatile memory for the program (ROM or flash), volatile memory for input and output (RAM), a clock and an I/O control unit. Also called a "computer on a chip," billions of microcontroller units (MCUs) are embedded each year in a myriad of products from toys to appliances to automobiles. For example, a single vehicle can use 70 or more microcontrollers.

Microcontrollers come in all sizes and architectures, with the smaller, commodity chips costing as little as 50 cents in quantities of 10,000.