Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: PIC Controlled MP3 player

  1. #1

    PIC Controlled MP3 player

    Am starting to gather parts to embark on a pic controlled SD card based MP3 player i already have the following parts:

    1) 16F877A - DSPIC30F4011J just in case i lack program space on the 16F877A

    2) VS1053B- VLSI mp3 decoder ic which has a built in DAC and can decode any MP3 stream sent to it even internet radio if you have an ethernet based mico but you will need SRAM or DRAM to store the stream before sending to VLSI1053B it could even apply for an sdcard player

    3) Micro SD card holder/ SD card adapter and micro SD card sockets

    Next step:
    1) Currently studying VLSI1053B datasheet
    2) FAT16/32 file system study to read the mp3 data
    3) Voltage levels matching as the VLSI1053B requires 3.3V based signals

    Anyone did something like this before?

  2. #2

    16F877A Dev board

    Ater a long time searching and planning i have almost completed by 16F877A Dev board before goign for the VS1053B the schematic is attached 16F877A Dev Board.JPG

  3. #3

    Next steps

    After some long time not taking care of this project i am slowly goign forward with it. Currently one thing is clear is that 16F877A on its own does not have enough Ram memory to run the MP3 player though i have just completed a development board for it. External RAM has to be added as reading a SD/micro sd card requires that at minimum 512bytes are read at ounce and sent to the VS1053 who on its own can process more than that at ounce. I am currently preparing to build the following:

    1) Using a microsd to sd adapter and soldering wires to get the pins to run the microsd card in SPI
    2) Already have 3.3 and 1.85V available on my bench supply as the VS1053 uses 1.85V for its internal circuitry and 2.7- 3.3V for the rest.
    3) Building a DSPIC30F4011 dev board to run everything

  4. #4

    Project still going on

    I am currently going through accessing the Micro SD card using the pic. the following are useful references:

    SPI memory available from ebay:

    Coolset one i have seen up to now : the microcontrollers can be changed but the same principle kept

  5. #5
    I have move a little bit with this project. I am currently sending commands to the SD Card to get response back but i have to ind my way through the card is not responding. SD cards boot up in a native mode and they have to be set to SPI mode which i am currently trying to do.
    Another point is that its easier to set the pic to use 3.3V instead of using resistors like its shown on many web it does disrupt the signals when testing on project board

  6. #6
    I finally managed to intiialize the card to SPI. there are two commands to be sent to the card:

    1) CMD0 used to set the card to SPI mode

    2) CMD1 use to initialize the card

    both commands have the arguments and CRC specific to them but its easy to build up a function or routine and re-use it continuously. My next command is CMD17 which is used to extract data. The card minimum data storage unit is 512bytes and my pic's RAM is only 368bytes less what is required to run the program.

    The good news is that in SPI mode the sd card sends the 512bytes as 512 series of 8 bits maybe things could or could not work here. Even in case they don't i have 23A640 SPI Ram i bought from ebay and my DSPIC30F4011 board is ready i will post a picture of these soon

  7. #7

    Reading SD Card Data Successfully

    I have been able to read data from a 2GB card successfully and its attached. The tab MBR(master boot record) is the first part that has to be read from a FAT32 drive and the LBA begin address guides to the location of the FAT itself which i have to check properly. The issues met here are:

    1) Sending a 32 byte or more using an 8bit pic is possible by breaking it into 8 bit chunks and sending continuously

    2) Avoid doing anything else than transmitting through SPI so as not to slow things down

    3) Clock idle Polarity i.e. CKP bit in SSPCON register can be high or low irrespective the device will clock to it. Microchip uses CKP high and i have used CKP low without any problem (don't run it at several MHz am using FOSC/64 i.e 312KHz but don't go below 100KHz)

    4) Data sent by the device in this case the pic needs to be clocked with CS low. Waiting to receive spi data does not generate a clock. To keep the clock running the concept is always transmit 8 bit data whatever it does not matter it can be e.g. 11111110 (254 in decimal) just to keep the clock running followed by the SPI receive command.

    5) At this stage for debugging purposes an LCD is completely useless and too slow instead i am
    using the USART register and only the Tx line to display whatever i want to debug in Tera Term
    Pro 2.3

    6) A CP2102(plenty of boards available on ebay $2.5 and up) is adequtely suited to send data to the pc from the pic via USB and it can accepts 3.3V levels or 5V without any modification. the data in the excel file is a copy paste from tera term pro. the device appears as a COM port on the pc and to tera term pro

    thats it for now until i move a little bit more. One last thing the whole bunch of data seen is for a card containing nothing more than 1 text file. most of the bits there are indicative of technical details and thats my next step which is to find my way through all this
    Attached Files Attached Files
    Last edited by zeus_threat; 10-19-2012 at 07:29 PM.

  8. #8
    Its well on its way the Sd card reading is working fine the next step is to move ahead with reading the contents but as usual something else came in between. my program needs to be re-thought as right now am telling the program to go and read the precise bits i need rather than list all of them. A minimum card read returns 512 bytes which i already knew would be too big to fit on a 16F877A and according to a test not even on a DSPIC30F4011

    I am right now learning how to use an cortex m1 or stm32discovery board and i also have purchased a cortex M4 board from ebay. These devices have plenty of resources. Getting started is a bit more annoying cmpared to microchip as ARM provides something called the CMSIS library and ST also provides additional libraries. Its annoying at first start but once you done flashing the leds on the board and got the button to work its easy to go forward.
    Another great thing compared to Microchip is that these devices are built with debugging in mind contrary to Microchip where debug headers have to be purchased seperately. I'll keep posted.

  9. #9

    Adapter boards and next step

    Project is still on its way i have to shift on how to make the USART port work on the STM32F0 board which is one step done. Next i need to get the SPI port running on the STM32F0 eval board.
    The main reason why i am moving to this microcontroller is that VS audio recommends not to connect SD cards on the same SPI lines as the VS1053B. I have built an adapter board for the VS1053B i will upload pictures but in the mean time this is the apdapter board pcb and silk VS1053B adapter schematic.jpgVS1053B PCB+ Silk.jpg. I did not bother to shape the board to a specific size but we'll see how it goes

  10. #10
    I am still continuing with the project though I left it aside for a long time. I have cleaned up the code and made a cleaner hardware implementation for the SD Card. Instead of using 3.3V through out the circuit I have used a CD4050BE as a buffer that can translate the 5V pic signals to 3.3V level for the SD card. Another thing I ran into is hi tech c compiler used in PRO mode for my project was not compiling the code to do exactly what I coded in C. It took me weeks to find this out. I am back to lite mode and continuing with the project

Similar Threads

  1. PGA2311 Digitally controlled pre-amp
    By zeus_threat in forum Pre Amps
    Replies: 33
    Last Post: 05-15-2016, 05:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts