PicBasic Experiments With The PIC16F877
This page is for reference while working through the PIC16F877 experiments.
Figure 1 shows the connections for using an LCD with the PIC16F877 experiments. Use this diagram to connect your LCD to the PIC16F877. The display is useful while following along with these experiments. The LCD helps in the debugging process if something doesn't work quite right the first time, and is used to display the results when everything goes according to plan.
Note: Be sure to use a 4 MHz oscillator since the sample code has been written assuming you're using a 4 MHz ceramic oscillator or 4 MHz crystal. Using up to 20 MHz oscillators is easy to do with PicBasic and the PIC16F877, but you must include the DEFINE OSC 20 command to inform PicBasic that your timing requirements are different than the default 4 MHz mode.
Figure 2 is the pin diagram for the
PIC16F877 microcontroller. Figure 3 shows how to connect either a ceramic
resonator, or a quartz crystal for the experiments.
LCD Pin Descriptions:
Pin # 1 = Vss (LCD GND)
The LCD is used in 4-Bit Mode for these experiments (unless otherwise specified), so the data-inputs DB0-DB3 are not used.
Figure 3 shows how to connect both oscillator options. Using a ceramic resonator is normally less expensive, and requires fewer components since the ceramic resonator has internal capacitors to complete the oscillator circuit. Note: If you order ceramic resonators, make sure you get them with internal capacitors. There are versions that don't include them. The Digi-Key part number for 4MHz ceramic resonators (with internal capacitors) is: X902. They cost approximately 68 cents each in single quantities.
If you're new to using ceramic resonators, the center-pin of the resonator is ground. There has been some discussion as to whether or not resonators are adequate for applications requiring high-speed serial communications, but I'll leave that one up to you to find out.
For further study, I highly recommend you take a peek at the Fox Electronics web site at: http://www.foxonline.com/ They have some outstanding articles explaining oscillator theory, and even some info on ceramic resonators vs. crystals. If you're an engineer, and concerned about whether or not to use resonators in your next design, the time you spend at the Fox web site will be well worthwhile.
We use ceramic resonators in 99.9% of all our PIC based designs, and have yet to experience any problems. That, however, is an entirely different discussion, and we're not here for that purpose. It's best that you investigate this on your own. For these particular experiments, either oscillator option will work just fine....;o]
If you don't have PicBasic yet, we have that here as well. Click HERE for details on how to get your own copy of PicBasic, or PicBasic Pro. We have complete programming packages available at very reasonable prices.
NOTE: Use your browsers BACK BUTTON to return to the experiments page you were on before, or click HERE to return to the PicBasic Projects Page.
© 1999-2002 Reynolds Electronics