STM32L and LSE

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
DrunkenDonkey
Posts: 124
Joined: Sun Aug 28, 2011 5:16 pm

STM32L and LSE

Post 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? :(
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32L and LSE

Post by Giovanni »

It is possible the oscillator stops when you probe the pins, you could configure the MCO output and measure there.

Giovanni
DrunkenDonkey
Posts: 124
Joined: Sun Aug 28, 2011 5:16 pm

Re: STM32L and LSE

Post 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
colin
Posts: 149
Joined: Thu Dec 22, 2011 7:44 pm

Re: STM32L and LSE

Post 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.
Post Reply