Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Electronic Keyboard

Status
Not open for further replies.

warrenob1000

New Member
I have three PIC chips lying around and would like to get started programming them:

I'm looking to make an electronic organ with several keys (16-32). It could output to either a piezo or 8-ohm speaker.

I've got a 16FL84A-04, a 16F54, and a 16F716. The only microcontrollers I can buy around here are 16F84s and 16F628s. Ideally I'd like to use mikroBASIC, since I don't know assembler and would like to get started on this right away (this seems like a pretty easy task, anyway).

It seems like this is an easy task that can be easily done with a few 'sound' commands in PICbasic.

I have a few questions:

1) Which PIC would be best?

2) How do I build a good parallel-port programmer that will upload my program to the PIC (I'm using a windows XP PC, too)?

3) Is wiring the circuit as simple as connecting a piezo buzzer to the output pin of the PIC, and several switches (with different series resistors) to the single analog input? If not, how do I wire it?
 
of the ones you mentioned, 16F628 would be your best bet, although overall I'd recommend the 16F88 more if you were able to get it. But the 628 isn't bad.

I can't really speak from experience with parallel port programmers, but nigel goodwin has a design available that works with his programming software... www.winpicprog.co.uk

as for driving the speaker, well I would suggest using a buffer transistor to drive the speaker, rather than straight from the PIC... a piezo would be fine right from the PIC, but a speaker could be a bit too much of a load.

As for compiler, well I really don't like BASIC myself but I can see how it's useful for beginners with PICs. I would suggest you look at C compilers (especially BoostC) in the future, if you know C at all that is.

I wouldn't wire the switches as analog inputs, given that you want a nice round number like 16 or 32 inputs, arranging them in a matrix arrangement is the way to go... like this: http://www.rentron.com/serkey16.htm
then you only deal with digital I/O, no analog, and you can still fit it in a reasonable number of I/O.
 
Evandude's advice is sound. I programme in assembly, it is easy and results in a more efficient programme than the higher level languages.
 
ljcox said:
I programme in assembly, it is easy and results in a more efficient programme than the higher level languages.

I agree with that as well. Whatever language you settle on for development, always make sure you have a moderate knowledge of assembly because at some point you will need it.

I program in C because for certain things, it's much easier, and basically I can write almost any program much faster in C than I could in assembly. However, there have been some instances where C simply isn't efficient enough to do what you need, which especially happens when you start dealing with very short time periods (like generating or reading serial data streams where there may be only a few dozen instruction cycles per bit or something) Basically, use a higher-level language as a tool to help you code faster and easier, NOT as a way to "escape" dealing with things on the assembly level.
 
warrenob1000 said:
I'm looking to make an electronic organ with several keys (16-32). It could output to either a piezo or 8-ohm speaker.

You can save the chips!

Why not just make yourself a simple oscillator, and cut the connection at the frequency dependant resistor, and replace the cut with a button. You have made a one-tone organ (or whatever sound you like to call it).
Now instead of having just resistors in parallel, make resistors and keys (like the first one) in parallel, and make each resistance value different.

When you press a key, you will get different sounds! In fact, you might even get the sound kids will laugh at! The F__ting sound! :lol:
 
I found replaycing an 555 timers cap whith your finger is an prety efective way of imtitating sqicking noises.

The harder you hold the two wires the lower the tone is.If you added vlomuce contro you could play music whith it.
 
Someone Electro said:
I found replaycing an 555 timers cap whith your finger is an prety efective way of imtitating sqicking noises.

The harder you hold the two wires the lower the tone is.If you added vlomuce contro you could play music whith it.
:lol:

What's vlomuce? is it a Voltage Loved, and Overly Mucked Ultra Control for Energy? :lol: :lol: Sorry, but that had to come out of my mouth after I hear audioguru talking about (fragile?) girls and love.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top