Page 1 of 1

STM32L and LSE

Posted: Thu Dec 29, 2011 10:50 pm
by DrunkenDonkey
Guys, I doubt it have anything to do with Chibi but... I have 32khz crystal on PC14/OSC32_IN, PC15/OSC32_OUT that I should activate to drive RTC and some ADC. This is supposed to be LSE and according to docs - should not be working by default. I enable the LSE in mcuconfig, but detect nothing on the pins. The weird thing is that is already activated AND running according to RCC->CSR, pin 8 and 9 are 1 after reset and the init goes through the code in hal_lld without even poking inside the if statement:

Code: Select all

#if STM32_LSE_ENABLED
  /* LSE activation, have to unlock the register.*/
  if ((RCC->CSR & RCC_CSR_LSEON) == 0) {
    PWR->CR |= PWR_CR_DBP;
    RCC->CSR |= RCC_CSR_LSEON;
    PWR->CR &= ~PWR_CR_DBP;
  }
  while ((RCC->CSR & RCC_CSR_LSERDY) == 0)
    ;                           /* Waits until LSE is stable.               */
#endif


I'm 120% sure I'm missing something very obvious, just can't think of it... even replaced the crystal to be sure it is not damaged... any idea? :(

Re: STM32L and LSE

Posted: Thu Dec 29, 2011 11:01 pm
by Giovanni
It is possible the oscillator stops when you probe the pins, you could configure the MCO output and measure there.

Giovanni

Re: STM32L and LSE

Posted: Sun Jan 01, 2012 12:33 pm
by DrunkenDonkey
It turned out the cpu was right... and LSE was really running, but with oscillations of 0.2v the LA was totally unable to detect it and even with oscilloscope was hard. I drive external ADC with that crystal and it totally can't work. So getting desperate I tried to use PWM to get 32khz, after all I got some buzzer to work yesterday, worked wonders, but I think I burned the device that was using the ADC... oh well... :D

Re: STM32L and LSE

Posted: Wed Jan 11, 2012 10:21 pm
by colin
Yes, it is probably not possible to use a “normal” logic analyzer or oscilloscope probe to measure the signal on crystal pins. The added capacitance will possibly stop the oscillator.

I have successfully done non-intrusive probing of a 32 MHz crystal oscillator through a non-contact method involving a spectrum analyzer or oscilloscope probe with a short wire placed near the crystal PCB trace (near, and parallel to, but not touching). The signal coupled well enough that its frequency could be measured.