Had a really good look around but am a bit confused at how to change the PWM frequency on D11.
I plan on using my spare arduino nano on eleks mana se breakout board to control a NUBM08 driven by a BlackBuck 8m 8A driver. The driver accepts PWM inputs with 4Khz modulation.
D11 should be on timer 2. TCCR2B
Table of possibilities
//TCCR2B = TCCR2B & B11111000 | B00000001; // set timer 2 divisor to 1 for PWM frequency of 31372.55 Hz
//TCCR2B = TCCR2B & B11111000 | B00000010; // set timer 2 divisor to 8 for PWM frequency of 3921.16 Hz
//TCCR2B = TCCR2B & B11111000 | B00000011; // set timer 2 divisor to 32 for PWM frequency of 980.39 Hz
TCCR2B = TCCR2B & B11111000 | B00000100; // set timer 2 divisor to 64 for PWM frequency of 490.20 Hz (The DEFAULT)
//TCCR2B = TCCR2B & B11111000 | B00000101; // set timer 2 divisor to 128 for PWM frequency of 245.10 Hz
//TCCR2B = TCCR2B & B11111000 | B00000110; // set timer 2 divisor to 256 for PWM frequency of 122.55 Hz
//TCCR2B = TCCR2B & B11111000 | B00000111; // set timer 2 divisor to 1024 for PWM frequency of 30.64 Hz
Some advice I came across said that GRBL can be compiled to use 3.92KHZ PWM.
It mentioned setting disabling fast PWM and then prescaler to 8, then setting the times for the phase correct PWM.
From this I take it comment out
#define SPINDLE_TCCRA_INIT_MASK ((1<<WGM20) | (1<<WGM21)) // Configures fast PWM mode.
Hi,
Had a really good look around but am a bit confused at how to change the PWM frequency on D11. I plan on using my spare arduino nano on eleks mana se breakout board to control a NUBM08 driven by a BlackBuck 8m 8A driver. The driver accepts PWM inputs with 4Khz modulation.
D11 should be on timer 2. TCCR2B Table of possibilities
In the CPU_MAP.H file I can only see
Some advice I came across said that GRBL can be compiled to use 3.92KHZ PWM. It mentioned setting disabling fast PWM and then prescaler to 8, then setting the times for the phase correct PWM.
From this I take it comment out
#define SPINDLE_TCCRA_INIT_MASK ((1<<WGM20) | (1<<WGM21)) // Configures fast PWM mode.
enable this:
// #define SPINDLE_TCCRB_INIT_MASK (1<<CS21) // 1/8 prescaler -> 7.8kHz (Used in v0.9)
Am I correct in my thinking? this should give me a PWM frequency of 3.92?