0

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?

  • Does keeping the RESET button pressed for at least 1 second change the behavior? – frarugi87 Jun 12 at 13:56
  • 2
    Are you using Serial inside the interrupt handlers? – Majenko Jun 12 at 15:04
  • What causes the signals to switch on INT4 & 5? Normally, one would have the pins connect to Gnd when a button is pressed, and the lines are held high when not pressed by a Pullup resistor, typically the internal pullup is enough. For long wires, an external pullup may be needed. – CrossRoads Jun 12 at 16:02
  • @CrossRoads I have two sensors (one for INT4 and one for INT5). When the sensors are turned on, they send 5V on the output. I measured the output with a scope and it works. – user164324 Jun 13 at 10:12

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.