![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| HI... I want to build music tone using pic16f84? so i can make a sound. This is to be used in our project in Microcontroller subject (ex: a pic musical doorbell project). How to understand the conversion of the tones in assembly codes...? How to do that? Can anybody show me how to convert any music to an assembly program? | |
| |
| | (permalink) |
| Essentially you just turn a pin ON and OFF to generate a tone, you might have a look at this C example for ring tones http://www.beyondlogic.org/pic/ringtones.htm | |
| |
| | (permalink) | |
| Quote:
A beep is generated from turning on & off an output pin number of times. But for buzzers it different. & to generate a tone or Tune need some effort to do that. A simple method is applied here for PIC16F84A http://www.talkingelectronics.com/Pr...nts_page1.html Last edited by Gayan Soyza; 1st March 2007 at 09:51 AM. | ||
| |
| | (permalink) |
| You find a good one in the Labcenter Electronic's Proteus examples. | |
| |
| | (permalink) |
| Thanks for the reference (http://www.beyondlogic.org/pic/ringtones.htm) ...so i need to understand about RTTTL (Ringing Tones Text Transfer Language)..Can anybody explain what is RTTT..pls? so i can convert music tone to assembly code...I will use piezo speaker of my project...i'll just hope that it will create a different sounds with 2 or more inputs... i really need effort of this..... tnx... | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) | |
| Quote:
The article mentioned by Gayan Soyza should be what you need to do. A speaker is easier to use then a piezo. The hardware as laid out in the ringtone page would work. Use a 47uF cap. | ||
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| I managed to do this on an AVR and plays decent music (Square Wave) I shall post the programme soon... It is capable of playing 4 octaves...
__________________ Bharath Bhushan Lohray. M.Sc. Electronics. | |
| |
| | (permalink) |
| check out roman black's BTC algorithm. especially the 2 bit version with produces better sound. http://www.romanblack.com/btc_alg.htm | |
| |
| | (permalink) |
| Or maybe this is more what you were looking for? Generating sound | |
| |
| | (permalink) |
| I don't especially know much about microcontrollers, but couldn't you generate a bit more of a sine wave-type sound using cap(s) and an D/A convertor? Juuust wondering. EDIT: Just to clarify, I meant by using a D/A convertor to step the voltage up, then down and caps to antialias the wave. Last edited by ArtemisGoldfish; 3rd March 2007 at 02:51 AM. | |
| |
| | (permalink) |
| yes, you could certainly use a DAC. The ideas that people are putting forth are about using one or 2 pins. A parallel DAC will take 8-10-12 pins while a serial DAC will take fewer pin but is a bit more complex to use. I would not use parallel with a uC but rather a serial one. However, I didn;'t get the sense you needed all that great quality. Look at the Roman Black page - his algorithm actually produces fairly good sound quality with 2 output pins. By the way, a DAC doesn't step the voltage up or down but rather you tell it what voltage level to output, thus tracking the waveform you are trying to reproduce. | |
| |
| | (permalink) |
| Here is another link I searched when I was Researching. ![]() http://www.qsl.net/yo5ofh/pic/tone_generator.htm See if it's suits you.But I haven't try that. | |
| |
| | (permalink) |
| that's called an R-2R ladder and it is, in fact, a simple DAC. 8 bit, simple low pass filter. it uses an RC oscillator for the clock so it will be pretty innacurate - better to use a real crystal. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| adc/dac interfacing with pic microcontroller | bebo670 | Electronic Projects Design/Ideas/Reviews | 3 | 16th February 2007 12:47 AM |
| HOW TO generate 3pwm output using one pwm in a pic microcontroller | Anniyan_x | Electronic Projects Design/Ideas/Reviews | 13 | 15th November 2006 02:01 AM |
| Microcontroller Music - Harmonic Distortion. | lord loh. | General Electronics Chat | 10 | 6th November 2006 09:42 AM |
| Newcomers, please read! (PIC regarded) Upd. 0xD | Jay.slovak | Micro Controllers | 0 | 17th April 2005 02:05 PM |