Home Forums Sparkfun MP3 Shield Library Support Forum Error 4, SCI_Mode (0x4800) = 0x800

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2723
    Anonymous
    Inactive

    Hi,

    I try to use the SFEMP3Shield Library without a Sparkfun MP3 shield…  What I have is a SD card module and a VS1053 breakout module purchased from eBay (I use 74HC125 chips to lower voltages from the Arduino Uno to 3.3 V).  I managed to make it work without the SFEMP3Shield Library, but the sketch I used was  not easy to understand.

    So I used the schematic from Sparkfun to connect the VS1053 module to the correct Arduino pins (DREQ to pin 2, XCS to pin 6, XDCS to pin 7, XRST to pin 8, XCS to pin 9…) and tried the library.

    With the MP3Shield_Library_Demo, I get “Error code: 4 when trying to start MP3 player”.  I’m able to play the mp3 files, but they play very slow (maybe half the normal speed).

    Error code 4 means unexpected value in the SCI_MODE register.   I uncommented a few lines in the library and got this in the Serial Monitor:

    “SCI_Mode (0x4800) = 0x800”

    Any idea about what I could try next?

    Thanks

    Yves

    #2724

    Your return is from ” if(MP3Mode != (SM_LINE1 | SM_SDINEW)) return 4;” which would have expected 4800. where the SM_LINE1 was not set. as detailed in the manual. http://mpflaga.github.io/Sparkfun-MP3-Player-Shield-Arduino-Library/_s_f_e_m_p3_shield_8h.html#ad452717cdf9bf458c30cd20c1e78d719

    That all said. this is typical of when the device is not communicating correctly. That in conjunction with your slow observation, suggests your breakout board has a slower clock. Causing the slow play and difficulty in reading back data from the chip. The SFEMP3shield uses a 12.288MgHz crystal. Perhaps your shield is less.

    #2725
    Anonymous
    Inactive

    I simply commented out the line “if(MP3Mode != (SM_LINE1 | SM_SDINEW)) return 4;” in the library,  so now vs_init() is not interrupted by the code 4 error anymore.

    And it works perfectly! 🙂

    The slow music was caused by the clock multiplier not set to 3X during the vs1053 initialisation.

    Thanks!

     

    #3058
    Anonymous
    Inactive

    Arduino Mega2560/MP3 VS1053 breakout

    I have had exactly the same symptoms of slow playing when using the sketch, and like the previous user, editing out the “if(MP3Mode !=” etc    in the shield.cpp file in library made mine also apparently work fine when using the “file player” sketch example.

    The sine wave test also seems to work even when getting the error 4 so it looks like Arduino is communicating

    The crystal on breakout board is marked 12.288 so it seems clock frequency is correct

    I note that a “memory test” result shows a value of; 807f whereas next line says value should be; 0x83ff.

     

    Is this significant, does it give a clue to the reason we don’t get the correct 0x4800 response causing the error 4 code.

    Like the previous user, my system seems to work ok with this test sketch (with line edited out), but, I am having problems in my actual application where selecting a track most times works, but sometimes it results in a re-occurrence  of slow playing followed by a complete lock up requiring a reset or power removal/re application. I have changed all parts to verify it is not a hardware issue and the fact it basically works says that the fundamental connections are OK and I am using level shifters on all data lines.

    Why would a VS1053 play, but at around half speed on some occasions (maybe 1 in a 100 selctions) and then fail to respond to further commands without a reset.

    Can anyone throw light on why the original test sketch requires editing to overcome the error 4, could this also be the root cause of my intermittent slow play/lock up in my application when using SFEMP3Shield even though it seems to work on test sketch using serial monitor for command.

    All I am doing is selecting SD card MP3 tracks from a keypad to play, and displaying related SD card MP3 data on 2004 I2C LCD display

    Thanks for any help/suggestions, I have run out of ideas.

    Alan

    #3227
    Anonymous
    Inactive

    Hi everyone !

    My problem is similar to ypelletier’s : I have a wrong MP3_MODE value when I try to run FileReader example.

    I have an Arduino mega2560, connected to a SD shield and a VS1053 shield.

     

    Here is the  output :

    XCS_PIN= 35
    SD_SEL_PIN= 47

    MP3_DREQINT 0
    F_CPU = 16000000
    Free RAM = 6669 Should be a base line of 1017, on ATmega328 when using INTx

    SCI_Mode (0x4800) = 0x4890
    SCI_Status (0x48) = 0x48
    SCI_ClockF = 0x0
    Error code: 4 when trying to start MP3 player

     

    DREQ is 2 and DREQINT is 0, which seems to  matches with arduino documentation:

    Board       Mega2560
    int.0                 2
    int.1                3
    int.2                21
    int.3                20
    int.4                19
    int.5                 18

    <td align=”left”>Mega2560</td>
    <td align=”center”>2</td>
    <td align=”center”>3</td>
    <td align=”center”>21</td>
    <td align=”center”>20</td>
    <td align=”center”>19</td>
    <td align=”center”>18</td>
    </tr>
    <tr>
    <td align=”left”>Leonardo</td>
    <td align=”center”>3</td>
    <td align=”center”>2</td>
    <td align=”center”>0</td>
    <td align=”center”>1</td>
    <td align=”center”>7</td>
    <td></td>
    </tr>
    </tbody>
    </table>
    Here are my links configuration:

    #define MP3_XCS              35 //Control Chip Select Pin (for accessing SPI Control/Status registers)
    #define MP3_XDCS             34 //Data Chip Select / BSYNC Pin
    #define MP3_DREQ             2 //Data Request Pin: Player asks for more data
    #if defined(__AVR_ATmega32U4__)
    #define MP3_DREQINT          1 //Corresponding INTx for DREQ pin
    #else // swapped between Uno and Leonardo.
    #define MP3_DREQINT          0 //Corresponding INTx for DREQ pin
    #define MP3_RESET            36 //Reset is active low
    #define SD_SEL               47 //select pin for SD card

     

    I know my SD card is OK because I can run SDFat librarie’s examples code.

    I think that my audio out to speakers is OK because they emit “buzzz” noize while I transfer code to arduino.

    I also tried to comment the line :

    if(MP3Mode != (SM_LINE1 | SM_SDINEW)) return 4;

    The sketch run but I can’t read mp3 files ( I can change the volume, list files on SD card )

    I don’t understand what is going on. I shearched in VS1053 datasheet what could mean the value 4890 => 1001 0001 0010 0000

    The wrong 1 corresponds to SM_SDISHARE, that’s all I can say.

    Does someone  as an idea ?

    Thanks a lot !

     

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.