PDA

View Full Version : Sound and sound control with minimal parts



bartman
- 10th January 2005, 14:13
This might be considered a huge project for me since the previous one was just randomly blinking LEDs, but I want to investigate it none-the-less.

I would like to see about building a project that would consist of:

three buttons (pressing two of the button changes LED states as well as generates a sound. the third button activates different LEDs and generates a different sound)

PIC (to read the buttons and control the output)

Sound Chip (to contain the different sounds and play back the appropriate one)

VERY small speaker (I want to squeeze this all into a very small Star Trek prop)

Ideally I would use PBC NOT the pro version.

What is the easiest way to get this working? I can sorta see how the PIC would be used for the control aspect. I'm a little unsure of what to use for a sound chip. I know there are, I believe, ISD chips out there that can hold anywhere from 10 seconds to minutes of sound. I figure 10 seconds to hold two sounds is plenty.

Any comments or ideas would be appreciated.

Thanks.

Bart

mister_e
- 11th January 2005, 03:36
Hi bartman,
i'm actually play with those ISD chipcorder.. that's working for sure... it's sounds as bad as a telephone line. Depending what you want to store.. WAV or simple TONES. IF you want to store simple tone... i really suggest you one little pic with an internal PWM module...like PIC12F683. But if you plan to store something like WAV, voices... ISD can be a great choice. I'm really close to finish code example to be post on a other forum. After that i'll try store sound into EEPROM... Cheaper choice, ISD are between 15-30$ each... EEPROM <5$. Using a pic with a/d converter and store value to EEPROM will give something. I remind a previous post on the forum like "Sounds with PIC" or something like that. There's a few link on some already build product and schematic... without the code.


If you want to use ISD chips, you have to know/understand SPI/Microwire communication. In PBP we use SHIFTIN/SHIFTOUT statement. I suggest to try SPI/Microwire before with a simple EEPROM like 93c06 or 93c46, Will be easier to see if you write/read them correctly.

With ISD ChipCorder you'll need 4 i/o pins + 3 for your pushbutton. 7 i/o: PIC16f627 16f628 could be a cheap choice for that project. But by some programming tricks, you can reduce to 2 push button + ChipCorder : 6 i/o.. pic12f629/12f675/12f683/12f508/12f509 will give you enough code space.

mister_e
- 11th January 2005, 03:54
This was the post i was talkin about http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=739&highlight=sounds

bartman
- 11th January 2005, 04:29
OH Boy.

This would be biting off more than I can chew I think.

First, I thought some of the ISD chips can be PIC controlled as they relay only on high/low pulses? No special programming required.

Second, I don't know if I can fit a large enough PIC and/or ISD chip in there. I need. at a minimum, 3 inputs, four outputs for the sound, 10 outputs for the LEDs. In that very small prop would also have to be batteries and a small speaker.

Third, the ISD must be better than a phone line surely? The frequency is higher according to the specs.

Fourth, I'd only want sound play-back in the prop so the actual recording would be done outside of the prop and the chip put into the prop. This is to further keep down the components in the prop. Don't need anything extra for recording.

Fifth. It would be all .WAV files recorded.

I looked at the link and the link off that to the sound PIC. That PIC seems like it would be physically too large for my application and even if it weren't I don't think it can handle all the other duties for input and output. It looks pretty dedicated, but I'm looking further into it just in case I'm seeing just the surface of the thing.

Thanks.

Bart

mister_e
- 11th January 2005, 04:53
i found this ISD1100 http://rocky.digikey.com/WebLib/Windbond/Web%20Data/ISD1100%20Series.pdf

You can easily interface directly to PIC i/o. Those push-button serie can record up to 20secondes. Do a search on Digikey website regarding your need.

You'll also found some who work with I2C protocol. You need 2 i/o. SPI/Microwire 4 i/o.

So at minimum you'll need 10 output for leds, 3 for push button, 2-3 for chipcorder : max 16 i/o... PIC16F627/16F628 still a great choice.


the ISD must be better than a phone line surely? The frequency is higher according to the specs
yep a bit but don't expect a hi-fi recording. As i epriment with ISD4002, it's actually sounds like Real Audio or some Windows Media stuff... but on a small speaker... that will be enough.

bartman
- 11th January 2005, 05:01
Yes, that is the one I have the datasheet on.

It's still fairly complicated for me at this point. I would need to access different sounds saved on the chip and size wise it's pretty big. Really what I need is the "microversion" that skips the plastic case, but I don't think I can solder that myself!

I don't expect hi-fi. :-) Would be nice, but not realistic. Still need to look at fitting everything in a space that will probably measure 1x2 inches with the possiblity of using a double sided pcb. Size is really the major issue. Everything would need to be surface mount at a mininum.

Might still be fun to breadboard it to see if I can make it all work. Good learning experiment if nothing else.

Bart

mister_e
- 11th January 2005, 05:10
Well surface mount is a great choice for sure. Not so much hard to solder those on a board. If you have a small tip + smal solder (.0020) and solder flux, everything can be done with a bit of patience.

BUT some will also prefer to use solder paste and cook it inside a oven or with a fine nose heat-gun too. For SOIC i'll use small solder + flux. But for "fine pitch" one i'll use Solder Paste like Kester R276SR.

mister_e
- 11th January 2005, 05:13
But if you want, i can build it for you on a double sided board with all the part already soldered on. Let me know.

bartman
- 11th January 2005, 13:48
Thanks for the offer. Might be some time until then. I'm a slow designer! Also need to find the smallest possible parts to start with.

If it looks like it might all work out I may take you up on your offer. Hope you have a long memory as it may be a long time coming!

I'll still need to research both the PIC options and the sound options. If anyone else has experience in this area and can offer some insight it would be appreciated.

Thanks.

Bart

bartman
- 17th January 2005, 04:05
Mister_e,

I have been looking at the chipcorder you mentioned as well as their 2500 series more closely and I downloaded their sound quality examples and I think they would be acceptable. I read a bunch of datasheets on the 2500 series and its use with a MCU and that one sounds rather confusing.

Elsewhere on the net someone had a simple 2500 circuit that was storing 10 sounds each accessed by a switch.

So, if it is just simple sound play back based on a specific address being fed in with a mechanical DIP switch couldn't a high/low or pulse out commands on a PIC accomplish the same thing without the pages and pages of reading for MCU use? I think that may be important for more dynamic use of the sound, but all I really need is for a momentary contact switch to play a specific sound and stop at the end of it. Wait for another switch and do it again. Nothing fancy.

I think I can wrap my head around the project if it doesn't need to be complicated with data all over the place. I don't even think I need those 5 address inputs available as it looks like 3 would give me more than enough addresses (I'm figuring on 5 sounds in total with the pic setting the pins based on how the three users buttons are being pushed).

So when you mentiond the 1100 were you thinking the pic would act like a simple switch instead of a physical switch or were you thinking I really had to dig deep to get this out with MCU control? On a side note the data sheet for the 1100 series doesn't list MCU as an option.

Next, because this is going into a very small space and it will be run with a single 32mm 6v camera battery I have to drive a speaker that is equally small. What do you think would be better? A laptop speaker such as this one:

http://dkc3.digikey.com/PDF/C051/1272.pdf

(the 16x35 mm would probably be the largest I could fit) or this one:

http://dkc3.digikey.com/PDF/C051/1270.pdf

(the 20mm micro speaker, but I don't know how the 7 ohms works in a 8 or 16 ohm system) or this one (on the same page):

http://dkc3.digikey.com/PDF/C051/1270.pdf

Which is a 30x30 card type speaker, which makes it perhaps too big, but no thickness which is also critical.

I would need to get the most volume possible with no amp as there will be zero room for that.

Next guestion is in regards to space.

I see that some of these chopcorders come in die form. Now I know that this isn't something that can be done at home with a regular soldering iron, but that whole concept appeals to me because the space used is next to nothing. Just out of curiosity, is there any place that can set up this sort of thing and tie it into my circuit pattern? I imagine the cost would be too high, I'm just mainly curious how it works.

Hope you are still awake after this list of questions. I hope to order the PIC, sound chip and a couple things for making a "recording studio" with my next Digi-key in the next few days so if you or anyone else can get me over this humb I'll be good to go with my order.

Thanks.

Bart

P.S. edit. the 16F628 PIC may not have enough I/O ports. With my 3 switches and 10 LEDs that only leaves 3 to set the address for the appropriate sound and to trigger that sound. Perhaps 18 I/O would do it. Size still an issue unfortunately.

mister_e
- 17th January 2005, 06:15
Well huge one :) Lets begin !!!

I'll still prefer the 4000 serie because you'll have the plenty control of the adress to begin/stop the message. You'll be able to determine your own adress for each message. Everything by software.

With the 2532, wich its seems to be enough for your app, you'll have to play with message cueing and other bla bla wich will give you more than one headache. And you'll need the same i/o count than with the 4000 series(forget about INT, RAC pin on 4000... can be monitored by software). BTW i also found ISD2560 here in my demo stuff... i think it will be handy in case you'll need any help if you still want to use 2500 serie. I've to finish the one with 4002 i begin... really simple after all.

With the 1100 serie... will be also the same *problem*


Elsewhere on the net someone had a simple 2500 circuit that was storing 10 sounds each accessed by a switch.
can you provide the link?

For you speaker choice, i really don't suggest those Panasonic Card one.. they sounds like hell and so far... not loud enough. I got some of them several years ago and i'm still stick with. The 20mm or 16x35mm will be better. By the specs 20mm one will sounds better. Don't be afraid on this 7 ohms... this will work anyway. If you feel safer add a 1ohm resistor in serie.


I see that some of these chopcorders come in die form. Now I know that this isn't something that can be done at home with a regular soldering iron, but that whole concept appeals to me because the space used is next to nothing. Just out of curiosity, is there any place that can set up this sort of thing and tie it into my circuit pattern? I imagine the cost would be too high, I'm just mainly curious how it works.

As i know/heard, and i'm not familiar with those package, they are *glued* on the board with a special paste/solder. They have to be check with some X-Ray system wich is much expensive than the one your dentist use. One of my friend did some when he works for NORTEL.

BTW if you want to have better explanation on that, here's a link i just found from MAXIM website.
http://www.maxim-ic.com/appnotes.cfm/appnote_number/3377

I suggest SOIC to begin with solder flux and/or solder paste.

bartman
- 17th January 2005, 16:36
Thanks. I wasn't 100% sure on those card speakers either since they came out in computer speakers and everyone I've ever talked to hates them.

The site with the DIP switch to set addresses is:

http://www.scary-terry.com/dsr/2560recadv.htm

I'm not opposed to using a different chip I just need to keep it as simple as possible both in terms of components and programming it. The 4000 doesn't list either pushbutton or MCU as it's control option so that does scare me a bit.

Remember, and this is really important, this will make my random number project look like a walk in the park. I have to keep it simple and within the basic language NOT the pro language. So please keep it simple for my sake! :-) A bunch of assembly routines will not be a good idea.

Now, about the PIC itself. With your suggestion of the 16 I/O ports that leaves just 3 for the sound chip control. Whatever happens it would have to remain in that limit for the 5 different sounds or I need a different PIC. I think I would choose one with eeprom regardless since I might end up needing it for the final program and would rather have it to start with just in case.

I'll stick to the surface mount stuff. Too much overhead to invest in the X-ray machine and probably a computer to do it the other way! :-)

Thanks.

Bart

P.S. edit to say you probably figured this out, but I will want to make a recording circuit which can have as many parts as it needs to have a line in from the computer to record then the playback circuit which has the bare minimum for parts.

mister_e
- 17th January 2005, 18:24
Hi bart, thanks for the link.

I'm not opposed to using a different chip I just need to keep it as simple as possible both in terms of components and programming it. The 4000 doesn't list either pushbutton or MCU as it's control option so that does scare me a bit.


you can do with the 2500 serie too, you'll need more i/o for sure (for adress management and push button) It can be a bit more easy to program but don't be so afraid with the 4002 serie. Let's work together on that with all the PBC statement.


Now, about the PIC itself. With your suggestion of the 16 I/O ports that leaves just 3 for the sound chip control. Whatever happens it would have to remain in that limit for the 5 different sounds or I need a different PIC.

10 leds+5 pushbuttons+4 chipcorder = 19 i/o
O.k. now have a 28 pins PIC wich will give you about 20-25 i/o. PIC16F870 PIC16F872,PIC18F2220 could be great choices.


I'll stick to the surface mount stuff. Too much overhead to invest in the X-ray machine and probably a computer to do it the other way! :-)

I heard about a million $ about the X-Ray machine... a bit expensive for experiment purpose :0)


P.S. edit to say you probably figured this out, but I will want to make a recording circuit which can have as many parts as it needs to have a line in from the computer to record then the playback circuit which has the bare minimum for parts.

smart move or something like testpoint/edge connector jig to access to it in-circuit. BTW for the recording stuff you just need 2 capacitor and a maximum of 4 resistors. Edge connector with ICSP capability and Line in will be sufficient IMO.

bartman
- 17th January 2005, 19:20
You say, "10 leds+5 pushbuttons+4 chipcorder = 19 i/o
O.k. now have a 28 pins PIC wich will give you about 20-25 i/o. PIC16F870 PIC16F872,PIC18F2220 could be great choices."

On the final device we have 10 LEDs and 3 push buttons, not five so that is 13 plus whatever is required for the sound and I assume four is okay so that is 17, round to 18 for good measure and because you probably can't get a PIC with 17 I/O ports. There is still 5 total sounds, but not 5 buttons.

NONE of the three buttons will directly address the sound chip. Everything will need to route through the PIC as with each sound there will be different LED configurations to worry about as well.

So, am I right then that 18 ports will be the way to go?

I do not think there will be room for any onboard testing equipment for playback. That is fine for the recording pcb though.

What is this for the recording end of it?

"Edge connector with ICSP capability"

I assume this just means a way for me to run out of the PC with an audio cable and into the sound chip recording circuit?

I'm at work right now so can't spend a bunch of of time looking at spec sheets. I gather from your comments that the 4000 series has a different way to address instead of the 5 ports on the others? I'm getting from you that there is one port which will be the trigger to play and three lines we'll be using for the addressing?

And all this can be done with basic and NOT pro versions of the picbasic?

Thanks.

Bart

mister_e
- 17th January 2005, 19:48
So, am I right then that 18 ports will be the way to go?
yes but on the market, you'll have 16 i/o and the next one 21 i/o. A LED sacrifice can be done to save space. Choice is in your hand now!!!


I do not think there will be room for any onboard testing equipment for playback. That is fine for the recording pcb though.

What is this for the recording end of it?

"Edge connector with ICSP capability"


O.K. ICSP (in-Circuit-serial-programming) this can be used to program/update your PIC firmware. I was thinking about only 1 board who'll do all the stuff. Program your board to record, and after reprogram it for playback. Or something like that... i think that's comming a bit complicated a this point for you... but we can design/plan it together. As you want *one day* use surface mount stuff, i felt it was cheapest to build only 1 board who do everything.

With the 4000 serie, all we need : MISO, MOSI, SCLK, SS pins.


And all this can be done with basic and NOT pro versions of the picbasic?

For sure, since everything can also be done in assembler too, feel safe with PBC. We will use SPI/Microwire comms. Will be a bit more tricky than with the PBP SHIFTIN/SHIFTOUT but, nothing is impossible.

bartman
- 17th January 2005, 21:13
Then it will need to be 21 I/O ports. No sacrifice of LED, but now I will need to find out the size of something appropriate. We're so far dealing with 2 fairly large chips even if they are surface mount.

There will be two boards for sure as the finished project need only do play-back and not recording. I'd want to pop it into the recordering circuit then solder it onto the playback board. This board will only be about 1x2 inches. On the front there will be 1 LED, on the top there will be 9 LEDs and the three switches and on the bottom must go the PIC and sound chip. The speaker squeezes in somewhere under that and the battery to the back of it. Any resistors and capactitors will also need to be surface mount, but I don't think they will take up much room.

So, while I understand the basic concept of the sound chip the program itself will be fairly complex as everything interacts with the LEDs and the switches. Once I know what components to use and know they will fit in the size department I can take the time to make a flow chart of sorts so I don't get any more confused than what I need to be.

Microwire currently has no meaning to me so I don't know how scared I should be of it.

Did you look at the site I posted with the DIP switch addressing unit? How did they make it work? I know from reading the 2000 series manual that it has five address pins, but depending on how many different sound bytes you can use anywhere from 2 to 5 of those pins. I need five sounds so 3 pins plus the play trigger still gives 4 total for the PIC to deal with. I just can't help but think the 4000 seires is overkill, but maybe in the long run it is easier to deal with.

Thanks,

Bart

mister_e
- 17th January 2005, 21:52
Microwire currently has no meaning to me so I don't know how scared I should be of it.


See the flowchart somewhere at the end of the datasheet... yeah it seems more complicated than what it is :0)


Did you look at the site I posted with the DIP switch addressing unit? How did they make it work? I know from reading the 2000 series manual that it has five address pins, but depending on how many different sound bytes you can use anywhere from 2 to 5 of those pins. I need five sounds so 3 pins plus the play trigger still gives 4 total for the PIC to deal with. I just can't help but think the 4000 seires is overkill, but maybe in the long run it is easier to deal with.


Sure i look to. They use the parrallel adressing mode wich is not recommended by Winbond as they write in the datasheet. BTW if you feel more confortable with this serie, i've some here to do some test with. The most important thing is your way you understand each series. I don't mind to use one or the another. But since i'll not have the full control in the 2000 serie with few i/o pins, i still stick with the 4000 serie. Also it will give you a great knowledge of the SPI/Microwire stuff. Many other devices use this protocol. Could be handy one day or another. What do you think???

bartman
- 17th January 2005, 22:33
I'm all for the 4000 series. I have to price them yet though. I'm also for all the learning part. I figure if I can get through this one I will have gained a whole bunch of knowledge which I like.

Now, what PIC is going to be the final choice? Hopefully supported in both my programmer and IC-Prog.

That raises another question though. How the heck do I program a surface mount chip? Is there some kind of adapter for the programmer?

For the breadboarding I will use a regular chip just for ease of use since I'm sure I'll be ripping it out a 100 times until it gets done.

Another idea. What about two smaller PICS talking to each other instead of one big PIC? Does that just complicate things more than they need to be?

Thanks.

Bart

mister_e
- 17th January 2005, 22:57
Well this is why i suggest you an ICSP connector. With this you'll be able to program/erase/reprogram your pic without removing it from the circuit (ICSP : In Circuit Serial Programming) Most programmer will handle it. Have a look at this link (http://www.melabs.com/support/icsp.htm)

Or do as search in the forum about ICSP stuff. That's the way to go now. I never use any adapter for all my application. Everything is program in-circuit. Avoid in this case to place/remove/replace your PIC on your prototype board wich litlle contacts will die soon.

But for your question, there's adaptor on the market for those surface mount stuff... a bit expensive but. see them here (http://www.melabs.com/products/adapters/soicadpt.htm)


Another idea. What about two smaller PICS talking to each other instead of one big PIC? Does that just complicate things more than they need to be?

IMO that just complicate things more than they need to be. In case you want to use few pics, you'll have also to manage serial communication between together... and program 2 device, debug 2 device and so forth... Keep it simple :)

bartman
- 18th January 2005, 04:18
It's sort of the cart before the horse thing.

I won't be able to make the actual play-back/LED board until a point where the housing will be made and I'm not sure when that will happen. I'm trying to get something that will work for now so I can figure out sizing a bit.

I can breadboard everything with a regular DIP ICs for the development stage and by then maybe the pcb design will come together. Those can be sacrifice chips for experimenting.

I have a feeling any kind of connector won't fit on the final design. I looked at the links and I'm not even sure those adapters can work with my programmer. I really don't want to invest in a new programmer. More to figure out later.

What PIC should I be looking for datasheets on? I checked physical sizes of the one that you first suggested that won't have enough ports and it looks like it is small enough so hopefully the "next size bigger" also fits.

Thanks.

Bart

mister_e
- 18th January 2005, 04:35
i previously post PIC16F870 PIC16F872,PIC18F2220 as choice

fast view of those :

PIC16F870 PIC16F872:

22 i/o
2K code memory space
need external crystal
64 bytes of internal EEPROM
6.29$ CAN

PIC18F2220:
25 i/o
2k code memory space
don't need external crystal
256 bytes of internal EEPROM
9.96$ CAN

Both are good and provide more than what you'll need. I'll prefer use the 18F2220 to save space for crystal + you'll get more i/o.

bartman
- 18th January 2005, 05:51
Originally posted by mister_e
i previously post PIC16F870 PIC16F872,PIC18F2220 as choice

fast view of those :

PIC16F870 PIC16F872:

22 i/o
2K code memory space
need external crystal
64 bytes of internal EEPROM
6.29$ CAN


Probably would need to be this one since the other isn't supported by pcb from what I can tell. Still leaves extra I/O ports and that would be okay as I could add another couple LEDs which I had previously left off due to available ports.

Depending on the physical size of one of these and the chipcorder there may be room if the crystal is small. From what I can tell looking at some specs the surface mount chips are usually about 10x17 mm which is well within the realm of putting a couple on a 1x2 inch board side where there isn't going to be any LEDs or switches in the way.

I'm at information overload for tonight now so I'll check into sizes tomorrow then try to get a list together for the breadboarding of this. I have to work on it slow. Too many other pressing obligations and I don't want to stress myself out trying to learn it in a day.

At least I can probably make the LED's turn on and off the way I want so that's a start! :-)

Bart

mister_e
- 18th January 2005, 05:56
Simply do it step by step. You must be feel safe with all you d before going to the next step.

i'll suggest you one great and small crystal resonator with internal capacitor (instead of crystal). Available also at digikey : ZTT-4.00MG

yeah i see IC-Prog don't support 18f2220... not a big deal. F870 or F872 will also do the job as well.

bartman
- 18th January 2005, 14:08
Oh, actually the chip wasn't supported by pcb, I haven't looked at IC-Prog list yet now that you mention it. I better do that too.

I also slept on the edge connector idea. Maybe some ways there too. We can save that for later. Itr would be better to do it this way.

It's not only the PIC that needs programming, but the sound chip needs to be loaded too so I can't just pop it out of a recorder and stick it on a board. More details for later as well.

So, the immediate plan is to check sizes, compatibilty with IC-Prog and get a parts list together for the breadboard experiment stage. I assume the datasheets will be direct enough there as we're not dealing with a huge number of parts.

Bart