Microchip PIC chip applications have traditionally been programmed using the MPLAB or MPLABX Integrated Development Environment (IDE) development tools. These coding tools allow hardware engineers to build embedded devices concepts quite effectively. Electrical engineers, especially, have grown accustomed to building their embedded software using variations of the ANSI C programming language known as Embedded C.
The Embedded C language variations is based on the microcontroller manufacturer's architecture and specifications of the device's GPIO (General Purpose Input/Output) ports, timers, counters, and SFRs (Special Functions Registers).
But I recently discovered an alternative coding language that is easy to learn and can program PIC chips as effectively as Embedded C.
What is Great Cow Basic?
For those Design News readers who are familiar with Beginner's All-purpose Symbolic Instruction Code (BASIC), PIC chips can now be programmed using this coding language. Great Cow Basic (GCB) allows Microchip PIC chips to be programmed easily using this alternative programming language. The learning curve for GCB is quite small, therefore allowing you to build your embedded device software within several minutes. To illustrate the ease in which to build an embedded device, I'll present my PIC chip-SNAP Circuit LED Flasher as the example:
The PIC chip-SNAP Circuit LED Flasher
Flashing LEDs is the physical equivalent of the "Hello World" program used in most college, university, and semiconductor manufacturer introductions to programming microcontrollers. Therefore, keeping tradition alive, I'm following the same path. The PIC chip SNAP Circuit LED Flasher requires a few basic components: an LED; a series current limiting resistor; a 3V power supply; an ON/OFF slide or toggle switch; and a microcontroller. The circuit schematic diagram for the PIC chip SNAP Circuit LED Flasher is shown next.
I selected the PIC chip 10F206 microcontroller because the SNAP Circuit kit provides an 8-pin IC socket for adding a LM386 op-amp or 555 Timer components to build your own electronic gadgets and devices. With the PIC chip 10F206 microcontroller, I can build a variety of smart devices by adding GCB embedded software to the programmable IC. The pin out for the PIC chip 10F206 microcontroller is provided below:
Building the LED Flasher
To build and test the simple LED Flasher, I used the Microchip PICDEM lab development board. This board provides a wealth of onboard resources such as a PICKIT Serial Analyzer, piezo speaker, a potentiometer, a dc brushed motor, and solderless breadboard. In addition to the PIC10F206 device the PICDEM includes the PIC 16F88, and 16F690 microcontrollers.
There are several dual and single inline female header connectors for wiring external circuits to the supporting microcontroller pins. Each microcontroller has an ICSP programming header for attaching a PICKIT programmer. The GCB IDE requires a PICKIT2 or PICKIT3 to program the target microcontrollers. Using the circuit schematic diagram previously shown, I built the LED flasher circuit on the PICDEM lab development board.
Building the GCB LED Flasher code
With the LED wired to GP0 (pin 5)