Slow Clock External Crystal is Not Used - BUG

m3741:
Actually, if you look at the function pmc_switch_sclk_to_32kxtal() in hardware/arduino/sam/system/libsam/source/pmc.c it does the exact same thing as the code you listed above. Since your answer is duplicating work, I fail to see how it is simpler.

When I first tried your suggestion, I put the function in the point you suggested in your first post, and it didn't work. So, I read the datasheet and found the register & bit that enabled the external clock and used it. It was "simpler" for me instead of looking the whole core trying to find what that piece of code did :wink:

You are very correct that I was not waiting for the chip to complete the change. It did work fine for me without waiting for that bit

I agree. It can work (it worked fine for me too) but the datasheet "suggests" to wait the change so I think it's better if we "follow" that suggestion :sweat_smile:

Thanks!

You're welcome :open_mouth: