I posted this earlier but apparently not very clearly so trying again. I am using a PWM output from an Arduino Zero to run a PID heater controller. But the default PWM frequency (pin 9) is about 190 KHz which is far too fast for my application (I need about 500 Hz or lower).
I have found many forum posts on how to change the PWM frequencies by changing the timer divisors, but can't get any of these to work because the variables used (eg. TCCR1B) are not recognized by the compiler and apparently need some specific .H file (which none of the examples describe).
Does anyone know how to lower the default PWM frequency for the Arduino Zero? Or how to get the definitions for the timer variables like TCCR1B to be recognized by the compiler? If the line of code at the bottom of the description below (from Arduino Playground - TimerPWMCheatsheet) is all that is needed, then I just need to know what .H file to include (or library, or ??) so that TCCR1B is recognized by the compiler (for Arduino Zero).
Pins 9 and 10: controlled by timer 1 in phase-correct PWM mode (cycle length = 510)
Setting Divisor Frequency
0x01 1 31372.55
0x02 8 3921.16
0x03 64 490.20 <--DEFAULT
0x04 256 122.55
0x05 1024 30.64
TCCR1B = (TCCR1B & 0b11111000) | ;
Is the "Zero" somehow not compatible with this approach? Thanks for any input.