Hey!
I need generate PWM frequency around 1.5MHz, but cannot make more than 186kHz.
Any advice please?
Thank a lot!
Code:
uint8_t ledPin = PA0;
int freq = 186000; // working fine
//int freq = 200000; // doesn't work
//int freq = 1500000; // doesn't work too
void setup()
{
Serial.begin(115200);
delay(2000);
tone(ledPin, freq);
}
void loop()
{
tone(ledPin, freq);
delay(5000);
noTone(ledPin);
delay(5000);
}