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.

Play basic music from a pic

Status
Not open for further replies.

Mosaic

Well-Known Member
Hi,
I want to build nursery rhyme play back from a PIC .
Single voice should be ok...kinda like the musical birthday cards etc.
Can anyone suggest an approach?

I was thinking of a frequency and duration pair of bytes for each tone so that a 256 byte eprom can 'store' up to 128 tones to make up clips of rhymes. Perhaps 10 seconds each?
 
Hi,
I want to build nursery rhyme play back from a PIC .
Single voice should be ok...kinda like the musical birthday cards etc.
Can anyone suggest an approach?

I was thinking of a frequency and duration pair of bytes for each tone so that a 256 byte eprom can 'store' up to 128 tones to make up clips of rhymes. Perhaps 10 seconds each?

Have a look here - it plays normal ringtones as used on phones:



I had a play with it a long time ago, it works really well - and is easily ported to a tiny 8 pin PIC (and would presumably fit in a SM 6 pin one?).
 
Just a quick update, as this thread 'inspired' me :D

I've started playing with XC8 recently, so took the opportunity to see if I could get this to work with XC8 (C never seems as portable as people like to suggest).

I already happened to have a 16F876 connected to my PICKit3, and the only change I had to make to the code was line 230, replacing OPTION with OPTION_REG (which I believe Ian mentions in the C versions of my tutorials?).

Worked straight away after that - biggest problem was finding a speaker to try on it :p
 
That's good news...
While I plan to learn PIC C this year...I am still an ASM guy.
But I can read the C structure.
 
That's good news...
While I plan to learn PIC C this year...I am still an ASM guy.

So am I, but I'm trying to learn C (yet again!:D)

When I played with the ringtone circuit before, I converted the C to asm to run on a 12F675 - it's a long time back though, no idea where the code might be?.

However, having recently downloaded and installed the free version of XC8 it was EXTREMELY easy to get the C code from the site above to work - I've also changed it to work with the 12F1840 (because I have some :D) - and while I haven't finished altering the setup details for that chip it does still build OK (but I can't seem to find my 8 pin tutorial board?, so my enthusiasm has waned). But a small 8 pin chip that plays ringtones is pretty cool.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top