HAL PIC Example Project

This page provides an example of a PIC project.  The project is the firmware for the SpookyEyes Halloween device.  This device is described in HAL.INS.ASPIC

Be sure to read the legal notice before using any software found on this web site. 

This project follows the structure and conventions described on the main PIC development resources page.  All the source code is available for download and may be used for free in commercial applications with minor restrictions.  See the copyright notice at the start of each source module for details. 

The firmware runs on a PIC 16F876, which is probably hooked up pretty much as indicated by the schematic.  There were some changes made and various experimental versions, so this schematic may not correspond exactly to the picture. 

Below are the source files for this project:

hallib.ins.aspic

Include file to declare PIC environment. 

hal.ins.aspic

Project-specific include file. 

hal_strt.aspic

Startup code, run from reset.  Include module-level initialization. 

hal_init.aspic

System-level initialization. 

hal_main.aspic

Main operating code after initialization complete. 

hal_port.aspic

Low level I/O port handling. 

hal_intr.aspic

Interrupt handler. 

hal_ad.aspic

A/D handler. 

hal_eyes.aspic

Contains the logic for driving the LEDs to simulate the eyes. 

hal_rand.aspic

Random number generator. 

hal_soun.aspic

High level sound output management.  The low level sound output is performed in the interrupt routine. 

owl.aspic

Great horned owl sound.  This is the PIC assembler source code for one of the sounds.  This file was generated by the WAV_HAL program from a WAV file.  The HAL firmware contains other sounds which are not shown here. 

To get all the project files and build scripts, go to the PIC software downloads page and download the HAS PIC project. 


Last Updated 12 February 2004