Hi All,
I am using Kinetis MKL24 MCU. I need to operate in low power modes (VLLS) and I also need to have USB communication. I am using Freescale's Processor Expert USB CDC stack. Do you have any ideas how to achieve USB connection detection and enumeration while in VLLS (or LLS) power mode? The LLWU module does not contain USB as a wake up source.
My idea is to set up LPTMR as a periodic wake up source. Each time MCU wakes up due to LPTMR I enable PLL clock, initialise USB CDC component and check if any USB event happens. If there's no connection I switch off PLL clock and go back to sleep. LPTMR period is set up to 2 seconds...
Prior to trying that idea I would like to ask if any of you have some ideas to share about it...
Thanks!
Customer can check KL24 reference manual page 139 table 7-2. Module operation in low power modes with below info:
USB module can not works in any low power mode (includes VLLSx mode)
Wish it helps.
I see, but what I want to achieve is to be able to detect USB connection during VLLS / LLS mode and switch to higher power mode (where USB is operational) and service that USB communication session. After disconnection of USB go back to VLLS / LLS mode.
So what I really need is to implement "detect USB connection -> switch higher power mode/faster clock" strategy.
I found this hint in Reference Manual: "VBUS detect signal: To detect a valid VBUS in device mode, use a GPIO signal that can wake the chip in all power modes."
And I'm thinking now to make a USB's 5.0V to MCU's 3.3V resistor branch connecting to one of LLWU pins.
Question is, if anyone has tried that or other ideas?
Hi Szymon,
It has been a time since the last reply, so I'm not sure if you still concern about this issue.
In fact, I'm doing the similar thing as you in a recent project. I've already tried your first idea, using LPTMR to wake up the micro from STOP mode periodically then check if USB is enumerated, but it did not work. I think the only difference was that I used LPTMR as the tick of an RTOS instead of an interrupt source directly. The problem seems that the USB should take some action as soon as it is connected. If not, it cannot be recognized by the PC. However in LLS mode, interrupts are all disabled except some LLWU sources, so the connection of USB cannot cause an interrupt. I guess it's maybe the reason why it didn't work. By the way, PLL clocks seem to be set enabled in STOP mode (in PEx CPU component).
I'm now trying to find other solutions. Have you already tried your second idea (external pin for LLWU) and do you have some idea?
Regards,
Kenan
If there with re-connection (from disconnect to connect) action with USB bus, the VBUS voltage modification can be used as detection signal.
There uses a resistor divider network with VBUS and use a LLWU module external pin detect that voltage modification to wake up the chip from VLLS/LLS low power mode.
Thank you for the attention.