2025-04-09 8:34 AM
Hi,
Using Wise studio Version: 1.3.1_R Build id: 2023_05 on Linux with the STEVAL-IDB012V1 (BlueRNG-LPS dev. kit). I discovered that my instructions to write values in the timer registers have no effect. I found it by tracing the program while watching the register values in the register window of the debugger perspective. For example, TIM2->ARR = 3200; produce no change in the register. Same result with TIM16 and TIM17. I should miss something very basic here. It is made from the "Profiles_Peripheral_with_Library" example. All my edits are visible in the snippet below:
int main(void)
{
/* System Init */
SystemInit(SYSCLK_64M, BLE_SYSCLK_32M);
/* Configure IOs for power save modes */
BSP_IO_Init();
/* Configure I/O communication channel */
BSP_COM_Init(BSP_COM_RxDataUserCb);
/* Init Clock */
Clock_Init();
/* Initialize the button */
BSP_PB_Init(USER_BUTTON, BUTTON_MODE_EXTI);
// Overwrite initializations
//My_GPIO_Settings();
//Define_Waveform_data_buffer();
//DMA_Based_Waveform_Settings();
GPIOA->MODER =0x000000A0;
LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_0, LL_GPIO_MODE_ALTERNATE);
LL_GPIO_SetAFPin_0_7(GPIOB, LL_GPIO_PIN_0, LL_GPIO_AF_2);
LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_1, LL_GPIO_MODE_OUTPUT);
LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_2, LL_GPIO_MODE_OUTPUT);
TIM2->ARR = 3200;
TIM2->CCR1 = 1600;
TIM2->CR1 = 0b0000000000000001;
while(1)
{
if(TIM2->CNT > 1000)
LL_GPIO_SetOutputPin(GPIOB, 0x2);
else
{
LL_GPIO_ResetOutputPin(GPIOB, 0x2);
}
}
// Host_Profile_Test_Application();
}
Solved! Go to Solution.
2025-04-09 8:59 AM - edited 2025-04-09 12:06 PM
Hello,
Does:
Clock_Init();
enable the timer clock in the RCC_APB0ENR register?
Check if these bits are set..
2025-04-09 8:59 AM - edited 2025-04-09 12:06 PM
Hello,
Does:
Clock_Init();
enable the timer clock in the RCC_APB0ENR register?
Check if these bits are set..
2025-04-09 9:25 AM
This was it. Thanks a lot!