Pages

Sunday, June 26, 2011

Basic PIC16F877A circuit

Source : http://www.e-shore.com.my/
To operate a microcontroller, you need some basic components to support it and the circuit we call it basic circuit. The components needed are very common and you can find them at any electronics store out there. Below, i will share the schematic of basic circuit to operate a PIC16F877A microcontroller.
basic_circuit
What are those components for?
  • IN4148 - is a Shockley diode to allow the microcontroller to be programmed by ICSP method
  • SW - is a 2 pins push button to allow manually reset the microcontroller
  • R1k - is a 1K 1/4 W resistor to pull high or enable  the MCLR pin
  • XTAL - is a crystal oscillator to generate clock to the microcontroller
  • C - supporting parts for the crystal
  • VCC - 5V supply
  • GND - 0V
How can you get 5V supply if you have a battery which is 12V? Below is the voltage regulating circuit to regulate a voltage from 7V-20V to a stable 5V.
power_supply
What are those components for?
  • JP - is a 2 pins connector to connect to battery. pin1 is positive and pin2 is negative.
  • S - is a slide switch to on/off the power
  • IN4007 - is a Diode to prevent wrong polarity
  • LM7805 - is a 5V voltage regulator
  • C - are capacitors to stabilize the voltage supply
  • D8 - is a 5V LED as power on/off indicator
  • R1K - is a 1K 1/4W resistor to limit the current through the LED
Now, the basic circuit is complete but you can't see any result yet because there are no input and output to show the result. Next, i will show you a simple input circuit.
digital_input
Push button input is a very simple and direct input. As in the circuit above, S1 (Push Button) is being pulled up by R1 (10KOhm Resistor) to Vcc. So, when the S1 is being released, the voltage will be Vcc (since it is being pulled up to Vcc), and when S1 is being pressed, the voltage will be 0V. This type of input is called active low input, where the output voltage is 0V or Logic 0 when it is active (button pressed). The function of the R2 is to protect the Digital Input Port at microcontroller, just in case the Digital Input Port is being configured as an output, and the R2 will limit the current from the Port.
What are those components for?
  • R1 - is a 10K 1/4W resistor to pull high the input pin
  • Digital Input Port - Any digital input pin from the microcontroller
  • S1 - is a 2 pins push button for giving input
  • C1 - is a capacitor to filter the noise from the push button
  • R2 - protect the Digital Input Port
Lastly, i will show you a simple output circuit.
output
The output is a LED. What are those components for?
  • port - any of the digital output from the microcontroller
  • 330R - is a 330 ohm 1/4 W resistor to limit the current through the LED
  • Ds - is a 5V LED as output indicator
With this basic circuit, you can further develop any application you want. Have a good try!

No comments:

Post a Comment