First - A PIC16C84 test circuit and program

First - A PIC16C84 test circuit and program - My First PIC...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
My First PIC Project ==================== David Tait [email protected] The PIC16C84 (or PIC16F84) from Microchip is a really great little processor. Being based on EEPROM (or "flash") technology means that it can be programmed in a matter of seconds and typically it can be reprogrammed around 1000 times. Of its 18 pins 13 can be used as general purpose I/O. When programmed as outputs the I/O pins are able to source 20mA and sink 25mA (more than enough to drive LEDs directly for example). It is inexpensive and can be programmed with simple DIY hardware. Obviously these features make the '84 attractive for many projects but they also mean that it is an ideal processor for anyone wanting to learn about microcontrollers. This short document is meant for people who have just built or purchased a PIC programmer and are itching to get their '84 doing something if only to convince themselves that their programmer, PIC or both are working. To do this we obviously need to lash together some simple hardware and this means knowing a little about the PIC. Here's a pinout diagram (looking from above): +-----+ +-----+ RA2 |1 +-+ 18| RA1 RA3 |2 17| RA0 RA4/T0CKI |3 16| OSC1/CLKIN /MCLR |4 16C84 15| OSC2/CLKOUT VSS |5 14| VDD RB0/INT |6 16F84 13| RB7 RB1 |7 12| RB6 RB2 |8 11| RB5 RB3 |9 10| RB4 +-------------+ The RA* and RB* pins are I/O pins associated with the PIC registers PORTA and PORTB respectively (RA4 can also be used as an input to the internal timer and RB0 can be used as an interrupt). VDD and VSS are the power pins. The '84 works over a wide range of voltages but typically VSS is connected to 0V and VDD to +5V. The main reset pin, /MCLR, can simply be tied to VDD (either directly or through a resistor) because the PIC includes a reliable power-on reset circuit - all you need to do to reset the PIC is cycle its power. The processor needs a clock and the OSC1 and OSC2 pins can be configured for a variety of different options including crystal and low cost RC oscillator modes. A simple circuit that you can use as the basis of your first PIC16C84 project is shown here: / +-O O---+---------------+--------------------+ | | | | | | +----O----+ | | + | | 14 | PIC16C84 | ------- | ____ | | ____ | --- +--[____]--O 4 16 O----+--[____]--+ ------- 1K | | | 4.7K | 4.5V --- ____ | | | | battery ------- +--[____]--O 10 | _|_ _|_ --- _|_ 470 | 5 | ___ 22pF ___ 0.1uF
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
| - \ /^ +----O----+ | | | --- LED | | | | | | | | +-------+---------------+---------+----------+ (Grab for a more readable version). The circuit uses an RC oscillator and one I/O pin (RB4) attached to a LED. This is all you need to get the PIC to do something and see it happening. Charles Manning (Electronics Australia, April 1996) wrote an amazingly short (6 word) LED flasher program that you can use with this circuit: LIST P=16C84 MOVLW 0 TRIS 6 OPTION LOOP SLEEP INCF 6,F GOTO LOOP END The program is written for MPASM (Microchip's free assembler available from
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/18/2012 for the course ECE 101 taught by Professor Binsaprat during the Spring '12 term at Albany State University.

Page1 / 7

First - A PIC16C84 test circuit and program - My First PIC...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online