You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think sleep mode cannot work without an extra reset.
The process for sleep mode in this repo is:
Setup sleep mode
switch silicon oscillator on
switch to silicon oscillator
switch crystal oscillator off
go to sleep
The problem is with step (3). If there is a sudden change to the oscillator, then the PLL will unlock, chase, and may run the processor at an out-of-spec frequency, hanging the processor before (4) and (5) complete.
As USB relies on 12 or 24 MHz, and the crystal oscillator runs at 20, this is a nono for devices that use a USB style crystal. The software in this repo checks for the crystal frequency and skips steps 2, 3 and 4 in this case; this is a bit unfortunate, as you will end up in a less deep sleep mode that uses 10x more power.
Even if you use a 20 MHz crystal, it still does not work because (a) the silicon oscillator may be way out, and (b) even if it was 20 MHz, it may be out of phase by 180 degrees, and I don’t think the PLL will take that well. At present, the software in this repo accepts this case.
I think an extra reset will work:
Setup sleep mode
switch silicon oscillator on
switch to silicon oscillator & reset the xCORE
on boot check if the silicon oscillator is on - if so
switch crystal oscillator off
go to sleep
When it comes out of sleep it should switch back to the crystal oscillator.
The text was updated successfully, but these errors were encountered:
I think sleep mode cannot work without an extra reset.
The process for sleep mode in this repo is:
The problem is with step (3). If there is a sudden change to the oscillator, then the PLL will unlock, chase, and may run the processor at an out-of-spec frequency, hanging the processor before (4) and (5) complete.
As USB relies on 12 or 24 MHz, and the crystal oscillator runs at 20, this is a nono for devices that use a USB style crystal. The software in this repo checks for the crystal frequency and skips steps 2, 3 and 4 in this case; this is a bit unfortunate, as you will end up in a less deep sleep mode that uses 10x more power.
Even if you use a 20 MHz crystal, it still does not work because (a) the silicon oscillator may be way out, and (b) even if it was 20 MHz, it may be out of phase by 180 degrees, and I don’t think the PLL will take that well. At present, the software in this repo accepts this case.
I think an extra reset will work:
When it comes out of sleep it should switch back to the crystal oscillator.
The text was updated successfully, but these errors were encountered: