3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Frankenbear Synthamajig

Step 10Program the microcontroller.

Program the microcontroller.
It is time to program the PIC chip. I used the Basic Micro development board and the MBasic programming environment--both of which can be found at the Basic Micro website.

The code I used can probably be converted to a more universal programming language and modified to fit your needs. Essentially, one potentiometer controls the frequency of the note and the other controls the duration of the note.

For this task the PIC chip is like using a machine to kill a mosquito. You probably can get the same effect with a 555 chip or two, but I had the PIC chip on hand at the time and felt like using it.

It is as follows:

CPU = 16F877
MHZ = 20
CONFIG 16254

screeching var word
longing var word
' sets variables

main:

HIGH B1
RCTIME B1,1,screeching
' note frequency potentiometer reading

HIGH B2,1,longing
RCTIME B2,1,longing
' note duration potentiometer reading

screeching = screeching * 2
' increases the notes frequency range

longing = longing / 12
' decreases notes duration to about 4 second maximum

if longing < 1 then
longing = 1
endif
' prevents 1 or 0 from being divided by 12 and crashing the program

FREQOUT B0,longing,screeching
' sound output on pin B0

goto main
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2350
Followers
200
Author:randofo(Randy Sarafan loves you!)
I am the Technology Editor here at Instructables. I am also the author of the books 'Simple Bots,' and '62 Projects to Make with a Dead Computer'. Subscribing to me = fun and excitement!