Wanted: Sound chip interfaced with pic


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    Can I transfer the wave file 'bit per bit' into a memory chip or does the file need to be modified to be used by the dac?
    Which DAC would that be?
    Not too many PICs out there have DACs.

    Another thought for you...
    44.1Khz sample rate * 16 bits * single channel (ignoring stereo for the moment)

    705,600 bps shift rate... Doable by a PIC, assuming you use the right crystal and the right baud rate dividers...
    88,200 bytes per second total transfer rate from EEPROM to DAC thru the PIC.
    Again, doable by a PIC since it's the same thing.

    Ok, set up the SPI at the proper bit rate to shift data out of the EEPROM sequentially...Done...
    Catch an interrupt every 8 bits to grab byte data from the SPI...
    Catch every other interrupt after grabbing 2 bytes to send the 2 bytes out to the DAC.
    Is this going to be a serial DAC or a parallel DAC? 16 bit DAC or 8 bit DAC?
    Serial DAC...well, your SPI is already tied up grabbing data from the EEPROM, unless you're using a large PIC with 2 SPI modules. So, do you have enough PIC cycles left over to shift that data in and/or out using the firmware? Using Shiftin and/or Shiftout, you aren't going to have a lot of cycles leftover for much at all.
    Parallel DAC...Your SPI is still tied up grabbing data from the EEPROM. Do you have enough pins left over to pump parallel data out to the DAC (at minimum a 28 pin PIC with practically no pins leftover to do anything)? Not to mention enough cycles left over to process any other inputs/outputs that your project requires?

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    M25P32 PIC Audio v1.0
    Warning: other compiler.
    PBP's support of Longwords makes porting more feasible.

    Is this going to be a serial DAC or a parallel DAC? 16 bit DAC or 8 bit DAC?
    M25P32 PIC Audio supports both 16 bit and 8 bit serial DAC.

    So, do you have enough PIC cycles left over to shift that data in and/or out using the firmware?
    Does 8 bit and 16 bit at 44k, Ulaw compression at 32k and IMA compression at 22k.

    The Basic compilers have safe reliable built in commands
    such as SHIFTIN, SHIFTOUT and ADCIN but a great deal of
    speed can be gained by use of the registers.

    I am presently in final stages of an SD PIC iPod.
    8 bit stereo 44k and Nokia 6100 GLCD with scrolling menu, in data long file names, and BMP pictures.
    All done in BASIC with a PIC18F452 and SPI interface between the PIC, SD card and the GLCD.
    DAC's are parallel.
    Sequential read of data.


    Norm
    Last edited by Normnet; - 7th September 2008 at 19:25.

  3. #3
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile PIC18F and 16 bit serial DAC with SPI communication

    Quote Originally Posted by skimask View Post
    Which DAC would that be?
    Not too many PICs out there have DACs.

    Another thought for you...
    44.1Khz sample rate * 16 bits * single channel (ignoring stereo for the moment)

    705,600 bps shift rate... Doable by a PIC, assuming you use the right crystal and the right baud rate dividers...
    88,200 bytes per second total transfer rate from EEPROM to DAC thru the PIC.
    Again, doable by a PIC since it's the same thing.

    Ok, set up the SPI at the proper bit rate to shift data out of the EEPROM sequentially...Done...
    Catch an interrupt every 8 bits to grab byte data from the SPI...
    Catch every other interrupt after grabbing 2 bytes to send the 2 bytes out to the DAC.
    Is this going to be a serial DAC or a parallel DAC? 16 bit DAC or 8 bit DAC?
    Serial DAC...well, your SPI is already tied up grabbing data from the EEPROM, unless you're using a large PIC with 2 SPI modules. So, do you have enough PIC cycles left over to shift that data in and/or out using the firmware? Using Shiftin and/or Shiftout, you aren't going to have a lot of cycles leftover for much at all.
    Parallel DAC...Your SPI is still tied up grabbing data from the EEPROM. Do you have enough pins left over to pump parallel data out to the DAC (at minimum a 28 pin PIC with practically no pins leftover to do anything)? Not to mention enough cycles left over to process any other inputs/outputs that your project requires?
    I would like to have a sound project based on Norm's project which is great although I didn't test it yet.
    I will not use my main pic to handle the job. I will use a dedicated pic to manage the EEPROM->PIC->DAC work. Only one pin of my main MCU will trigger the sound play.
    I intend to use a 16 bits serial DAC with a PIC18F452 and a 10MHz Crystal.
    I think that sending a 88KB sound file from the eeprom to the DAC is manageable as Norm already did it (with a M25P32 SPI memory at 50MHz). I will try to use 25AA1024 1Mbit 20MHz microchip memory (I say 'try' because I have to calculate to check if, as you say, I will have enough cycles to perform the all the transfers).
    I NEVER used SPI and I even don't know how to program the routines. In hardware mode it sounds easier but it is still hazy. I will read Microchip Application Notes and code sample and read Norm's code. I have to make routines as I didn't find dedicated functions in PBP.
    It would of course be easier to use Norm's project 'as is' but I would like to create my own application and as I want to use it in a 'commercial' application, I can't just use someone else's work.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. newbe looking for PIC advice
    By Mad Professor in forum General
    Replies: 3
    Last Post: - 27th May 2009, 07:56
  3. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  4. AT keyboard interfaced to a PIC
    By languer in forum Schematics
    Replies: 2
    Last Post: - 28th December 2005, 05:11
  5. Battery Backup with PIC controlling switch
    By Dwayne in forum Schematics
    Replies: 1
    Last Post: - 27th December 2003, 13:16

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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