Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Play music using 89S52

Status
Not open for further replies.

pashok84

Member level 4
Joined
Apr 11, 2011
Messages
71
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
India
Activity points
1,831
Hi,

I want to build a 89S52 system, which can play music. My objective is to store a one song in microcontroller and play that song everyday at particular time.

I can to timeing stuff using RTC. i dont have idea how to play a song from microntroller.

Can anyone share your ideas related to this query.

Thanks and Regards,
Ashok Kumar P
 

I'd strat with two deficiencies of the 89S52 - not enough memory and to slow ..

:wink:
IanP
 

You can do it with voice playback chips like APR9600 with at89S52 to trigger the song by reading RTC.
 
Hi Nandhu15,

i checked the datasheet APR9600, it can record for 40 - 60 secs. How about playing full song (for about 5 mins).

Thanks and Regards,
Ashok Kumar P
 

Thanks vinod.

is it possible to replace PIC with AT89S52 microcontroller, do think speed might be a problem.

I have few question.
how we can know the address for song location. For example, if i am using the mmc card in my laptop/mobile and save songs to it directly. how can i retrive it for playing the song.

one possible solution might be to add intellegence to microcontroller to save the address of the songs. give the song as input to uc through serial port and get it saved in mmc.​
configure the song name/id while uploading and select the name/id to play it. so uc will know the address based on the name/id​
 

You can played a poor quality song with 8051 by use extended Ram or Rom(49F010). It's about 16kbps mono channel.
 

My idea for this project is given in detail in this link
**broken link removed**

Please validate it.
 

why 89S52 ? is it because you have one lying around or can buy easily, or to keep the cost low ?
if the answer is yes to either one of them, then i'm afraid you'd face some roadblocks (to put it mildly).
firstly, you can forget playing back a mp3 encoded song. the decoding process of mp3 is not possibly on a MCU like mp3.
so you'd need a mp3 decoder chip (many available from cos. like TI, maxim, NXP and also many small Taiwan based cos.), but buying those in retail is going to be more expensive (and hard to find) than your MCU. however, even they need to be feed with a continuous data-stream of encoded data, to generate PCM output, and that needs storage and then you need the audio electronics (well, some of the decoder IC's have high integration and can even drive a small 2Ohm 0.25W tiny speaker).
alternatively if you are thinking of raw audio samples, even at the lowest spec level 8bits/sample, 11.1KHz sampling, and a full song say 4-5mins, you need some significant memory there. since you mention "high quality", I think that kills it, as the melody IC's won't do either.

---------- Post added at 09:38 ---------- Previous post was at 09:33 ----------

@pashok84. It's a fun idea. quite doable. just don't say that you want to do it with 89C52 only :) ... well, doable with 89C52, with that MCU playing a small "glue" role. there are 89C52's with RTC (I think), so your timekeeping logic should be simple. else, use an external RTC IC, and use 12 OTP / reprogrammable melody-IC's to store small songs. The quality won't be great. Pretty much like the cheap chinese toys (what you get at 8kHz, 8bits/sample raw audio)... and not hi fidelity audio.
 

Thanks Jayachar88 for your comments.

It makes me understand that system is more complex than i estimated. I am not restricting myself with 89S51.

Can you suggest a system to for this project.
 

Depends on what is your ultimate objective -- i.e. actually to build this thing, or to learn something about the MCU, to learn programming etc.
Do you really want to do software decoding of MP3 (or other compressed audio format) ? MP3 decoding is standardized in IC's. However based on what is your ultimate goal, and what you are willing to compromise on, there are many possibilities.
You can find some inspiration here:
Simple MP3 player - Hack a Day
MMC_mp3
MP3stick MP3 Player - Mictronics
DIY small and cheap MP3 player | Embedded projects from around the web

You will notice that once you figure out the part on how to play stored audio, using RTC to manage wall-clock time, is rather trivial (esply. if you accept some hackish way of setting the clock initially, and periodically willing to adopt that way to reset it... say once a month).
 

I have few question.
how we can know the address for song location. For example, if i am using the mmc card in my laptop/mobile and save songs to it directly. how can i retrive it for playing the song.
one possible solution might be to add intellegence to microcontroller to save the address of the songs. give the song as input to uc through serial port and get it saved in mmc.
configure the song name/id while uploading and select the name/id to play it. so uc will know the address based on the name/id

This is done by a file system. For these type of embedded projects, a fat 16 or 32 file system is generally used...
Just compare an 'MMC with a file system' as a 'book with 'CONTENTS' page.. So, you could see the content of the book by just looking it on that page (one or more pages) ...Then if you want to read any particular content you will look the page number (address) of the starting of the content and will read the content...

Similarly there is a root directory in a fat file system which contains the [file name , file size, file attributes, starting cluster address, time etc ]. So from there you could obtain the file name and its starting cluster address..Then you can go to the cluster and read the content. If the cluster reading is completed, you could obtain the next cluster address of the same file from the FAT.. Want to know more ? see this link **broken link removed**
 

If your not overly concerned about audio sound quality you should look at Roman Black's 1-bit audio encoder. You can preview the sound using his PC software and tweak it to acceptable level. Sound is not back at all.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top