Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate complete USB power saving when not using USB #14

Open
joshgoebel opened this issue Jun 4, 2015 · 6 comments
Open

Incorporate complete USB power saving when not using USB #14

joshgoebel opened this issue Jun 4, 2015 · 6 comments

Comments

@joshgoebel
Copy link
Collaborator

Ref:
http://harizanov.com/2013/02/power-saving-techniques-on-the-atmega32u4/

Not only do you power USB down you also have to freeze the clock.

@shogerr
Copy link
Collaborator

shogerr commented Nov 7, 2015

Perhaps we can create a development branch and include this for some testing. What do you think?

@joshgoebel
Copy link
Collaborator Author

My core lib repository already has code for most of this.

@shogerr
Copy link
Collaborator

shogerr commented Nov 8, 2015

Can you link to the relevant code? Thanks.

@joshgoebel
Copy link
Collaborator Author

Actually all the work I've done so far is in the main repository now.

@shogerr shogerr closed this as completed Feb 3, 2016
@joshgoebel
Copy link
Collaborator Author

So far, this issue itself is still open though. USB sucks power from the battery constantly, and that's what this issue was meant to address.

@joshgoebel
Copy link
Collaborator Author

For anyone else who wants to tackle this is what needs to happens:

  1. Power down USB fully according to the link above
  2. You want to hook the VBUSTI interrupt and when you see it power USB back up.

Then test to see if this actually works and lets you reflash the device. Or we could just turn off USB by default when on battery power and to reflash you have to plug your Arduboy in then turn it on.

The power savings he reports for turning off USB are almost 50% (for the CPU):

delay(8000);  // 11.35mA

power_usb_disable();
delay(8000);  //9.97mA

USBCON |= (1 << FRZCLK);             // Freeze the USB Clock              
PLLCSR &= ~(1 << PLLE);              // Disable the USB Clock (PPL) 
USBCON &=  ~(1 << USBE  );           // Disable the USB  
delay(8000);  // 5.3mA

@joshgoebel joshgoebel modified the milestone: 1.1 Feb 10, 2016
@shogerr shogerr modified the milestones: 1.2, 1.1 Feb 20, 2016
@joshgoebel joshgoebel modified the milestone: 1.2 Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants