From 26da462ce1316916dbc45bf020e8d4f115e05599 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 10 Jan 2022 19:49:03 -0600 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"=F0=9F=93=9D=20kHz=20=3D>=20KHz"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 02b29c0fecd1d68226cd64d660bb409e6f131f9e. --- Marlin/Configuration_adv.h | 8 ++++---- Marlin/src/HAL/DUE/HAL_SPI.cpp | 6 +++--- Marlin/src/HAL/DUE/timers.cpp | 2 +- Marlin/src/HAL/DUE/usb/genclk.h | 6 +++--- Marlin/src/HAL/DUE/usb/osc.h | 12 ++++++------ Marlin/src/HAL/DUE/usb/sysclk.h | 6 +++--- Marlin/src/HAL/DUE/watchdog.cpp | 2 +- Marlin/src/HAL/ESP32/i2s.cpp | 2 +- Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c | 2 +- Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h | 2 +- Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp | 2 +- Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h | 2 +- Marlin/src/HAL/STM32/timers.h | 2 +- Marlin/src/HAL/STM32F1/timers.cpp | 2 +- Marlin/src/HAL/TEENSY31_32/timers.h | 2 +- Marlin/src/HAL/TEENSY35_36/timers.h | 2 +- Marlin/src/HAL/shared/HAL_SPI.h | 6 +++--- Marlin/src/feature/digipot/digipot_mcp4451.cpp | 2 +- Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/planner.h | 2 +- 20 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 569ff1bf0838..d49d2d00b9cc 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -561,7 +561,7 @@ * FAST_PWM_FAN_FREQUENCY * Set this to your desired frequency. * For AVR, if left undefined this defaults to F = F_CPU/(2*255*1) - * i.e., F = 31.4KHz on 16MHz microcontrollers or F = 39.2KHz on 20MHz microcontrollers. + * i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers. * For non AVR, if left undefined this defaults to F = 1Khz. * This F value is only to protect the hardware from an absence of configuration * and not to complete it when users are not aware that the frequency must be specifically set to support the target board. @@ -1179,7 +1179,7 @@ /** * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies - * below 1KHz (for AVR) or 10KHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the * lowest stepping frequencies. */ @@ -3419,14 +3419,14 @@ /** * PHOTO_PULSES_US may need adjustment depending on board and camera model. - * Pin must be running at 48.4KHz. + * Pin must be running at 48.4kHz. * Be sure to use a PHOTOGRAPH_PIN which can rise and fall quick enough. * (e.g., MKS SBase temp sensor pin was too slow, so used P1.23 on J8.) * * Example pulse data for Nikon: https://bit.ly/2FKD0Aq * IR Wiring: https://git.io/JvJf7 */ - //#define PHOTO_PULSES_US { 2000, 27850, 400, 1580, 400, 3580, 400 } // (µs) Durations for each 48.4KHz oscillation + //#define PHOTO_PULSES_US { 2000, 27850, 400, 1580, 400, 3580, 400 } // (µs) Durations for each 48.4kHz oscillation #ifdef PHOTO_PULSES_US #define PHOTO_PULSE_DELAY_US 13 // (µs) Approximate duration of each HIGH and LOW pulse in the oscillation #endif diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index 2b613a45baec..c5e8f2433d7d 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -491,9 +491,9 @@ * 1 : 4 - 5 MHz * 2 : 2 - 2.5 MHz * 3 : 1 - 1.25 MHz - * 4 : 500 - 625 KHz - * 5 : 250 - 312 KHz - * 6 : 125 - 156 KHz + * 4 : 500 - 625 kHz + * 5 : 250 - 312 kHz + * 6 : 125 - 156 kHz */ void spiInit(uint8_t spiRate) { switch (spiRate) { diff --git a/Marlin/src/HAL/DUE/timers.cpp b/Marlin/src/HAL/DUE/timers.cpp index 6555edece3f3..a7bf7fbd6d85 100644 --- a/Marlin/src/HAL/DUE/timers.cpp +++ b/Marlin/src/HAL/DUE/timers.cpp @@ -62,7 +62,7 @@ const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = { Timer_clock1: Prescaler 2 -> 42MHz Timer_clock2: Prescaler 8 -> 10.5MHz Timer_clock3: Prescaler 32 -> 2.625MHz - Timer_clock4: Prescaler 128 -> 656.25KHz + Timer_clock4: Prescaler 128 -> 656.25kHz */ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { diff --git a/Marlin/src/HAL/DUE/usb/genclk.h b/Marlin/src/HAL/DUE/usb/genclk.h index 9831701f836f..cde03bc0d107 100644 --- a/Marlin/src/HAL/DUE/usb/genclk.h +++ b/Marlin/src/HAL/DUE/usb/genclk.h @@ -74,9 +74,9 @@ extern "C" { //@{ enum genclk_source { - GENCLK_PCK_SRC_SLCK_RC = 0, //!< Internal 32KHz RC oscillator as PCK source clock - GENCLK_PCK_SRC_SLCK_XTAL = 1, //!< External 32KHz crystal oscillator as PCK source clock - GENCLK_PCK_SRC_SLCK_BYPASS = 2, //!< External 32KHz bypass oscillator as PCK source clock + GENCLK_PCK_SRC_SLCK_RC = 0, //!< Internal 32kHz RC oscillator as PCK source clock + GENCLK_PCK_SRC_SLCK_XTAL = 1, //!< External 32kHz crystal oscillator as PCK source clock + GENCLK_PCK_SRC_SLCK_BYPASS = 2, //!< External 32kHz bypass oscillator as PCK source clock GENCLK_PCK_SRC_MAINCK_4M_RC = 3, //!< Internal 4MHz RC oscillator as PCK source clock GENCLK_PCK_SRC_MAINCK_8M_RC = 4, //!< Internal 8MHz RC oscillator as PCK source clock GENCLK_PCK_SRC_MAINCK_12M_RC = 5, //!< Internal 12MHz RC oscillator as PCK source clock diff --git a/Marlin/src/HAL/DUE/usb/osc.h b/Marlin/src/HAL/DUE/usb/osc.h index 06f59c676a60..953bcbbed1d3 100644 --- a/Marlin/src/HAL/DUE/usb/osc.h +++ b/Marlin/src/HAL/DUE/usb/osc.h @@ -93,9 +93,9 @@ extern "C" { //! \name Oscillator identifiers //@{ -#define OSC_SLCK_32K_RC 0 //!< Internal 32KHz RC oscillator. -#define OSC_SLCK_32K_XTAL 1 //!< External 32KHz crystal oscillator. -#define OSC_SLCK_32K_BYPASS 2 //!< External 32KHz bypass oscillator. +#define OSC_SLCK_32K_RC 0 //!< Internal 32kHz RC oscillator. +#define OSC_SLCK_32K_XTAL 1 //!< External 32kHz crystal oscillator. +#define OSC_SLCK_32K_BYPASS 2 //!< External 32kHz bypass oscillator. #define OSC_MAINCK_4M_RC 3 //!< Internal 4MHz RC oscillator. #define OSC_MAINCK_8M_RC 4 //!< Internal 8MHz RC oscillator. #define OSC_MAINCK_12M_RC 5 //!< Internal 12MHz RC oscillator. @@ -105,9 +105,9 @@ extern "C" { //! \name Oscillator clock speed in hertz //@{ -#define OSC_SLCK_32K_RC_HZ CHIP_FREQ_SLCK_RC //!< Internal 32KHz RC oscillator. -#define OSC_SLCK_32K_XTAL_HZ BOARD_FREQ_SLCK_XTAL //!< External 32KHz crystal oscillator. -#define OSC_SLCK_32K_BYPASS_HZ BOARD_FREQ_SLCK_BYPASS //!< External 32KHz bypass oscillator. +#define OSC_SLCK_32K_RC_HZ CHIP_FREQ_SLCK_RC //!< Internal 32kHz RC oscillator. +#define OSC_SLCK_32K_XTAL_HZ BOARD_FREQ_SLCK_XTAL //!< External 32kHz crystal oscillator. +#define OSC_SLCK_32K_BYPASS_HZ BOARD_FREQ_SLCK_BYPASS //!< External 32kHz bypass oscillator. #define OSC_MAINCK_4M_RC_HZ CHIP_FREQ_MAINCK_RC_4MHZ //!< Internal 4MHz RC oscillator. #define OSC_MAINCK_8M_RC_HZ CHIP_FREQ_MAINCK_RC_8MHZ //!< Internal 8MHz RC oscillator. #define OSC_MAINCK_12M_RC_HZ CHIP_FREQ_MAINCK_RC_12MHZ //!< Internal 12MHz RC oscillator. diff --git a/Marlin/src/HAL/DUE/usb/sysclk.h b/Marlin/src/HAL/DUE/usb/sysclk.h index 4398cc0fc9fa..16db8c86d373 100644 --- a/Marlin/src/HAL/DUE/usb/sysclk.h +++ b/Marlin/src/HAL/DUE/usb/sysclk.h @@ -156,9 +156,9 @@ extern "C" { //! \name Master Clock Sources (MCK) //@{ -#define SYSCLK_SRC_SLCK_RC 0 //!< Internal 32KHz RC oscillator as master source clock -#define SYSCLK_SRC_SLCK_XTAL 1 //!< External 32KHz crystal oscillator as master source clock -#define SYSCLK_SRC_SLCK_BYPASS 2 //!< External 32KHz bypass oscillator as master source clock +#define SYSCLK_SRC_SLCK_RC 0 //!< Internal 32kHz RC oscillator as master source clock +#define SYSCLK_SRC_SLCK_XTAL 1 //!< External 32kHz crystal oscillator as master source clock +#define SYSCLK_SRC_SLCK_BYPASS 2 //!< External 32kHz bypass oscillator as master source clock #define SYSCLK_SRC_MAINCK_4M_RC 3 //!< Internal 4MHz RC oscillator as master source clock #define SYSCLK_SRC_MAINCK_8M_RC 4 //!< Internal 8MHz RC oscillator as master source clock #define SYSCLK_SRC_MAINCK_12M_RC 5 //!< Internal 12MHz RC oscillator as master source clock diff --git a/Marlin/src/HAL/DUE/watchdog.cpp b/Marlin/src/HAL/DUE/watchdog.cpp index 6cbf39d1d11f..e144db8291e3 100644 --- a/Marlin/src/HAL/DUE/watchdog.cpp +++ b/Marlin/src/HAL/DUE/watchdog.cpp @@ -39,7 +39,7 @@ void watchdogSetup() { uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000); // Calculate timeout value in WDT counter ticks: This assumes - // the slow clock is running at 32.768 KHz watchdog + // the slow clock is running at 32.768 kHz watchdog // frequency is therefore 32768 / 128 = 256 Hz timeout = (timeout << 8) / 1000; if (timeout == 0) diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index e9f418689e89..3e77b658360b 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -176,7 +176,7 @@ int i2s_init() { * * fwclk = fbclk / 32 * - * for fwclk = 250KHz (4µS pulse time) + * for fwclk = 250kHz (4µS pulse time) * N = 10 * M = 20 */ diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c index bb203cf8d472..466fc8020335 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c @@ -26,7 +26,7 @@ * These are based on the LPC1768 pinMode, digitalRead & digitalWrite routines. * * Couldn't just call exact copies because the overhead killed the LCD update speed - * With an intermediate level the softspi was running in the 10-20KHz range which + * With an intermediate level the softspi was running in the 10-20kHz range which * resulted in using about about 25% of the CPU's time. */ diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h index 4661202e8ace..d60d93daddbd 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h @@ -27,7 +27,7 @@ * These are based on the LPC1768 pinMode, digitalRead & digitalWrite routines. * * Couldn't just call exact copies because the overhead killed the LCD update speed - * With an intermediate level the softspi was running in the 10-20KHz range which + * With an intermediate level the softspi was running in the 10-20kHz range which * resulted in using about about 25% of the CPU's time. */ diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp index 69ea29172482..3b5acc1656cd 100644 --- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp +++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp @@ -26,7 +26,7 @@ * These are based on the LPC1768 pinMode, digitalRead & digitalWrite routines. * * Couldn't just call exact copies because the overhead killed the LCD update speed - * With an intermediate level the softspi was running in the 10-20KHz range which + * With an intermediate level the softspi was running in the 10-20kHz range which * resulted in using about about 25% of the CPU's time. */ diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h index 3c959cd4911e..c27c84e8c398 100644 --- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h +++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h @@ -27,7 +27,7 @@ * These are based on the LPC1768 pinMode, digitalRead & digitalWrite routines. * * Couldn't just call exact copies because the overhead killed the LCD update speed - * With an intermediate level the softspi was running in the 10-20KHz range which + * With an intermediate level the softspi was running in the 10-20kHz range which * resulted in using about about 25% of the CPU's time. */ diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index 37512da95986..aad543229e16 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -48,7 +48,7 @@ #define TIMER_INDEX_(T) TIMER##T##_INDEX // TIMER#_INDEX enums (timer_index_t) depend on TIM#_BASE defines. #define TIMER_INDEX(T) TIMER_INDEX_(T) // Convert Timer ID to HardwareTimer_Handle index. -#define TEMP_TIMER_FREQUENCY 1000 // Temperature::isr() is expected to be called at around 1KHz +#define TEMP_TIMER_FREQUENCY 1000 // Temperature::isr() is expected to be called at around 1kHz // TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp #define STEPPER_TIMER_RATE 2000000 // 2 Mhz diff --git a/Marlin/src/HAL/STM32F1/timers.cpp b/Marlin/src/HAL/STM32F1/timers.cpp index f00ac9e3fb19..112c730b9acc 100644 --- a/Marlin/src/HAL/STM32F1/timers.cpp +++ b/Marlin/src/HAL/STM32F1/timers.cpp @@ -40,7 +40,7 @@ * Timer_clock1: Prescaler 2 -> 36 MHz * Timer_clock2: Prescaler 8 -> 9 MHz * Timer_clock3: Prescaler 32 -> 2.25 MHz - * Timer_clock4: Prescaler 128 -> 562.5 KHz + * Timer_clock4: Prescaler 128 -> 562.5 kHz */ /** diff --git a/Marlin/src/HAL/TEENSY31_32/timers.h b/Marlin/src/HAL/TEENSY31_32/timers.h index 85381ea48163..3b073d63ab29 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.h +++ b/Marlin/src/HAL/TEENSY31_32/timers.h @@ -41,7 +41,7 @@ typedef uint32_t hal_timer_t; #define FTM0_TIMER_PRESCALE_BITS 0b011 #define FTM1_TIMER_PRESCALE_BITS 0b010 -#define FTM0_TIMER_RATE (F_BUS / (FTM0_TIMER_PRESCALE)) // 60MHz / 8 = 7500KHz +#define FTM0_TIMER_RATE (F_BUS / (FTM0_TIMER_PRESCALE)) // 60MHz / 8 = 7500kHz #define FTM1_TIMER_RATE (F_BUS / (FTM1_TIMER_PRESCALE)) // 60MHz / 4 = 15MHz #define HAL_TIMER_RATE (FTM0_TIMER_RATE) diff --git a/Marlin/src/HAL/TEENSY35_36/timers.h b/Marlin/src/HAL/TEENSY35_36/timers.h index 63ec5e4895ec..6c342bbe0d25 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.h +++ b/Marlin/src/HAL/TEENSY35_36/timers.h @@ -40,7 +40,7 @@ typedef uint32_t hal_timer_t; #define FTM0_TIMER_PRESCALE_BITS 0b011 #define FTM1_TIMER_PRESCALE_BITS 0b010 -#define FTM0_TIMER_RATE (F_BUS / FTM0_TIMER_PRESCALE) // 60MHz / 8 = 7500KHz +#define FTM0_TIMER_RATE (F_BUS / FTM0_TIMER_PRESCALE) // 60MHz / 8 = 7500kHz #define FTM1_TIMER_RATE (F_BUS / FTM1_TIMER_PRESCALE) // 60MHz / 4 = 15MHz #define HAL_TIMER_RATE (FTM0_TIMER_RATE) diff --git a/Marlin/src/HAL/shared/HAL_SPI.h b/Marlin/src/HAL/shared/HAL_SPI.h index 50a2bf9df21c..6611f9ec4e0f 100644 --- a/Marlin/src/HAL/shared/HAL_SPI.h +++ b/Marlin/src/HAL/shared/HAL_SPI.h @@ -38,9 +38,9 @@ * 1 : 4 - 5 MHz * 2 : 2 - 2.5 MHz * 3 : 1 - 1.25 MHz - * 4 : 500 - 625 KHz - * 5 : 250 - 312 KHz - * 6 : 125 - 156 KHz + * 4 : 500 - 625 kHz + * 5 : 250 - 312 kHz + * 6 : 125 - 156 kHz * * On AVR, actual speed is F_CPU/2^(1 + index). * On other platforms, speed should be in range given above where possible. diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index f59e0aae8068..ba5ecdad050a 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -82,7 +82,7 @@ void DigipotI2C::set_current(const uint8_t channel, const float current) { void DigipotI2C::init() { #if MB(MKS_SBASE) - configure_i2c(16); // Set clock_option to 16 ensure I2C is initialized at 400KHz + configure_i2c(16); // Set clock_option to 16 ensure I2C is initialized at 400kHz #else Wire.begin(); #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 1f10aba01b8a..17d279cfa5f9 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2495,7 +2495,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (extruder_advance_K[active_extruder] * block->e_D_ratio * block->acceleration * 2 < SQRT(block->nominal_speed_sqr) * block->e_D_ratio) SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed."); if (block->advance_speed < 200) - SERIAL_ECHOLNPGM("eISR running at > 10KHz."); + SERIAL_ECHOLNPGM("eISR running at > 10kHz."); #endif } #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index b83c445260f9..380c35755c96 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -883,7 +883,7 @@ class Planner { static void finish_and_disable(); // Periodic handler to manage the cleaning buffer counter - // Called from the Temperature ISR at ~1KHz + // Called from the Temperature ISR at ~1kHz static void isr() { if (cleaning_buffer_counter) --cleaning_buffer_counter; } /** From b5506eeaca36b13c0ef351c37b85dd8b51d1bc26 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Wed, 12 Jan 2022 08:13:13 -0800 Subject: [PATCH 2/2] KHz => kHz --- Marlin/Configuration_adv.h | 4 ++-- Marlin/src/HAL/AVR/fastio.cpp | 4 ++-- Marlin/src/HAL/DUE/fastio/G2_PWM.cpp | 2 +- Marlin/src/HAL/DUE/pinsDebug.h | 2 +- Marlin/src/HAL/SAMD51/timers.cpp | 2 +- Marlin/src/HAL/STM32/sdio.cpp | 2 +- Marlin/src/gcode/config/M672.cpp | 2 +- Marlin/src/gcode/control/M3-M5.cpp | 2 +- Marlin/src/module/endstops.cpp | 4 ++-- Marlin/src/module/temperature.cpp | 6 +++--- .../variants/MARLIN_F103VE_LONGER/hal_conf_custom.h | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d49d2d00b9cc..cf54cff991cd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -571,8 +571,8 @@ * * USE_OCR2A_AS_TOP [undefined by default] * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: - * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] - * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * 16MHz MCUs: [62.5kHz, 31.4kHz (default), 7.8kHz, 3.92kHz, 1.95kHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1kHz, 39.2kHz (default), 9.77kHz, 4.9kHz, 2.44kHz, 1.22kHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. diff --git a/Marlin/src/HAL/AVR/fastio.cpp b/Marlin/src/HAL/AVR/fastio.cpp index 8af3ef805efa..5083893ae3fd 100644 --- a/Marlin/src/HAL/AVR/fastio.cpp +++ b/Marlin/src/HAL/AVR/fastio.cpp @@ -245,7 +245,7 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb float count = 0; if (hz > 0 && (dca || dcb || dcc)) { count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq. - uint16_t prescaler; // Range of 30.5Hz (65535) 64.5KHz (>31) + uint16_t prescaler; // Range of 30.5Hz (65535) 64.5kHz (>31) if (count >= 255. * 256.) { prescaler = 1024; SET_CS(5, PRESCALER_1024); } else if (count >= 255. * 64.) { prescaler = 256; SET_CS(5, PRESCALER_256); } @@ -277,7 +277,7 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb // Restore the default for Timer 5 SET_WGM(5, PWM_PC_8); // PWM 8-bit (Phase Correct) SET_COMS(5, NORMAL, NORMAL, NORMAL); // Do nothing - SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250KHz + SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250kHz OCR5A = OCR5B = OCR5C = 0; } return round(count); diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp index d9fbabce2148..800915ff692b 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp @@ -25,7 +25,7 @@ * is NOT used to directly toggle pins. The ISR writes to the pin assigned to * that interrupt. * - * All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to + * All PWMs use the same repetition rate. The G2 needs about 10kHz min in order to * not have obvious ripple on the Vref signals. * * The data structures are setup to minimize the computation done by the ISR which diff --git a/Marlin/src/HAL/DUE/pinsDebug.h b/Marlin/src/HAL/DUE/pinsDebug.h index f01c53c8ce06..6c08585974fd 100644 --- a/Marlin/src/HAL/DUE/pinsDebug.h +++ b/Marlin/src/HAL/DUE/pinsDebug.h @@ -53,7 +53,7 @@ * The net result is that both the g_pinStatus[pin] array and the PIO_OSR register * needs to be looked at when determining if a pin is an input or an output. * - * b) Due has only pins 6, 7, 8 & 9 enabled for PWMs. FYI - they run at 1KHz + * b) Due has only pins 6, 7, 8 & 9 enabled for PWMs. FYI - they run at 1kHz * * c) NUM_DIGITAL_PINS does not include the analog pins * diff --git a/Marlin/src/HAL/SAMD51/timers.cpp b/Marlin/src/HAL/SAMD51/timers.cpp index ce13dd231ecd..1ad0e360736a 100644 --- a/Marlin/src/HAL/SAMD51/timers.cpp +++ b/Marlin/src/HAL/SAMD51/timers.cpp @@ -79,7 +79,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { rtc->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; // RTC clock setup - OSC32KCTRL->RTCCTRL.reg = OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K; // External 32.768KHz oscillator + OSC32KCTRL->RTCCTRL.reg = OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K; // External 32.768kHz oscillator // Stop timer, just in case, to be able to reconfigure it rtc->MODE0.CTRLA.bit.ENABLE = false; diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index 18b4434dfa73..0af5f9040e54 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -59,7 +59,7 @@ DMA_HandleTypeDef hdma_sdio; /* SDIO_INIT_CLK_DIV is 118 SDIO clock frequency is 48MHz / (TRANSFER_CLOCK_DIV + 2) - SDIO init clock frequency should not exceed 400KHz = 48MHz / (118 + 2) + SDIO init clock frequency should not exceed 400kHz = 48MHz / (118 + 2) Default TRANSFER_CLOCK_DIV is 2 (118 / 40) Default SDIO clock frequency is 48MHz / (2 + 2) = 12 MHz diff --git a/Marlin/src/gcode/config/M672.cpp b/Marlin/src/gcode/config/M672.cpp index af74230516e1..257b49471f61 100644 --- a/Marlin/src/gcode/config/M672.cpp +++ b/Marlin/src/gcode/config/M672.cpp @@ -53,7 +53,7 @@ // b7 b6 b5 b4 ~b4 ... hi bits, NOT last bit // b3 b2 b1 b0 ~b0 ... lo bits, NOT last bit // -void M672_send(uint8_t b) { // bit rate requirement: 1KHz +/- 30% +void M672_send(uint8_t b) { // bit rate requirement: 1kHz +/- 30% LOOP_L_N(bits, 14) { switch (bits) { default: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, !!(b & 0x80)); b <<= 1; break; } // send bit, shift next into place diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index ddbbc4ab6835..2cf22e81ce0c 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -43,7 +43,7 @@ * * If no PWM pin is defined then M3/M4 just turns it on. * - * At least 12.8KHz (50Hz * 256) is needed for Spindle PWM. + * At least 12.8kHz (50Hz * 256) is needed for Spindle PWM. * Hardware PWM is required on AVR. ISRs are too slow. * * NOTE: WGM for timers 3, 4, and 5 must be either Mode 1 or Mode 5. diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index b9c5aebf3915..939dd6d53760 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -352,7 +352,7 @@ void Endstops::init() { } // Endstops::init -// Called at ~1KHz from Temperature ISR: Poll endstop state if required +// Called at ~1kHz from Temperature ISR: Poll endstop state if required void Endstops::poll() { TERN_(PINS_DEBUGGING, run_monitor()); // Report changes in endstop status @@ -403,7 +403,7 @@ void Endstops::not_homing() { void Endstops::resync() { if (!abort_enabled()) return; // If endstops/probes are disabled the loop below can hang - // Wait for Temperature ISR to run at least once (runs at 1KHz) + // Wait for Temperature ISR to run at least once (runs at 1kHz) TERN(ENDSTOP_INTERRUPTS_FEATURE, update(), safe_delay(2)); while (TERN0(ENDSTOP_NOISE_THRESHOLD, endstop_poll_count)) safe_delay(1); } diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 0305e5e98ee1..bb1768054ee8 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3046,8 +3046,8 @@ class SoftPWM { }; /** - * Handle various ~1KHz tasks associated with temperature - * - Heater PWM (~1KHz with scaler) + * Handle various ~1kHz tasks associated with temperature + * - Heater PWM (~1kHz with scaler) * - LCD Button polling (~500Hz) * - Start / Read one ADC sensor * - Advance Babysteps @@ -3549,7 +3549,7 @@ void Temperature::isr() { adc_sensor_state = next_sensor_state; // - // Additional ~1KHz Tasks + // Additional ~1kHz Tasks // #if ENABLED(BABYSTEPPING) && DISABLED(INTEGRATED_BABYSTEPPING) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h index 3a6b7037adf0..3440343ffa1e 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h @@ -118,7 +118,7 @@ extern "C" { #endif #ifndef LSE_STARTUP_TIMEOUT - #define LSE_STARTUP_TIMEOUT 50U // No 32.7KHz LSE on this board, reduced to avoid delays + #define LSE_STARTUP_TIMEOUT 50U // No 32.7kHz LSE on this board, reduced to avoid delays #endif /* Tip: To avoid modifying this file each time you need to use different HSE,