DesignSpark Electrical Logolinkedin
Menu Search
Ask a Question

How to design basic circuit of PIC16F877


I want to create a home automation project with PIC16F877. I am following PIC16F877 Pinout here but I don't know how to create its basic circuit. If someone can help me out in right direction. Provide me the its basic circuit with crystal oscillator.


0 Votes


November 9, 2018 09:52

The PIC16F877 is not recommended for new designs.
The PIC16F188777 is a newer superset that is faster (32MHz vs 20MHz), has much more data memory (4096 vs 368 bytes), four times the program memory (32Kx14 vs 8Kx14), and quite a few more peripherals. All at a lower cost.

Take a look at the Oscillator section (pages 109 -127) of the PIC16F188777 data sheet for info on the oscillator options available and suggested circuitry. There are two external oscillators available, one flexible high speed and a secondary one for low power at 32 kHz. The circuit components for the main external oscillator depend on whether you are using a crystal or a resonator, etc. The datasheet explains it. Microchip also has some app notes on choosing crystals for use with the PICs. The data sheet and ap notes are available on the web site.

For home automation, you probably want at least one clock source with high accuracy for keeping time of day. The 32 kHz crystals are usually used for that (on the secondary oscillator). It can keep that oscillator going at less than 1 uAmp in standy/powerdown modes. There are also multiple internal clock sources, generally 1% accuracy, for generating the processor clock and general timing.

Other than the clock circuitry, the main things to remember for a basic circuit for the chip are the power pins and the reset / programming pins.

There are multiple power pins, and they should all be connected. Likewise for ground.
Remember bypass caps from power to ground, close to the chip. (Easy to do since the pins are adjacent.)

Pages 100-108 discuss reset considerations.

Pages 576-577 tell you what to do so you can program the chip in-circuit with a Pickit or ICE programmer.

There are app notes with more about the in-circuit serial programming (ICSP) as well.