What is at 0xC0220104 and 0xC022010C? - DSLR Hack development - CHDK Forum

What is at 0xC0220104 and 0xC022010C?

  • 8 Replies
  • 8190 Views
*

ASalina

What is at 0xC0220104 and 0xC022010C?
« on: 26 / May / 2008, 16:29:25 »
Advertisements
I'm looking for the LED address in the 40D. I've found several references to 0xC0220104 and 0xC022010C (which were the product of some addition) where the values #0x44 and #0x46 are stored.

Are these known addresses in other cameras?

To be clear, the references are:
ReadyDisplay_93FD6C stores #0x46 into 0xC0220104
ClearDisplay_93FE48 stores #0x44 into 0xC0220104
TurnOnLcdPower_93FEF8 stores #0x46 into 0xC022010C
TurnOffDisplay_941FD8 stores #0x44 into 0xC022010C.


Re: What is at 0xC0220104 and 0xC022010C?
« Reply #1 on: 26 / May / 2008, 16:46:49 »
I only know that in 400D led are in 0xC022xxxx segment. and they are operated with 0x46(on) and 0x44(off). quick code will test it :-) To test where are the leds i used something like:

int* base=0xC0220000;
int i,j,k;
for(i=0; i<0x100; i++)
for(j=0; j<i; j++)
{k = *(base+i);
*(base+i) = 0x46;
delay(1<<13);
*(base+i) = k;
delay(1<<13);
}

and then you only cound the blinks :-)
« Last Edit: 26 / May / 2008, 17:25:49 by owerlord »

*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: What is at 0xC0220104 and 0xC022010C?
« Reply #2 on: 26 / May / 2008, 16:48:40 »
Those addresses differ with every camera. I guess 0xC022010C is used for enabling/disabling the display brightness or controller altogether, since it should be PWM-controlled (probably by another address). It could be used for a variety of other things, though. I have no idea what 0xC0220104 would do. Both seem to be unrelated to LEDs, unless default behaviour is to do something with LEDs when using those functions.

*

ASalina

Re: What is at 0xC0220104 and 0xC022010C?
« Reply #3 on: 26 / May / 2008, 16:58:46 »
I only know that in 400D led are in 0xC022xxxx segment. and they are operated with 0x46(on) and 0x44(off). quick code will test it :-) To test where are the leds i used something like:

int* base=0xC022220000;
int i,j,k;
for(i=0; i<0x100; i++)
for(j=0; j<i; j++)
{k = *(base+i);
*(base+i) = 0x46;
delay(1<<13);
*(base+i) = k;
delay(1<<13);
}

and then you only cound the blinks :-)

So that code didn't make your camera go crazy? :-)

PS: I wonder about trying udumper on the 40D. I've only looked at the udumper code a little. I don't want to scramble my camera's brains, though.

*

ASalina

Re: What is at 0xC0220104 and 0xC022010C?
« Reply #4 on: 26 / May / 2008, 17:22:32 »
Those addresses differ with every camera. I guess 0xC022010C is used for enabling/disabling the display brightness or controller altogether, since it should be PWM-controlled (probably by another address). It could be used for a variety of other things, though. I have no idea what 0xC0220104 would do. Both seem to be unrelated to LEDs, unless default behaviour is to do something with LEDs when using those functions.

There are two LEDs on the 40D. One is on the back of the camera and the other is on the front. The one on the front is used as a self-timer indicator, but the one on the back flashes on power-up (more so after the power has been off for a long time) and on card insertion, picture buffer flushing, and other camera status-type things.

I'll see if I can try owerlord's suggestion.

Re: What is at 0xC0220104 and 0xC022010C?
« Reply #5 on: 26 / May / 2008, 17:24:03 »
No. I'm not a rich person. The camera costed me much - so I'm not doing anything if I don't know it won't break it. For instance - I only run code I have writen myself - and I encourage you to do it also. as you see in the code - I leave the *adres unchanged at the end of the function. I also can say that camera fully reboot's when you pull out the battery. And if it will even restart-in-a-loop I pulled out the 3V battery - and it reboot totaly. I tested (on the blank part) to write to rom memory - it didn't work - you can't write on the firmware. So you can test (of course - within reason) much.

If you want one more advice - remember the types of data! When you program something without known functions and so - it's very easy to mistake unsigned with signed, int* with char* and so.
((int*) 0xC0220000) + 4 = 0xC0220010
((char*) 0xC0220000) + 4 = 0xC0220004
I made couple of such mistakes - you don't have to :-)

*

ASalina

Re: What is at 0xC0220104 and 0xC022010C?
« Reply #6 on: 26 / May / 2008, 17:40:46 »
Thanks owerlord. I'm really impressed with the progress you've made, and I appreciate the time you take to answer my questions.

The same goes for everyone here, especially those who don't normally speak English. I only know one language and I would be lost without your extra effort. Thanks.

*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: What is at 0xC0220104 and 0xC022010C?
« Reply #7 on: 26 / May / 2008, 18:15:27 »
The camera has lots of safety features in place, like exception- and assertion handlers, which catch most of the Bad Things you can do to your camera. Writing to the 0xC0... area is generally safe.. in my experience. It appears to be some MMIO stuff and the camera occasionally kills itself when writing the wrong value to an address I'm not supposed to touch. I only recently bypassed the assertion handler (responsible for handling the majority of screwups) so the camera might just raise an assertion... Lots of tasks are probably constantly reading that area and take action depending on the values.

ASalina: the LED on the front (tally/timer LED on my S5IS) is PWM on my camera, I haven't been able to directly control it with 0x46. I had to use UniqueLedOn with the LED table or PostLEDMessage instead, supplying a PWM value which will then be fed into the LED. It's quite possible that the LED on the 40D behaves the same way so it might not be easily controllable. The same goes for the second LED (in theory) although it is unlikely. That LED probably indicates CF read/write activity, by the way. At least, that's what I deduce from your description, unless it also blinks on certain events that do not involve the CF card.

Re: What is at 0xC0220104 and 0xC022010C?
« Reply #8 on: 26 / May / 2008, 18:28:04 »
Note: on the back of 400 there is the CF led (blinks when CF is accessed) - witch is controllable, and a led in the PrintDirect (PTP) button - also controllable.

One more thing. remember to loop the blinking code, so you'll have more time to read the blinks :-)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal