element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Design for a Cause - Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Design for a Cause - Design Challenge
  • More
  • Cancel
Design for a Cause - Design Challenge
Blog Connection Issues
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: roborob1266
  • Date Created: 10 Aug 2018 2:37 AM Date Created
  • Views 3593 views
  • Likes 6 likes
  • Comments 20 comments
  • arduino mkr1000
  • issues
  • wiring
  • adafruit vs1053 mp3 player
  • 5" touch screen
  • design for a cause - design challenge
  • adafruit ra8875
Related
Recommended

Connection Issues

roborob1266
roborob1266
10 Aug 2018

image

Hello everyone. I was able to get the Adafruit RA8875 to work with the MKR1000.

I was recently able to get the VS1053 (Adafruit Music Maker MP3 Shield) to work with the MKR1000.

The issue is when I connect them together with the MKR1000, I cannot get the MP3 shield to work.
It is not detected with the wiring I am selecting.
I am using hardware SPI so SCK, MISO and MOSI are being used.This is the wiring I am using for the RA module, MP3 Module and the MKR.

I know that the MKR has pins 0 and 1 as the interrupt pins and switching between those doesn't work.

Since I am using the breakout portion of the MP3 player, that is why I connected it to the MKR and it worked.

 

VS1053MKR1000
5V5V
GNDGND
Breakout ResetReset
SCK139
MISO1210
MOSI118
MCS71
DCS65
CardSC44
DRQ30
RA8875MKR1000
5V5V
GNDGND
SCKSCK9
MISOMISO10
MOSIMOSI8
CSCS6
RST2
INTINT3

 

Once I am able to make these all play nicely then I will be able to use the image files and place them on the screen and then learn now to trigger a touch to play the appropriate wav file.

This challenge has really taught me the value of research, which forums do not help at all and trial and error will get you results in the end! It didn't stop Thomas Edison from inventing the light bulb after thousands of tries, it wont stop me either!

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 6 years ago +5
    Hi Rob, If you're developing approximately what I think you're developing, it is really good news. I too am on the side working on a project for autistic children. Quite surprising how little easy-to-make…
  • aspork42
    aspork42 over 6 years ago +4
    Does the VS1053 have a pin labeled just as "CS"? When I look on Adafruit, I see a different looking board than what you have, but it does show a "CS" pin. This is the "select" pin that the master (MKR1000…
  • prashanth.nagendrappa
    prashanth.nagendrappa over 6 years ago +3
    Nice Update Keep going roborob1266
Parents
  • aspork42
    aspork42 over 6 years ago

    Does the VS1053 have a pin labeled just as "CS"? When I look on Adafruit, I see a different looking board than what you have, but it does show a "CS" pin. This is the "select" pin that the master (MKR1000) uses to tell the slave to listen. Each slave must have its own "Chip Select" pin that cannot be shared. (Also call "slave select" or something similar.)

     

    image

     

    The next thing - How are you 'disconnecting' one or the other when you test? Just removing power or removing all wiring? And is all other wiring the same when the they work individually versus all wired in at ones?

    In theory you should be able to have both all wired in, and run a test sketch one time for each board, just modifying the header info for the correct pinout. I would think that just removing power from the slave should effectively disable it so you can test the other board.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to aspork42

    It's not very clear but looks like the pins labelled MCS and DCS here: https://learn.adafruit.com/assets/16643

    go to XCS and XDCS pins in that order, on the VS1053 chip according to the circuit diag here: https://cdn-learn.adafruit.com/assets/assets/000/016/642/original/adafruit_products_schem.png?1400269761

     

    It seems the XCS pin is the chip select for the SPI interface? (chip datasheet: https://www.sparkfun.com/datasheets/Components/SMD/vs1053.pdf  )

    Rob, how are you confirming that the MP3 shield is not detected? If you've not got a 'scope, you can use an LED and a resistor (e.g. 220 ohms) on the CS pin (i.e. MCS I think) to see if it stays permanently lit, or if it briefly flickers to off.

    Also, could it be a supply issue? The display and MP3 shield combined may use more power than expected. Are you running this from USB?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to roborob1266

    Hi Rob,

     

    When the microcontroller is acting as a Master, then it's up to the slave devices (i.e. the VS1053 and RA8875 boards) to perform the tri-state operation, not the MKR board.

     

    The MKR board just needs to instruct (by pulling the relevant CS line high) the slave devices to go tri-state on their MISO line. This is why it would be good to closely examine what is happening on your CS lines for the two devices. If the CS lines for both devices are simultaneously low, then that's a very bad thing.

     

    The thing is, you don't need any SPI driver interaction to correctly control CS lines. You can define any connection on the MKR board to act as an output pin, and then write code (i.e. DigitalWrite) to pull the CS lines high or low under your own command, provided you put it at the correct location. It could well be the case that threads are executing that are pulling both CS lines low, That is not a MKR board issue, but could be a software or software driver issue.

     

    This is all speculation though, and a way through this is to check the CS lines using the methods mentioned (ideally oscilloscope, or using LEDs).

    A tri-state buffer chip could be used, but to me it sounds superfluous, unless there is some device-level reason why either of the devices is not going tri-state.

     

    I don't know what the code looks like, but if you're executing a write to the display, it could be worth inserting a delay after that as a test, so that if the display is written in a different thread (I've never used the MKR board, I'm just guessing) then that thread has some time to complete before sending data to the VS chip.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • roborob1266
    roborob1266 over 6 years ago in reply to shabaz

    Hello,

    All I do is connect the RA8875 and the VS1053 to the MKR board and power it on and neither of them work even before I run any sketches.

    I will try the LED process to see what is going on with the CS lines.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to roborob1266

    Hi Rob,

     

    I had some questions:

     

    (a) How do you confirm neither work before any sketches are run?

    Are you observing power on LEDs or something?

     

    (b) If you've got a way to confirm without running any sketch, what happens if you just disconnect the MISO line from one of the devices? Do the devices reach the failed state still, or remain in the working state? (prior to running the sketch, which of course will fail for one of the devices at least, since the MISO line is disconnected).

     

    (c) What happens if you only connect one device fully, and only connect the power connections of the other device? Does one device work prior to running the sketch?

     

    (d) What happens if, in scenario (c), you run the sketch?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • roborob1266
    roborob1266 over 6 years ago in reply to shabaz

    Hello Shabaz,

    I connected LED's with 220 ohm resistors and here is what happened:

    1. With the RA8875 connected only, the CS LED would blink when powered on then it was low. When I touched the screen where the buttons were, the LED would brighten up as expected.

    2. I connected the VS1053 with the RA8875 connected and added LED's for the board CS as well as the CS for the SD card.

         - The LED for the VS1053 board CS (MCS) would remain low the entire time.

         - The LED for the SD Card (DCS) would remain high the entire time.

         - The LED for the RA8875 would stay unlit the entire time (this is expected since the RA sketch is not running).

     

    It seems as if the CS for the SD card is causing the systems to not play well together. Its staying high the entire time no matter which pin I plug it in and run the sketch.

    If I run the Video sketch while everything is connected, the LCD will display the buttons but the VS1053 wont play the last audio files in memory like it does when I connect it stand alone on the MKR1000.

    Since the MCS LED is low, I am taking it that this is normal until something is needed to be executed.

    Since the DCS LED is high, I am taking it that this is not a normal situation. Again, this happens no matter which Pin I used. I even tried using an analog pin and the serial monitor asked if the SD card was connected.

    With the LEDs in place, I will disconnect the RA8875 from the MKR and run the audio sketch again to see what could be causing the issues.

    I will try with just disconnecting the power from the RA8875 first to see what that does.

     

    Thanks again for the suggestions!

    I am trying all that you are suggesting to see.

    Hope my info helps... 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to roborob1266

    Hi Rob,

     

    I'm not sure where the LEDs are connected (to ground, or to +ve, or across CS pins) so the information doesn't help me, but I think you've got the right idea, to use LEDs to examine the state of the CS pins if you don't have access to a 'scope.

     

    The LED info isn't as meaningful until the sketch is run, because the CS pins are under the control of the MKR board and not the slave devices.

     

    Also, I didn't understand your earlier text:

    Hello,

    All I do is connect the RA8875 and the VS1053 to the MKR board and power it on and neither of them work even before I run any sketches.

     

    and I asked some questions related to it, specifically:

    (a) How do you confirm neither work before any sketches are run?

    Are you observing power on LEDs or something?

     

    Anyway, to get to the bottom of this, I believe you just need to to confirm you have sufficient power, then observe what the CS pins do, and this should provide enough information to troubleshoot.

     

    At some stage you may need to insert delays in the code and slowly see when the CS lines are asserted and deasserted, and see if it matches with what you expect.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • shabaz
    shabaz over 6 years ago in reply to roborob1266

    Hi Rob,

     

    I'm not sure where the LEDs are connected (to ground, or to +ve, or across CS pins) so the information doesn't help me, but I think you've got the right idea, to use LEDs to examine the state of the CS pins if you don't have access to a 'scope.

     

    The LED info isn't as meaningful until the sketch is run, because the CS pins are under the control of the MKR board and not the slave devices.

     

    Also, I didn't understand your earlier text:

    Hello,

    All I do is connect the RA8875 and the VS1053 to the MKR board and power it on and neither of them work even before I run any sketches.

     

    and I asked some questions related to it, specifically:

    (a) How do you confirm neither work before any sketches are run?

    Are you observing power on LEDs or something?

     

    Anyway, to get to the bottom of this, I believe you just need to to confirm you have sufficient power, then observe what the CS pins do, and this should provide enough information to troubleshoot.

     

    At some stage you may need to insert delays in the code and slowly see when the CS lines are asserted and deasserted, and see if it matches with what you expect.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • roborob1266
    roborob1266 over 6 years ago in reply to shabaz

    Hi Shabaz,

    I have the LED's connected to ground on on the MKR and also across the CS pins for the RA8875, VS1053 and the SD card on the VS1053.

    When the system powers on, the LED for the RA8875 goes high while the images are appearing on the screen. Then it goes lower meaning that there is some light bit very dim. This is a good thing and when I touch the screen, the LED goes high because of the touch triggers. This is also a good thing.

     

    Now I have all the wiring connected to both the VS1053 to the MKR and the RA8875.

    The code for the video is working fine and I commented out all the code for the VS1053.

     

    One at a time I am removing the // from the code line by line for the VS1053 to see what is causing the SD CS pin to go high.

     

    With the RA8875 working as it should, I added the SPI wires for the VS1053 and power then ran my code and removed the // from the other pin settings for the code.

     

    Here is where I am at with the code, removing the // from each line at a time and watching out for the SD CS pin to go high and stay high preventing everything from working.

    I will let you know what I find out.

    Here is the code for the VS1053 that worked before:

     

    // These are the pins used for the breakout example

    #define BREAKOUT_RESET  9      // VS1053 reset pin (output)

    #define BREAKOUT_CS     A4     // VS1053 chip select pin (output)

    #define BREAKOUT_DCS    A5      // VS1053 Data/command select pin (output)

    // These are the pins used for the music maker shield

    #define SHIELD_RESET  9      // VS1053 reset pin (unused!)

    #define SHIELD_CS     A4      // VS1053 MCS - chip select pin (output)

    #define SHIELD_DCS    A5      // VS1053 DCS - data select pin (output)

     

     

    // These are common pins between breakout and shield

    #define CARDCS 4     // VS1053 CCS - Card chip select pin

    // DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt

    #define DREQ 0       // VS1053 DREQ - Data request, ideally an Interrupt pin

     

    Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RESET);

    Adafruit_VS1053_FilePlayer musicPlayer = Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • roborob1266
    roborob1266 over 6 years ago in reply to shabaz

    Hello Shabaz

    I went through the code un-commenting each line and testing it by executing the code and when I came to this part of the code, the LED for the MCS went high and the RA8875 LED CS pin went high as well.

    /* initialize the music player */

      if (! musicPlayer.begin()) {

        Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));

        while (1);

     

    The RA8875 initializes and the LED goes high and low as the touch screen portion runs and then goes back to dim.

    When it is time for the VS1053 to initialize, it does not happen. The LED PIN for the MCS goes high and the CS for the RA8875 goes high and everything stops.

     

    I get the message about having the correct pins and even when I change the MCS pin to another area of the MKR, update the code to reflect that pin, it still goes high when it tries to initialize and stays high which causes the RA8875 CS to stay high as well and nothing works.

     

    I have also tried analog pins and it does the same thing.

    If I comment out the above code and all the music player code after that, reset the MKR1000, then the display works fine and the touch buttons work.

    It is when I remove the comment (//) that the code messes up.

     

    void setup()

    {

      Serial.begin(9600);

      Serial.println(F("RA8875 start"));

      Serial.println(F("VS1053 start"));

      Serial.println(F("SD start"));

     

     

      /* Initialise the display using 'RA8875_800x480' */

      if (!tft.begin(RA8875_800x480)) {

        Serial.println(F("RA8875 Not Found!"));

        while (1);

      }

      Serial.println(F("RA8875 Found"));

     

      /* initialize the music player */

      if (! musicPlayer.begin()) {

        Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));

        while (1);

    }

      Serial.println(F("VS1053 found"));

     

      musicPlayer.sineTest(0x44, 500);    // Makes a tone to indicate VS1053 is working

     

      if (!SD.begin(CARDCS)) {

        Serial.println(F("SD failed, or not present"));

       while (1);  // don't do anything more

      }

       Serial.println(F("SD Found"));

     

    Now if I connect each of these devices separately from each other to the MKR device, the work fine. It is just when these two devices are connected together that there is a conflict even when they are not using the same pins. The only pins that are the same for both are the SPI pins.

     

    I am at a loss at what to do next.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to roborob1266

    Hi Rob,

     

    At least it is isolated to a single function call, it should be possible to examine the source code for that function, to see what is going on. Basically, you may need to make edits to the driver code. I'm not a frequent Arduino user so I can only help generally, not specifically unfortunately, but if you have access to the library code (i.e. if it isn't a compiled library which you cannot modify) then that would be the place to look.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • aspork42
    aspork42 over 6 years ago in reply to shabaz

    Rob - what power supply are you using? Is it just plugging into a computer or using a wall-wart? Do you know how may amps (or milliamps) the supply is rated for?

     

    Your code looks like it just stops when it fails to connect via the "while(1);" line; so that could be the reason why things stop functioning after that point. The code just goes into an infinite loop until the controller is power cycled.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • roborob1266
    roborob1266 over 6 years ago in reply to aspork42

    Hi James,

    I am using the USB cable. Perhaps the MKR1000 unit does not provide as much power as the UNO.

    The sketches work fine on the UNO when the RA8875 and VS1053 are connected to the UNO.

     

    I ordered and will be receiving a battery that will connect to the MKR1000 to see if that helps with the power issue and will check voltages today to see if that could be the problem.

     

    Thanks for your input!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube