Saturday 3 November 2012

WEEK 11 => 15 OCT - 21 OCT


In this week I wanted to continue with the testing for the hardware part but unfortunately for some reasons I couldn’t continue with it. So I didn’t want to waste my time without doing anything , so I have decided to make some research about the software part and alhamdulellah I managed to get some information about the software that I wanted to use and I will work in understanding it because my programming background is quite poor .

Microcontrollers

1. What are microcontrollers and what are they used for?
Like all good things, this powerful component is basically very simple. It is made by mixing tested and high- quality "ingredients" (components) as per following receipt:
1.     The simplest computer processor is used as the "brain" of the future system.
2.    Depending on the taste of the manufacturer, a bit of memory, a few A/D converters, timers, input/output lines etc. are added.
3.    All that is placed in some of the standard packages.
4.    A simple software able to control it all and which everyone can easily learn about has been developed.
On the basis of these rules, numerous types of microcontrollers were designed and they quickly became man's invisible companion. Their incredible simplicity and flexibility conquered us a long time ago and if you try to invent something about them, you should know that you are probably late, someone before you has either done it or at least has tried to do it.
The following things have had a crucial influence on development and success of the microcontrollers:
  • Powerful and carefully chosen electronics embedded in the microcontrollers can independently or via input/output devices (switches, push buttons, sensors, LCD displays, relays etc.), control various processes and devices such as industrial automation, electric current, temperature, engine performance etc.
  • Very low prices enable them to be embedded in such devices in which, until recent time it was not worthwhile to embed anything. Thanks to that, the world is overwhelmed today with cheap automatic devices and various “smart” appliences.
  • Prior knowledge is hardly needed for programming. It is sufficient to have a PC (software in use is not demanding at all and is easy to learn) and a simple device (called the programmer) used for “loading” raedy-to-use programs into the microcontroller.

How does the microcontroller operate?

Even though there are a large number of different types of microcontrollers and even more programs created for their use only, all of them have many things in common. Thus, if you learn to handle one of them you will be able to handle them all. A typical scenario on the basis of which it all functions is as follows:
1.     Power supply is turned off and everything is still…the program is loaded into the microcontroller, nothing indicates what is about to come…
2.    Power supply is turned on and everything starts to happen at high speed! The control logic unit keeps everything under control. It disables all other circuits except quartz crystal to operate. While the preparations are in progress, the first milliseconds go by.
3.    Power supply voltage reaches its maximum and oscillator frequency becomes stable. SFRs are being filled with bits reflecting the state of all circuits within the microcontroller. All pins are configured as inputs. The overall electronics starts operation in rhythm with pulse sequence. From now on the time is measured in micro and nanoseconds.
4.    Program Counter is set to zero. Instruction from that address is sent to instruction decoder which recognizes it, after which it is executed with immediate effect.
5.    The value of the Program Counter is incremented by 1 and the whole process is repeated...several million times per second.






2. What is what in the microcontroller?

As you can see, all the operations within the microcontroller are performed at high speed and quite simply, but the microcontroller itself would not be so useful if there are not special circuits which make it complete. In continuation, we are going to call your attention to them.

Read Only Memory (ROM)

Read Only Memory (ROM) is a type of memory used to permanently save the program being executed. The size of the program that can be written depends on the size of this memory. ROM can be built in the microcontroller or added as an external chip, which depends on the type of the microcontroller. Both options have some disadvantages. If ROM is added as an external chip, the microcontroller is cheaper and the program can be considerably longer. At the same time, a number of available pins are reduced as the microcontroller uses its own input/output ports for connection to the chip. The internal ROM is usually smaller and more expensive, but leaves more pins available for connecting to peripheral environment. The size of ROM ranges from 512B to 64KB.

Random Access Memory (RAM)

Random Access Memory (RAM) is a type of memory used for temporary storing data and intermediate results created and used during the operation of the microcontrollers. The content of this memory is cleared once the power supply is off. For example, if the program performs an addition, it is necessary to have a register standing for what in everyday life is called the “sum” . For that purpose, one of the registers in RAM is called the "sum" and used for storing results of addition. The size of RAM goes up to a few KBs.





 -->>Citation http://www.mikroe.com/chapters/view/64/chapter-1-introduction-to-microcontrollers/








PIC 16F877A




Microcontroller PIC16F877A is one of the PIC Micro Family microcontroller which is popular at this moment, start from beginner until all professionals. Because very easy using PIC16F877A and use FLASH memory technology so that can be write-erase until thousand times. The superiority this Risk Microcontroller compared to with other microcontroller 8-bit especially at a speed of and his code compression. PIC16F877A have 40 pin by 33 path of I/O.
PIC16F877A perfectly fits many uses, from automotive industries and controlling home appliances to industrial instruments, remote sensors, electrical door locks and safety devices. It is also ideal for smart cards as well as for battery supplied devices because of its low consumption. EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage of various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.). Low cost, low consumption, easy handling and flexibility make PIC16F877A applicable even in areas where microcontrollers had not previously been considered (example: timer functions, interface replacement in larger systems, coprocessor applications, etc.).In System Programmability of this chip (along with using only two pins in data transfer) makes possible the flexibility of a product, after assembling and testing have been completed. This capability can be used to create assembly-line production, to store calibration data available only after final testing, or it can be used to improve programs on finished products.

High-Performance RISC CPU:
  • Only 35 single-word instructions to learn
  • All single-cycle instructions except for program branches, which are two-cycle
  • Operating speed: DC – 20 MHz clock input DC – 200 ns instruction cycle
  • Up to 8K x 14 words of Flash Program Memory, Up to 368 x 8 bytes of Data Memory (RAM), Up to 256 x 8 bytes of EEPROM Data Memory
  • Pinout compatible to other 28-pin or 40/44-pin PIC16CXXX and PIC16FXXX microcontrollers
Peripheral Features:
  • Timer0: 8-bit timer/counter with 8-bit prescaler
  • Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external crystal/clock
  • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
  • Two Capture, Compare, PWM modules
  • Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)
  • Universal Synchronous Asynchronous Receiver
  • Transmitter (USART/SCI) with 9-bit address detection
  • Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin only)
  • Brown-out detection circuitry for Brown-out Reset (BOR)
Analog Features:
  • 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
  • Brown-out Reset (BOR)
  • Analog Comparator module (Two analog comparators , Programmable on-chip voltage reference (VREF) module , Programmable input multiplexing from device inputs and internal voltage reference , Comparator outputs are externally accessible)
Special Microcontroller Features:
  • 100,000 erase/write cycle Enhanced Flash program memory typical
  • 1,000,000 erase/write cycle Data EEPROM memory typical
  • Data EEPROM Retention > 40 years
  • Self-reprogrammable under software control
  • In-Circuit Serial Programming™ (ICSP™) via two pins
  • Single-supply 5V In-Circuit Serial Programming
  • Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
  • Programmable code protection
  • Power saving Sleep mode
  • Selectable oscillator options
  • In-Circuit Debug (ICD) via two pins
CMOS Technology:
  • Low-power, high-speed Flash/EEPROM technology
  • Fully static design
  • Wide operating voltage range (2.0V to 5.5V)
  • Commercial and Industrial temperature ranges
  • Low-power consumption





0 comments:

Post a Comment