adafruit / ArduinoCore-samd

115 stars 119 forks source link

Tone() not working on SAMD51 #255

Closed RAyWB closed 4 years ago

RAyWB commented 4 years ago

Just tried to use Tone() to generate a simple square signal, but nothing happens. tried several boards , itsybitsyM4 , GrandCentral ,MetroM4 ,same situation.

think it should work just using:

void setup() { pinMode(9,OUTPUT); }

void loop() { tone(9,1000,20000); noTone(9); }

to generate 1 KHz square signal on pin9 for 20 seconds.

can you please check what´s wrong?

ladyada commented 4 years ago

hi can you try older versions of the board support package, and tell us wher eit stopped working? that would help figure out what happened that made it stop :)

RAyWB commented 4 years ago

Hi , it stopped working on change from 1.5.3 to 1.5.4 1.5.3 works

ladyada commented 4 years ago

ok thanks @hathach can you maybe look?

RAyWB commented 4 years ago

seems not to be related on tone.cpp , copying tone.cpp from 1.5.3 to newer version doesn´t help. sorry for no more ideas as I´m not a pro in coding.

hathach commented 4 years ago

Thanks for reporting the issue, I will try to check this out as soon as I could

hathach commented 4 years ago

I confirmed the issue on SAMD51, it even seem to cause the MCU to be hanged as well somehow. Looking into it now.

Hi , it stopped working on change from 1.5.3 to 1.5.4 1.5.3 works

Update: Thank to your report, I am able to narrow it down to a single commit, will try to fix it asap.

RAyWB commented 4 years ago

Thanks for taking care of this issue

hathach commented 4 years ago

@RAyWB PR #257 should fix this issue, please try it out and let's us know your result.

RAyWB commented 4 years ago

Tone() checked on GrandCentral and ItsyBitsyM4 , works ! Thanks for fixing that issue