Search Projects

Final year degree project for engineers DAC0800 based project circuit diagram and interfacing with pic mirocontroller Final year projects based on microcontrollers on programmable peripheral interface 8255
Microcontroller based different projects abstract and source code
PIC 16f877 microcontroller projects Motion control
PIC16f877 motor controller and other light projects
Tutorials of microcontroller PIC16f877, A step by step easy to use self learning rapidex

Saturday, July 2, 2011

Microcontroller Basic Elements Central Processing Unit Serial communication Input-output unit

1. Introduction Of Microcontroller


The use of microcontroller in industrial and control design has become very common over past the decade. Due to that reason, many appliances become smaller from previous design and easy to use. The sophistication of current technology has made microcontroller possible to store hundreds of thousands of transistors inside it. That was a prerequisite for production of microprocessors, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about.
A microcontroller is a computer control system on a single chip. It has many electronic circuits built into it, which can decode written instructions and convert them to electrical signals. The microcontroller will then step through these instructions and execute them one by one. As an example a microcontroller could be instructed to measure the temperature of a room and turn on a heater if it goes cold. Microcontrollers are now changing electronics design. Instead of hard wiring a number of logic gates together to perform some function and now use instructions to wire the gates electronically. The list of these instructions given to the microcontroller is called a program. Each microcontroller has a number of I/O pins. These pins can be configured to be either used for inputs or outputs. They are specially designed for external devices to be quickly and easily connected with the minimum of hardware. For instance, an LED may be connected directly to an output. Microcontrollers are designed to be part of applications that do not need human intervention, they are therefore reliable. Nowadays there are many microcontroller manufacturers in the market like AMCC (Applied Micro Circuit Corporation), Atmel, Cypress MicroSystems, Freescale Semiconductor, Fujitsu, Holtek, Intel, Microchip, National Semiconductor, NEC, Philips semiconductors, Renesas Tech. Corp, STM Microelectronics, Texas Instruments, Toshiba, Western Design Center, Ubicom, Xilinx, Zilog and Motorola.


2. Microcontroller Basic Elements

Microcontroller in design does not need to use more external component to do particular task. This is because microcontroller has several built-in basic elements that can replace the external component task.


2.1 Memory unit

Memory is part of the microcontroller that functions to store data. It is shown in the figure below. The easiest way to explain it is to describe it as one big closet with lots of drawers. The drawer has been marked to avoid confused and will be easily accessible. It is enough to know the designation of the drawer and its contents will be known.
For a certain input, the contents of a certain addressed memory location can be getting. Two new concepts are brought: addressing and memory location. Memory consists of all memory locations, and selecting one of the memory. Reading from a memory location, memory must also provide for writing onto it. This is done by supplying an additional line called control line. This line will designate as R/W (read/write). Control line is used in the following way: if r/w=1, reading is done, and if opposite is true then writing is done on the memory location. Memory is the first element, and need a few operations for the microcontroller.


2.2 Central Processing Unit

Three more memory locations are added to a specific block that will have a built in capability to multiply, divide, subtract, and move its contents from one memory location onto another as shown in the figure below. The parts that are added in are called "central processing unit" (CPU). Its memory locations are called registers.

Registers are therefore memory locations where the role is to help with performing various mathematical operations or any other operations with data wherever data can be found at the current situation. Two independent entities (memory and CPU) which are interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for example, the contents of two memory locations are added and the results are return back again to memory, and need a connection between memory and CPU. Simply stated, that must have some "way" through data goes from one block to another.


2.3 Bus



When working with it, the port acts like a memory location. Something is simply being written into or read from it, and it could be noticed on the pins of the microcontroller. The figure above shows the input/output unit of microcontroller.

2.5 Serial communication

Beside the above matter, the possibilities of communication with an outside world were added to the already existing unit. However, this way of communicating has its drawbacks. One of the basic drawbacks is the number of lines which need to be used in order to transfer data. What if it is being transferred to a distance of several kilometers? The number of lines times number of kilometers doesn't promise the economy of the project. The number of lines must be reduced in such a way that its functionality would not. Suppose if three lines were involved, and that one line is used for sending data, other for receiving, and the third one is used as a reference line for both the input and the output side. In order for this to work, the rules of exchange of data need to be set. These rules are called protocol. Protocol is therefore defined in advance so there wouldn't be any misunderstanding between the sides that are communicating with each other. The following protocol is considered. The logical unit "1" is set up on the transmitting line until transfer begins. Once the transfer starts, lower the transmission line to logical "0" for a period of time (which will designate as T), so the receiving side will know that it is receiving data, and so it will activate its mechanism for reception. Now go back to the transmission side and start putting logic zeros and ones onto the transmitter line in the order from a bit of the lowest value to a bit of the highest value. Let each bit stay on line for a time period which is equal to T, and in the end, or after the 8th bit, let us bring the logical unit "1" back on the line which will mark the end of the transmission of one data. The protocol above is called in professional literature NRZ (Non-Return to Zero).

It is possible to receive and send data at the same time separate lines for receiving and sending were used. So called full-duplex mode block which enables this way of communication is called a serial communication block. Unlike the parallel transmission, data moves here bit by bit, or in a series of bits what defines the term serial communication comes from. After the reception of data it must be read from the receiving location and stored in memory as opposed to sending where the process is reversed. Data goes from memory through the bus to the sending location, and then to the receiving unit according to the protocol. The figure above shows the serial unit of microcontroller.


2.6 Timer unit

After the serial communication was explained, the data can be received, sent and processed.


However, in order to utilize it in industry a few additionally blocks were needed. One of those is the timer block which is significant because it can give information about time, duration, protocol etc. The basic unit of the timer is a free-run counter as shown in the figure above which is in fact a register whose numeric value increments by one in even intervals, so that by taking its value during periods T1(start time) and T2 (end time) and on the basis of their difference the time elapsed can be determined. This is a very important part of the microcontroller which requires constant understanding.


2.7 Watchdog

One more thing that needs attention is a flawless functioning of the microcontroller during its run-time. Suppose that as a result of some interference (which often does occur in industry) the microcontroller will stop executing the program, or worse, it starts working incorrectly.

Of course, when this happens with a computer, simply it can be reset and it will keep working. However, there is no reset button on the microcontroller and thus solve the problem. To overcome this obstacle, one more block was introduced called watchdog as shown in the figure above. This block is in fact another free-run counter where the program needs to write a zero for every time it executes correctly. In case that program gets "stuck", zero will not be written in, and counter will reset the microcontroller upon achieving its maximum value alone. This will result in executing the program again, and correctly this time around. That is an important element of every program to be reliable without man's supervision.


2.8 Analog to Digital Converter

As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one), they have to be converted into a pattern which can be comprehended by a microcontroller. This task is performed by a block for analog to digital conversion or by an ADC as shown in the figure below. This block is responsible for converting an information about some analog value to a binary number and for follow it through to a CPU block so that CPU block can further process it.



Finally, the microcontroller is now completed and needs to be assembled into an electronic component where it will access inner blocks through the outside pins. The figure below shows what a microcontroller looks like inside.

Thin lines which lead from the center towards the sides of the microcontroller represent wires connecting inner blocks with the pins on the housing of the microcontroller so called bonding lines. Chart on the following picture represents the center section of a microcontroller.
PIC 16F877, 18F452 and 18F4550,PIC16F877, PIC18F452,PIC18F4550,16f876,16f84,microcontroller projects,lm35,lm34,lm335,temperature sensor,MikroC Projects


That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires there are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory to address and the other one is as wide as data, and in this case are 8 bits or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the microcontroller as shown in the figure below.




As far as functionality, the situation has improved, but a new problem has also appeared: there are units that's capable of working by itself, but which does not have any contact with the outside world. In order to remove this deficiency, a block are added which contains several memory locations whose one end is connected to the data bus, and the other has connection with the output lines on the microcontroller which can be seen as pins on the electronic component.


2.4 Input-output unit

Those locations added are called "ports". There are several types of ports: input, output or bidirectional ports. When working with ports, first of all it is necessary to choose which port that need to work with, and then to send data to, or take it from the port.


pic microcontroller usart rs232 bit timing diagram sd card controller ic arduino 24c16 dac0800 example ic bp24c16 epprrom lm 35 ecg microcontroller pic16f84 pic microcontroller based led display projects

0 comments:

Post a Comment

Hi: This is PICINF.blogspot.com comments section. Here you are requested to write your question or problems in detail. Write the question in such a way that, it have all necessary information, sothat i can understand and reply.If you want to send pictures and codes then e-mail me (rghkk@hotmail.com).Thanks.