Hardware

Navigation

Sections

Design - Control and Display

Controller

The PIC16F716 was used for this project because I happen to have a few lying around and taking up space in my components drawer. The on-board ADC, small size, and respectable amount of IOs makes this controller a good candidate for a project such as this.

PIC16F716 from Microchip's Datasheet

Firmware

The firmware for this project was made by using a variant of C that is compiled by SourceBoost's C Compiler. As depicted by the flow chart below, the micro-controller continuously samples the ADC, processes the acquired information, and changes its outputs accordingly.

The "mode" changing function has been included in the program by testing if the pin designated RB0, on the micro-controller, has changed states. If such an event happens, the program will change the internal counter that designates how the micro-controller should display the audio level to the user. Dimming is accomplished by the on-board ADC converting the photo resistor formed voltage divider's output into its 8-bit representation. This 8-bit representation is then categorized into a specific level of delay and later applied to the micro-controller, in the form of NOPs, to slow down the strobing speed of the display.

Software Flow

Display

The easiest method of displaying information about the amplitude was to utilize LEDs that are lined up in progressive increasing level fashion. The number of LEDs to be used was determined by randomly playing around with differing configurations until a satisfying outcome was produced; in this case, a semi-circular configuration was chosen. Since the micro-controller possesses limited IOs for driving each individual LED, I chose to expand them by using a decoder of some sorts. Being used to working with the 74 series logic chips for so long, the immediate decoder that came to my mind was the 74HC238 chip.

The 74HC238 chip is a 3x8 decoder that accepts a 3-bit input address for configuring, when enabled, which of its 8 outputs becomes high. There are a total of 3 enable line inputs of which two are active low and the last is active high for which can be use as data input from the micro-controller.

74HC238 from STMicroelectronics' Datasheet

Note that although the 3x8 Decoder is sourcing the current to the LEDs, it is doing so to only one LED at a given moment in time because the outputs are mutually exclusive. The apparent simultaneous LED activation is done by the rapidly strobing outputs of the decoder by the micro-controller.

Tutorial Navigation

[Legal Disclaimer and Copyright Section] [Return to Top]

Valid XHTML 1.0 Transitional Valid CSS