Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9010
    julle.p
    Participant

    Hi.

    I have an issue using Low-Power on a 32U4 (Micro Pro, Leonardo Clone).

    1) Running simple example, like “Blink”. 32U4 shows up in Windows Device Manager as “Arduino Leonardo (COM8)”.
    2) When uploading code, the COM port changes to “Arduino Leonardo Bootloader (COM7)”.
    This is all as expected for the 32U4, with the built in USB.

    Then I upload the example “idleWakePeriodic”.
    I can see the code is running, as the LED is blinking at the expected interval, however the USB connection is lost and the device is now shown as “Unknown USB Device (Device Descriptor Request Failed)”. The only way to fix this, is to enable the bootloader, and upload a ‘working’ sketch.

    As a comparison, I have also tried to use the jeelib-libriay, with method “Sleepy::loseSomeTime”. This works, without breaking the USB driver. So the device is capable of sleeping. However, I need to use an external interrupt for wake-up, and thus was hoping I could use the Low-Power library.

    I have also tried to use the Spark Fun Pro Micro driver, but with same result….

    Any thoughts on what happens with the USB connection?

    #9033
    LIM PHANG MOH
    Keymaster

    Hi julle.p,
    Please take a look at my solution here.

    You need to properly attach and detach the USB port.

    #9036
    julle.p
    Participant

    Thank you. This does indeed work!

    A couple of questions to clarify:
    1) Why does one need to detach the USB connection? Why isn’t it enough to simple attach it again – especially when you then see that the default detach method is empty?

    2) If I in my final design does not need the USB connection, should I then detach it anyway (e.g. in the Setup routine) to minimize sleep current?

    3) Will Serial1 be working, or should that also be detach / attach – if so, do you also know the command for that?

    4) Where is the different sleep modes in your library described (powerDown, idle, etc.)?

    5) Can I do anything else (software-wise) to save power in sleep mode, than just calling:
    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);

    Thank you for your help! I really appreciate your time and your library.

    #9061
    LIM PHANG MOH
    Keymaster

    1) Why does one need to detach the USB connection? Why isn’t it enough to simple attach it again – especially when you then see that the default detach method is empty?

    Because without detaching the USB peripheral actually consumes additional current.

    2) If I in my final design does not need the USB connection, should I then detach it anyway (e.g. in the Setup routine) to minimize sleep current?

    Yes, you need them as the above.

    3) Will Serial1 be working, or should that also be detach / attach – if so, do you also know the command for that?

    No, you do not need to do that. Just make sure you use Serial1.flush() if you want to make sure characters are transmitted out before going into sleep. Else you might see some garbage characters.

    4) Where is the different sleep modes in your library described (powerDown, idle, etc.)?

    Take a look at our very old article here.

    5) Can I do anything else (software-wise) to save power in sleep mode, than just calling:
    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);

    Take care of pins that are floating and make sure they are at a defined state (high or low).

    #9080
    julle.p
    Participant

    Thank you very much for your answer!

    In the next couple of weeks, I will start to do some measurements, and see how how much current the Pro Micro consumes when in sleep mode 🙂

    #9082
    LIM PHANG MOH
    Keymaster

    Just remember to add some delay in setup() like few seconds to provide enough time for you to upload code next time before it goes to sleep. Else you will have a bricked unit.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.