Make an LED Blinky

Here’s how we built and programmed our microcontroller-based LED blinky circuit.

START »

1. SET UP YOUR DEVELOPMENT ENVIRONMENT. Install the IDE and the PICkit 1 software and hardware. Adjust the IDE settings to make sure it knows where to find the programmer and that it’s set up for our controller, the Microchip PIC 12F675.

Adjusting IDE settings.

2. ASSEMBLE THE CIRCUIT.

Before getting down to building PIC 12F675 Pinout and coding specifics, take a look at the 1 8 1. VDD

PIC 12F675’s pinouts, from its data- 2 7 2. GP5/T1CKI/OSC1/CLKIN sheet on the Microchip website. You 3 6 3. GP4/AN3/T1G/OSC2/CLKOUT can see here how our circuitry’s wiring 4 5 4. GP3/MCLR/VPP diagram follows the chip’s pinouts. 5. GP2/AN2/T0CKI/INT/COUT

6. GP1/AN1/CIN-/VREF/ICSPCLK

Our circuit includes the microcontroller, a power source, a timing crystal, support components for the microcontroller, and the output LED.

7. GP0/AN0/CIN+/ICSPDAT

8. VSS

Power comes from three AA cells that provide 4.5V, which is close enough to digital logic’s 5V “high” voltage. A 10K-ohm pull-up resistor maintains a F high voltage level to the chip’s master clear pin, Pin 4; sending low voltage (logical 0) to this pin would make the 4 5 PIC reset. A 4KHz oscillator supplies D G the source blink pulse, which is slowed down by two capacitors. Voltage to the LED comes from the microcontroller’s output Pin 7, connected to ground in series with a 220-ohm resistor.

A

18

B

C2 7

12F675

36 E

A. PIC 12F675 D. 10K resistor

Follow the wiring diagram at right. We B. Three AA cells E. 220 resistor soldered our circuit together using a C. 4KHz crystal F. 22pF capacitor small piece of perfboard. oscillator G. LED

»

References:

Archives