+ Reply to Thread
Results 1 to 7 of 7

Thread: Les's wav player& sd library

  1. #1
    Licensed User bugi's Avatar
    Join Date
    Aug 2011
    Location
    Istanbul
    Posts
    56

    Default Les's wav player& sd library

    Hi,


    I want to use Les's wav player and Proton SD Library (without wav player.inc)

    I've tried for several times but it doesn't work.

    Is it difficult, easy or impossible?

    I used some codes from the inc files but I don't want to use other fat16 routines.
    I will use this player as part of my project.

    Hi, its great to see you visiting our forum. Why not try Proton Compiler for FREE?

    Download the FREE version of Proton Compiler, Its called Amicus18 and its available from HERE

    Already using proton Compiler??? Get rid of these pesky messages... get LICENSED USER STATUS




    If I can't do this, I have to make a sound module with this wav player + smd pic + micro SD and I using USART like an ISD chip.



    Dear Les, Could you please give me an advice? I will be very happy.




    Regards.

    Bugra


  2. If you're a Licensed user of PROTON DEVELOPMENT SUITE, apply for Licensed User Status to remove these pesky messages
     and get access to additional forum areas, Beta test downloads and more!

  3. #2
    Administrator-01 Lester's Avatar
    Join Date
    Jan 2002
    Location
    Google Earth - CB6 3PZ
    Posts
    1,437


    Default Re: Les's wav player& sd library

    Its going to be very difficult for any user to offer you any support, if you do not give a clear explanation of the problem.

    with examples of the code that you are using that is causing the issue.
    Lester Wilson
    ---------------------------------
    Crownhill Associates Limited
    www.crownhill.co.uk
    Tel: +44 1353 749990
    Fax: +44 1353 749991
    lester@crownhill.co.uk
    ----------------------------------

  4. #3
    Licensed User bugi's Avatar
    Join Date
    Aug 2011
    Location
    Istanbul
    Posts
    56


    Default Re: Les's wav player& sd library

    Dear Lester,

    Thank you for your reply.

    I'm going to explain as best I can.

    I want to receive bytes from the Sd library by S.Wright. So I don't use Les's Include file. I know that I'm doing something wrong but I couldn't find the correct place for load the bytes which I receive from the SD card. Les's rouitines very proffesional and complex. I don't want to sabotage His wonderful codes like this but Les and Swright Fat 16 routines don't work together at he same pic due to the Fat init methode I think. I need a player and sd library for pictures.

    Note: I couldn't init sd card with Les's wav player.inc with 64 Mhz.

    This is my mixed code example. I want to received bytes and load the correct place for buffers. I know that this is not easy like this, so I need some help if it's possible. Otherwise I have to find
    another solution.

    Thanks&Regards.


    Bugra.
    Attached Files Attached Files

  5. #4


    Default Re: Les's wav player& sd library

    64MHz is too fast for SD initialisation with the codes supplied. You'll need to slow down the SPI interface to below 600KHz for this, then speed it up once the SD has initialised correctly.

    Note also that most of the 18F K devices have a fatal flaw in their MSSP module, in that they do not work at higher speeds. for example FOSC/4 (i.e. 64/4). 16MHz is just too fast and they do not have a flexible prescaler. If you examine the SPI transfer on a logic analyser, you'll see bits missing.
    Regards
    Les

  6. #5
    Licensed User bugi's Avatar
    Join Date
    Aug 2011
    Location
    Istanbul
    Posts
    56


    Default Re: Les's wav player& sd library

    Dear Les,

    Thank you very much for your help.

    Today 18F46K20 works 64 Mhz and FOSC/4 on the new circuit with SD lib. I use color glcd and print a lot of pictures.
    But I can not see any different FOSC/16 and FOSC/4. I think both of are loading pictures the same speed. I'll try with 18F26K20.

    In this case, there is a problem in these micros due to Microchip. I'm so worry now, I would like to use this micros but now
    I don't trust it.

    Thanks&Best Regards

    Bugra

  7. #6
    Licensed User bugi's Avatar
    Join Date
    Aug 2011
    Location
    Istanbul
    Posts
    56


    Default Re: Les's wav player& sd library

    Hi,

    Now I have finished my new wav player.

    It can play up to 44 khz with a simple routine and SD Library by S.Wright.

    I use two buffers with 256 bytes array and portb as a dac. It can play lower sample rates also 128x2 or 64x2 aray buffers.


    Otherwise It can play 22khz sample rates or lower with PWM. I use LES's a pieces of routine for pwm. I load the bytes from Sd card into INDF2 register. But I don't know this is a right methode exactly. Because I hear a little bit rustle while plays music. LES's player is more clearly than me. But first methode (with r/2r) is super quality for amateur player.

    I lived an important problem with "reserved ram" First time I used 512x2 buffer. But when I played music, sound was teribble. I cotrolled my routine very hard and finally I saw that I couldn't have used all of the 512 bytes arrays. It has been playing only 256 bytes and the other bytes lost. I couldn't find how I can use all of these bytes.


    Reserve_RAM 1024
    Dim SECTOR_BUFFER1[512] As Byte At __START_OF_RESERVE_RAM
    Dim SECTOR_BUFFER2[512] As Byte At __START_OF_RESERVE_RAM + 512

    But arrays work first 256 bytes I don't know where are the other 256 bytes going

    I used these registers written by Les:


    CCP1CON
    = CCP1CON & %11001111
    WREG = INDF2 << 4
    WREG = WREG & %00110000
    CCP1CON = CCP1CON | WREG
    CCPR1L = INDF2 >> 2
    and I put bytes serially into the INDF2 from buffers. Is this right?



    Thanks&Regards

    Bugra

  8. #7


    1 members found this post helpful.

    Default Re: Les's wav player& sd library

    When using large arrays. i.e over 256 elements. You will need to access them indirectly using either the FSR0L\H or FSR1L\H or FSR2L\H registers and INDF0, POSTINC0 registers etc...

    This is also the most efficient method of using RAM buffers, and without it, the code will take precious time re-calculating the index of the array every time it accesses it.

    The method I used within the interrupt is two arrays of 512 bytes each (1 sector), working as a double buffer. I think I chose INDF2 because it is only ever used by the compiler when a stack is created and Push or Pop is used, thus allowing me a little more time saving in not having to context save or restore the register pair FSR2L\H.

    The double buffer was required in order to remove the time delay between accessing the bytes of audio via the FAT16 calculation. While the FAT16 calculations is filling one buffer, the other is being played and vice-versa.
    Last edited by Les; 31st January 2012 at 11:49.
    Regards
    Les

+ Reply to Thread

Similar Threads

  1. Les's wav player
    By bugi in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 27th November 2011, 21:49
  2. Help: Les's RGB Dimmer code.
    By CharlieBrown in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 9th July 2009, 18:47
  3. Les's ghost
    By fanie in forum The Lounge
    Replies: 6
    Last Post: 11th March 2008, 09:46
  4. Questions about Les's WAV player
    By rcurl in forum Proton Plus Compiler v3
    Replies: 53
    Last Post: 1st March 2007, 22:05
  5. Les's little friends
    By Mark Rodgers in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 11th June 2005, 08:33

Members who have read this thread : 62

Actions :  (Set Date)

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