|
|
View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19658
|
|
Posted: Tue Jan 11, 2022 12:38 pm |
|
|
Have you got USB_CONNECTION_SENSE wired and enabled?.
This is actually _required_ by the USB specs. You can only run without it
on a device that is USB powered.
If this is correctly setup, the USB port will automatically power down when
the cable is unplugged. |
|
|
FFT
Joined: 07 Jul 2010 Posts: 92
|
|
Posted: Tue Jan 11, 2022 12:51 pm |
|
|
OK, I have the USB detect pin enabled.
Here is the result:
I didn't touch on USB side at all.
Changed my previous config to following one:
Code: | // configure 12MHz clock for USB operation and 48Mhz CPU operation
#fuses HS
//#fuses PLLEN //enable pll, we can now use CPUDIVx fuses
//#fuses CPUDIV1 //CPU clock set to 48MHz
//#fuses USBDIV2 //when using low speed USB, need to divide 12MHz by 2. this fuse has no effect when using full speed.
//#use delay(clock=48000000, restart_wdt) // 48Mhz
//#use delay(clock=48MHz, crystal=12MHz, USB_FULL, restart_wdt) // 48Mhz
#use delay(clock=12MHz, crystal=12MHz, USB_FULL, restart_wdt) // 12Mhz |
Respectively reconfigured other modules such as timers etc..
Current consumption is now 6.4mA at 12Mhz
It draws 11.6mA at 48Mhz setup.
@temtronic, it looks more than 20%.
My whole question was "how to reduce clock frequency" since #fuses confused me. It is as easy as a #use delay parameter.
I just asked this and found by myself.
You cannot get some basic questions
Inability to think simple. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9377 Location: Greensville,Ontario
|
|
Posted: Tue Jan 11, 2022 1:58 pm |
|
|
Glad it's working for you.
As a test though, it'd be interesting for you to use the internal RC clocks and see if power can be reduced even further.
By not having the primary osc/12MHz xtal/caps, it should use less power. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19658
|
|
Posted: Wed Jan 12, 2022 7:21 am |
|
|
The figures you have, suggest that the PIC is doing quite a few things
that are drawing extra power over the basic chip operation. The 'delta'
between 12MHz, and 48MHz, in the actual CPU consumption, is about
6 to 7mA, which is pretty much what you are seeing. It is perhaps worth
looking for other things that may be wasting power. Typical list:
Whatever regulator you are using for the 3.3v supply. Some of these
waste a significant power....
Make sure you have no PIC pins left floating.
Make sure where possible, pins are driven to high or low, whichever
draws the least power on the attached devices.
Look carefully at whether attached devices can be powered down when
not in use.
Well done in moving to 'half power'. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|