I have it hooked up to both. With the piezo it sounds wimpy, but = connected directly to my sound card it sounds kinda cool. For such a = simple bit of code, that is. Oh, if you tried it, I apologize. I wasn't totally complete. The = prescaler is set to 16: ; PWM Configuration movwf TRISB banksel T2CON movlw b'00000111' ; prescaler movwf T2CON (oh, be sure and set the volume very low to begin with.) > Subject: Re: [PIC]: Making sounds with Pics >=20 > Hey Lindy, > I'm curious, are you hooking this up to a piezo or some other > speaker? >=20 >=20 > Lindy Mayfield wrote: >=20 > >>Texas Instruments used to make the SN76477 and the SN76496. > >>These are listed as "sound generators" and were meant to be > >>used in video games to produce a variety of sound effects. > They > >>contained a noise source and various envelope generators. > >>The former chip (and maybe the latter) are no longer made, but > >>the > >>data sheets may be available somewhere. They showed how > various > >>sounds were synthesized; this might give you some ideas. > >> > >>John Power > > > > > > This is an interesting subject. I was looking at the embedinc > website on their HAL project, and how they use PWM to make all > sorts of sounds. It went right over my head, but it gave me > ideas to experiment with. > > > > Just the PWM output from this code produces a sound like a > motor, sort of like the one from Pink Floyd's Welcome to the > Machine: > > > > test > > banksel T2CON > > btfss T2CON,TMR2IF > > goto $-1 > > banksel CCPR1L > > decf CCPR1L,f > > banksel PR2 > > incf PR2,f > > goto test > > > > So it got me to thinking that with the proper algorithms and > maybe a little help from some simple wave shaping components, > one could get an awful lot of good sounds from a PIC easily. > > > > Make the input voltage controlled and then it would be easy to > build a sonar or IR controlled Theremin, or as another PIC > project create a midi to control voltage converter. > > > > It also got me to thinking about the difference between using > tables to produce a wave as opposed to using an algorithm. > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004 =20 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body