mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-06 04:27:53 +02:00
fix: correct 14.5 MHz to 12 MHz across all CBM projects
- Update all docstrings from 14.5 MHz to 12 MHz XOSC (29 files) - Fix 0x05_servo_cbm divider: INT=14/FRAC=8 (14.5) -> INT=12/FRAC=0 (12) - Verified against RP2350 datasheet, Pico 2 board schematic, and SDK
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver header for RP2350.
|
* @brief Delay driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Millisecond busy-wait delay calibrated for a 14.5 MHz clock.
|
* Millisecond busy-wait delay calibrated for a 12 MHz clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver implementation for RP2350.
|
* @brief Delay driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Busy-wait millisecond delay calibrated for a 14.5 MHz clock
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
||||||
* (3600 loop iterations per millisecond).
|
* (3600 loop iterations per millisecond).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver header for RP2350.
|
* @brief Delay driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Millisecond busy-wait delay calibrated for a 14.5 MHz clock.
|
* Millisecond busy-wait delay calibrated for a 12 MHz clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver implementation for RP2350.
|
* @brief Delay driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Busy-wait millisecond delay calibrated for a 14.5 MHz clock
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
||||||
* (3600 loop iterations per millisecond).
|
* (3600 loop iterations per millisecond).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver header for RP2350.
|
* @brief Delay driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Millisecond busy-wait delay calibrated for a 14.5 MHz clock.
|
* Millisecond busy-wait delay calibrated for a 12 MHz clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver implementation for RP2350.
|
* @brief Delay driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Busy-wait millisecond delay calibrated for a 14.5 MHz clock
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
||||||
* (3600 loop iterations per millisecond).
|
* (3600 loop iterations per millisecond).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver header for RP2350.
|
* @brief Delay driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Millisecond busy-wait delay calibrated for a 14.5 MHz clock.
|
* Millisecond busy-wait delay calibrated for a 12 MHz clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver implementation for RP2350.
|
* @brief Delay driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Busy-wait millisecond delay calibrated for a 14.5 MHz clock
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
||||||
* (3600 loop iterations per millisecond).
|
* (3600 loop iterations per millisecond).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Configures PWM slice 3, channel A on GPIO 6 at 50 Hz for
|
* Configures PWM slice 3, channel A on GPIO 6 at 50 Hz for
|
||||||
* standard hobby servo control. Uses a wrap of 19999 and a
|
* standard hobby servo control. Uses a wrap of 19999 and a
|
||||||
* fractional clock divider of 14.5 (14.5 MHz XOSC / 50 Hz /
|
* clock divider of 12 (12 MHz XOSC / 50 Hz / 20000 = 12).
|
||||||
* 20000 = 14.5).
|
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -32,14 +31,14 @@
|
|||||||
#define SERVO_SLICE 3U
|
#define SERVO_SLICE 3U
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Wrap value for 50 Hz at 14.5 MHz with divider 14.5.
|
* @brief Wrap value for 50 Hz at 12 MHz with divider 12.
|
||||||
*/
|
*/
|
||||||
#define SERVO_WRAP 19999U
|
#define SERVO_WRAP 19999U
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Clock divider register value for 14.5 (INT=14, FRAC=8).
|
* @brief Clock divider register value for 12 (INT=12, FRAC=0).
|
||||||
*/
|
*/
|
||||||
#define SERVO_DIV_VAL ((14U << PWM_DIV_INT_SHIFT) | 8U)
|
#define SERVO_DIV_VAL ((12U << PWM_DIV_INT_SHIFT) | 0U)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Minimum pulse width in microseconds (0 degrees).
|
* @brief Minimum pulse width in microseconds (0 degrees).
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver header for RP2350.
|
* @brief Delay driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Millisecond busy-wait delay calibrated for a 14.5 MHz clock.
|
* Millisecond busy-wait delay calibrated for a 12 MHz clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver implementation for RP2350.
|
* @brief Delay driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Busy-wait millisecond delay calibrated for a 14.5 MHz clock
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
||||||
* (3600 loop iterations per millisecond).
|
* (3600 loop iterations per millisecond).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver header for RP2350.
|
* @brief Delay driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Millisecond busy-wait delay calibrated for a 14.5 MHz clock.
|
* Millisecond busy-wait delay calibrated for a 12 MHz clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Kevin Thomas
|
* @author Kevin Thomas
|
||||||
* @brief Delay driver implementation for RP2350.
|
* @brief Delay driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Busy-wait millisecond delay calibrated for a 14.5 MHz clock
|
* Busy-wait millisecond delay calibrated for a 12 MHz clock
|
||||||
* (3600 loop iterations per millisecond).
|
* (3600 loop iterations per millisecond).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver header for RP2350.
|
* @brief UART0 driver header for RP2350.
|
||||||
*
|
*
|
||||||
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
* Bare-metal UART0 driver supporting TX/RX on GPIO 0/1 at
|
||||||
* 115200 baud (14.5 MHz XOSC clock).
|
* 115200 baud (12 MHz XOSC clock).
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief UART0 driver implementation for RP2350.
|
* @brief UART0 driver implementation for RP2350.
|
||||||
*
|
*
|
||||||
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
* Configures UART0 on GPIO 0 (TX) and GPIO 1 (RX) at 115200
|
||||||
* baud using the 14.5 MHz XOSC clock.
|
* baud using the 12 MHz XOSC clock.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -59,7 +59,7 @@ static void _uart_configure_pins(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set UART0 baud rate divisors for 115200 at 14.5 MHz.
|
* @brief Set UART0 baud rate divisors for 115200 at 12 MHz.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void _uart_set_baud(void)
|
static void _uart_set_baud(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user