Any known way to change the clock speed? - General Discussion and Assistance - CHDK Forum  

Any known way to change the clock speed?

  • 17 Replies
  • 5447 Views
*

Offline RaduP

  • *****
  • 908
Any known way to change the clock speed?
« on: 29 / October / 2009, 21:10:49 »
Advertisements
I was looking into implementing some sort of standby function. the goal is to get the camera to consume as little power as possible, while still being active.
So I'd have to disable the ccd, screen, touchscreen, and set the CPU clock as low as possible. Did anyone find a way to change the clock speed?
« Last Edit: 29 / October / 2009, 21:19:04 by RaduP »

*

Offline reyalp

  • ******
  • 13293
Re: Any known way to change the clock speed?
« Reply #1 on: 29 / October / 2009, 21:29:27 »
Yes. We even discussed this before.

edit: http://chdk.setepontos.com/index.php/topic,4013.0.html

Everything I said in that thread still applies.
« Last Edit: 29 / October / 2009, 21:32:06 by reyalp »
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 908
Re: Any known way to change the clock speed?
« Reply #2 on: 29 / October / 2009, 21:38:03 »
Yes, but unfortunately, non of those strings are available on my SD980 :/

*

Offline reyalp

  • ******
  • 13293
Re: Any known way to change the clock speed?
« Reply #3 on: 29 / October / 2009, 21:58:22 »
clocksave task still exists, as do various strings involving "clock" and "clk"
Don't forget what the H stands for.


*

Offline RaduP

  • *****
  • 908
Re: Any known way to change the clock speed?
« Reply #4 on: 29 / October / 2009, 22:23:57 »
Yes, you are right, clocksave exists, and so do some clk and clock strings. They are all very ambiguous though, and most of them I am not even sure they are relevant to this, except for MLHClock (which I still don't know what m/l/h means, and wasn't really explained anywhere).

On the bright side, it seems that on my camera the clock locations are the same as posted here: http://chdk.setepontos.com/index.php/topic,2139.msg20087.html#msg20087

Only the L clock changes, the higher it is the more idle it seems.. I will do some more tests with the LED and see what happens.

*

Offline RaduP

  • *****
  • 908
Re: Any known way to change the clock speed?
« Reply #5 on: 30 / October / 2009, 00:18:48 »
Well, after experimenting for a while, by changing the value at the beginning of boot(), so that I won't have to worry about watchdogs and other tasks and stuff, there is no difference in the clock speed.
At the beginning of boot(), the value of 0xC0400048 is 5, and the LED blinks very slowly. Setting it to 1 before blinking the LED did not change anything. I guess there might be some other MMIO location that needs to be changed to effectively change the clock speed..

*

Offline RaduP

  • *****
  • 908
Re: Any known way to change the clock speed?
« Reply #6 on: 30 / October / 2009, 18:35:03 »
After some more experimentation, I was able to change the LED blinking rate by modifying the 44/4c locations.
Interestingly, when the 4c location is modified with 5, the behavior is undefined. Sometimes the clock gets really slow, sometimes the camera freezes (crash), and sometimes the LED doesn't blink at all, but the camera resumes the booting process.
I wonder if MLH is an abbreviation for medium, low, high. This might explain why changing the value of 48 doesn't seem to make a difference, and changing the value of 4c can crash the camera.

*

Offline RaduP

  • *****
  • 908
Re: Any known way to change the clock speed?
« Reply #7 on: 30 / October / 2009, 20:25:43 »
While investigating further, I found something very interesting.
There is a MMIO, 0xC0400008, where if you write the magic value 2, strange things happen.
If set to 2 at the boot time, the camera will freeze and will stay frozen until the battery is removed.
However, if it is set after the OS loaded, the camera will freeze, even the LCD will freeze in an unupdated state, but the WD will be kicking and shut down the camera.

Furthermore, the saveclock task will skip some stuff if the value is 2. So I guess it's some sort of halt thing, although the WD is still active. I wonder if there are any power saving merits involved...
« Last Edit: 30 / October / 2009, 21:07:21 by RaduP »


*

Offline reyalp

  • ******
  • 13293
Re: Any known way to change the clock speed?
« Reply #8 on: 30 / October / 2009, 20:33:17 »
I wonder if MLH is an abbreviation for medium, low, high.
I think this is unlikely, because on earlier cameras, MCLK LCLK and HCLK were clearly different, independent items, which could each be set to one of 18, 36 or 72mhz

edit:
note that ARM has a native "wait for interrupt" state which should be quite power efficient.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 908
Re: Any known way to change the clock speed?
« Reply #9 on: 30 / October / 2009, 21:09:25 »
You mean like the x86 hlt?

 

Related Topics