Sample programs for microcontroller




















It can be easily initialized with a constant. For Example:. So the whole instruction means move an immediate value in WREG. In CPU, registers are used to store information temporarily. That information could be a byte of data processed or an address pointing to the data to be fetched. The vast majority of PIC registers are 8-bit registers.

Used when moving constant values. Used when moving variables. It is a number interpreted by your machine uC that represents the operation to perform. A label is an identifier used to represent a line in code or section of a program. Goto statements can be used in conjunction with a Label to jump to the execution of code identified by the particular label.

Like any language, Programming Languages have certain words, grammar and rules. There are three types or levels of Programming Languages for Microcontroller. These levels are based on how closely the statements in the language resemble the operations or tasks performed by the Microcontroller. In Machine language or Machine Code, the instructions are written in binary bit patterns i.

This is the lowest level of programming languages and is the language that a Microcontroller or Microprocessor actually understands. The next level of Programming Language is the Assembly Language.

Assembly Language is a pseudo-English representation of the Machine Language. The Microcontroller Assembly Language is a combination of English like words called Mnemonics and Hexadecimal codes.

It is also a low level language and requires extensive understanding of the architecture of the Microcontroller.

The name High-level language means that you need not worry about the architecture or other internal details of a microcontroller and they use words and statements that are easily understood by humans. Although High-level languages are easy to work with, the following reasons point out the advantage of Assembly Language.

Each line or statement of the assembly language program of Microcontroller consists of three fields: Label, Instruction and Comments. It is a electrical component that interconnect with two separate electric circuits, like that is used to transmit input signal by light sensitive.

It can be used input output isolation of controllers. It is a very easy to connect, port which you desire of PIC connect through resistor of pin no 1 of optocoupler and pin 2 ground. And output of its transistor connects as you require. In which data is created by electrical pulses and grid.

We can change and also erase a data according to requirement. The signal control by data or address bus. Difference between C language and Embedded C. C is a general purpose language, developed in by Denins R.

The C language is developed for creating system application that direct interacts to the computer hardware devices. The embedded C is a collection of one or more functions. Through embedded C a high level optimization can be done. It is used in microprocessor or microcontrollers applications. Types of Memory in Microcontrollers. In this topic we learn about the memory spaces and their use in microcontroller. Program Memory is a read only memory ROM. Program memory where we store the applications.

Some chips permit to part of the program memory to be modified in segments. In a microcontroller normally store the constants i. It further divided into four different categories;. Data memory is random access memory RAM. It consist a general purpose register. Low time required for performing operations. Question: Block Diagram stating the connections of the microprocessor to other components. Any integrated circuit can be damaged or destroyed by exposure to illegal voltages or Conditions.

A product can even be designed to tolerate common end-user errors by designing protective interface circuits. The two main goals of any protective interface are to prevent high currents from flowing and to prevent illegal voltage levels at a pin.

A low-pass filter can often satisfy both goals. In less common situations, it may also be necessary to provide diode clamps to prevent high voltages at some pins. Zap and latchup are terms familiar to failure analysis engineers that work on CMOS integrated circuits.

Zap refers to damage caused by very high-voltage static-electricity exposure. Static-electricity zap damage usually appears as a breakdown of the relatively thin oxide layers that causes leakage or shorts.

Often secondary damage occurs after an initial zap failure causes a short. Latchup refers to a usually catastrophic condition caused by turning on an unintentional, bipolar, silicon-controlled rectifier SCR.

A latchup SCR is formed by N and P regions in the layout of the integrated circuit, which act as the collector, base, and emitters of unintentional, parasitic transistors. Bulk resistance of silicon in the wells and substrate acts as resistors in the SCR circuit. Once this SCR is turned on, it can normally only be turned off by removing all power from the integrated circuit.

The on-impedance of the SCR can overheat and destroy the integrated circuit. Because of the destructive nature of these mechanisms, it is impossible to test every device for zap and latchup limits the way timing and drive levels are tested.

To assure product reliability, sample groups of devices are destructively tested…. Suggest 3 other applications for microcontrollers. For your suggestions, do you think that the 68HC11 is a good candidate to be the microcontroller? Answer: Atmel 1. Optical players 2. Digital camcorders 3.



0コメント

  • 1000 / 1000