I started with a STM32L073RZT dev board. Everything works just fine. I added a MX1V-T1N 32768 kHz crystal with two capacities for ground, as described in the manual. I used the external crystal for the LSE. The LSE is the input on my LPTIM1. Now I have a STM32L073 LQFP100 chip on my own board, and I set up the same quartz in the same way, but it does not work. The LPTIM1 does not start counting, when I use LSE as external input. When I select LSI (internal clock) LPTIM1 does start to count and everything works.
In the main() I initialize the LPTIM with:
MX_LPTIM1_Init();
static void MX_LPTIM1_Init(void)
{
/* USER CODE BEGIN LPTIM1_Init 0 */
/* USER CODE END LPTIM1_Init 0 */
/* USER CODE BEGIN LPTIM1_Init 1 */
/* USER CODE END LPTIM1_Init 1 */
hlptim1.Instance = LPTIM1;
hlptim1.Init.Clock.Source = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC;
hlptim1.Init.Clock.Prescaler = LPTIM_PRESCALER_DIV1;
hlptim1.Init.Trigger.Source = LPTIM_TRIGSOURCE_SOFTWARE;
hlptim1.Init.OutputPolarity = LPTIM_OUTPUTPOLARITY_HIGH;
hlptim1.Init.UpdateMode = LPTIM_UPDATE_IMMEDIATE;
hlptim1.Init.CounterSource = LPTIM_COUNTERSOURCE_INTERNAL;
if (HAL_LPTIM_Init(&hlptim1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LPTIM1_Init 2 */
/* USER CODE END LPTIM1_Init 2 */
}
And I start the counter with:
HAL_LPTIM_Counter_Start_IT(&hlptim1, ZYKLUS);
What can might be the problem?
To answer your question by editing my question: I took the two capacitors and the oscillator I used on the dev board (where they worked) and used them for testing on my board with the STM32L073 LQFP100. I connected them to the RCC_OSC32_IN and RCC_OSC32_OUT.
@Lundin Thanks for your answer! Yes, I use soldering pads to connect the oscillator, but I make sure that enough of the oscillator's pin is covered in tin solder. About the 'working' part: I am using an oscilloscope to check if the oscillator is working. There is no measureable wave pattern. The RCC_OSC32_OUT has a ~1V level and the RCC_OSC32_IN is 0V. When soldering the same components to the dev board's RCC_OSC32_IN and RCC_OSC32_OUT. I see the same 0V on the RCC_OSC32_IN pin and a wave pattern at a ~1V level on the RCC_OSC32_OUT pin.
@Max I see a wave pattern, roughly of the expected frequency. The Image below shows what I see on RCC_OSC32_OUT of the dev board. When soldered to 'my board' there is a constant level on ~1V. Supply and other Voltages are, what i would expect.
