Wednesday, 17 October 2012

PIC16F877A Microcontroller


PIC16F877A 



PIC16F778A is widely uses now and it is also famous among the beginner until all the professionals because of the FLASH Memory technology which can be write/erase within a tousand times of programming. Speed and code compression are the superiority of this risc microcontroller compared to other 8-bit microcontroller. PIC16F877A have 40 pin by 33 path of I/O. 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.




PIC16F877A Bubble Diagram



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

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)

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

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)

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


Output Circuit

 1. LCD

LCD pins diagram

The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters. Most LCDs with 1 controller has 14 pins. Pin description is shown in the table below:



Character LCD pins with 1 controller



Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever user sends on the DDRAM is actually displayed on the LCD. For LCDs like 1x16, only 16 characters are visible, so whatever user write after 16 chars is written in DDRAM but is not visible to the user.



LED circuit connection



Above is the connection diagram of LCD in 4-bit mode, only 7 pins needed to interface with an LCD. D4 - D7 are the data pins connection and Enable and Register select are for LCD control pins. The Read/Write (RW) pin of the LCD will not be using, as the data only writing on the LCD. So, it has to be grounded permanently. If user wants to use it, then they may connect it on controller but that will only increase another pin and does not make any big difference. The unwanted data pins of LCD i.e. Vss, VEE and D0-D3 are connected to ground.
There are many reasons why use LCD in 4-bit mode instead of 8-bit. One basic reason is lesser number of pins are needed to interface LCD.







2. LED

LED Output Circuit

When OUTPUT 2 receive logic condition from the microcontroller, R10 (330kohm) will limit the current to the D3 LED. The D3 LED will on.






3. Relay Switching

Relay Switching Circuit


For the above circuit, when the base of the transistor receive any supply from the microcontroller, it will allow the 5V to the ground without active the relay. Otherwise, the relay will active and create a back e.m.f that will turn the switching from the normally open to normally close (which is turn on the Backup RCCB).

Monday, 8 October 2012

Component

I was bought the component  that i need in my project. It not all the component but the main part of this project i was bought it.




























Circuit and PCB Design


I have finish to design the my schematic and PCB layout for my project Air quality monitoring system by using the EAGLE (Easily Applicable Graphical Layout Editor).



 I was try to run this schematic and it complete running and functioning (Alhamdulillah)


 schematic design





This is the PCB layout that i will print in on the board and all component will be solder on it (insyaAllah)



PCB layout








Meeting with supervisor

 August 9
I was attend first meeting with my supervisor  Tn Hj.Dr. Zainuddin bin Kornain for this semester. Show him my progress report and his give some advise and give me the idea in complate my project.

this sem i am stating to make the hardware, not just the proposal and report.............it getting hard....