I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are generated on INT4 and INT5 and it all seems to work fine.

When I want to test my program I press the RESET button on the Arduino in order to start the program. However, sometimes the program only starts after pressing the RESET button multiple times. This happens often but not all the time, which is weird.

What do you think could be the reason for this?

  • \$\begingroup\$ Faulty RESET button? How do you know when your program has or has not started? \$\endgroup\$ – Steve G Jun 12 '19 at 11:22
  • \$\begingroup\$ @Steve G It might have started, idk. However, the MP3 player only lights up after pressing the RESET button on the Arduino multiple times. NOTE that I programmed the Arduino to start playing the first song automatically without any external interrupt, so this shouldn't have anything to do with the interrupts. \$\endgroup\$ – user164324 Jun 12 '19 at 11:31
  • \$\begingroup\$ Does the MEGA2560 have an LED that you could blink on startup? Just to show that it has started. I suspect that the problem is with the comms to the MP3 player, or perhaps the MP3 player is in the wrong mode to accept commands. \$\endgroup\$ – Steve G Jun 12 '19 at 11:55
  • \$\begingroup\$ During reset if the UART lines drop, and you do not have enough of a delay, the MP3 player may see the first song as an error. \$\endgroup\$ – MadHatter Jun 12 '19 at 12:06
  • 1
    \$\begingroup\$ Perhaps this should be migrated to Arduino.SE? \$\endgroup\$ – Dmitry Grigoryev Jun 12 '19 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.