|
@@ -549,18 +549,21 @@
|
549
|
549
|
//#define FAN_MAX_PWM 128
|
550
|
550
|
|
551
|
551
|
/**
|
552
|
|
- * FAST PWM FAN Settings
|
|
552
|
+ * Fan Fast PWM
|
553
|
553
|
*
|
554
|
|
- * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h)
|
555
|
|
- * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a
|
556
|
|
- * frequency as close as possible to the desired frequency.
|
|
554
|
+ * Combinations of PWM Modes, prescale values and TOP resolutions are used internally
|
|
555
|
+ * to produce a frequency as close as possible to the desired frequency.
|
557
|
556
|
*
|
558
|
|
- * FAST_PWM_FAN_FREQUENCY [undefined by default]
|
|
557
|
+ * FAST_PWM_FAN_FREQUENCY
|
559
|
558
|
* Set this to your desired frequency.
|
560
|
|
- * If left undefined this defaults to F = F_CPU/(2*255*1)
|
561
|
|
- * i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers.
|
562
|
|
- * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required
|
|
559
|
+ * For AVR, if left undefined this defaults to F = F_CPU/(2*255*1)
|
|
560
|
+ * i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers.
|
|
561
|
+ * For non AVR, if left undefined this defaults to F = 1Khz.
|
|
562
|
+ * This F value is only to protect the hardware from an absence of configuration
|
|
563
|
+ * and not to complete it when users are not aware that the frequency must be specifically set to support the target board.
|
|
564
|
+ *
|
563
|
565
|
* NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior.
|
|
566
|
+ * Setting very high frequencies can damage your hardware.
|
564
|
567
|
*
|
565
|
568
|
* USE_OCR2A_AS_TOP [undefined by default]
|
566
|
569
|
* Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2:
|
|
@@ -570,9 +573,17 @@
|
570
|
573
|
* PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.)
|
571
|
574
|
* USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies.
|
572
|
575
|
*/
|
|
576
|
+//#define FAST_PWM_FAN // Increase the fan PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
|
573
|
577
|
#if ENABLED(FAST_PWM_FAN)
|
574
|
|
- //#define FAST_PWM_FAN_FREQUENCY 31400
|
|
578
|
+ //#define FAST_PWM_FAN_FREQUENCY 31400 // Define here to override the defaults below
|
575
|
579
|
//#define USE_OCR2A_AS_TOP
|
|
580
|
+ #ifndef FAST_PWM_FAN_FREQUENCY
|
|
581
|
+ #ifdef __AVR__
|
|
582
|
+ #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1))
|
|
583
|
+ #else
|
|
584
|
+ #define FAST_PWM_FAN_FREQUENCY 1000U
|
|
585
|
+ #endif
|
|
586
|
+ #endif
|
576
|
587
|
#endif
|
577
|
588
|
|
578
|
589
|
/**
|