ADTG and CMOS registers

Started by a1ex, June 25, 2013, 11:01:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

a1ex

Code: https://bitbucket.org/hudson/magic-lantern/src/tip/modules/adtg_log/

Notes: http://magiclantern.wikia.com/wiki/ADTG

Logs:
Quote from: g3gg0 on June 08, 2013, 11:05:46 PM
read, compare and understand:
http://upload.g3gg0.de/pub_files/f00fa2c2cea01ee32408009b6e02fcc6/ADTG_CMOS_Writes.7z

this is only the data written to ADTG and CMOS.
try to find out as much about the registers as you can.

if all that is understood, then we have about 10% of the necessary stuff for custom resolutions.

good luck ;)

Andy600

Looks like a big find.  8)

Is it safe to try on older cameras?
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

a1ex

First you need to find some stubs, they are hardcoded for 5D3 now.

Then, take the battery out as soon as you see distorted images. It will look like the CMOS is dieing ;)

I have no idea if it's actually dangerous or not. It probably is.

If you manage increase the sampling area, be prepared for buffer overflows.

g3gg0

thanks for consolidating the data and setting up the wiki page!
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

g3gg0

my theory about:
8060 - shutter blanking without zoom

i think it specifies the time to wait until sensels are powered.
when they are powered, all incoming light causes the charge to increase.
as soon the video timer has expired, the ADTG will read out the sensels.

why this way and not power the sensels immediately and read out after the specified time ticks?
this way the sensels are not floating/unpowered and thus dont lose any charge before they get read out.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

a1ex

This theory explains perfectly the shutter speed changes when using FPS override (you know the formula from fps-engio.c: EA = (E0 + (1/Fb - 1/F0)) * Ta / Ta0).

(changing FPS timer B in digic, but not in ADTG, will keep the blanking time constant and will stretch the exposure time)

ilguercio

Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

dlrpgmsvc

Quote from: g3gg0 on June 25, 2013, 03:45:23 PM
my theory about:
8060 - shutter blanking without zoom

i think it specifies the time to wait until sensels are powered.
when they are powered, all incoming light causes the charge to increase.
as soon the video timer has expired, the ADTG will read out the sensels.

why this way and not power the sensels immediately and read out after the specified time ticks?
this way the sensels are not floating/unpowered and thus dont lose any charge before they get read out.

Because they must start collecting photons and then read in a precise time slot. If you power up all the rows together and then, after a while, you start to read the first row, then the second row... every subsequent row has collected too many photons if compared to the first ones, so uneven exposure. If this is your question... or try to explain better if I misunderstood you.
Normal CMOS row timings in video mode (shutterless) are normally as follows (as an example) : - power to row 1  - power to row 2 - power to row 3 - read row 1- power to 4 - read row 2 - power to row 5 - read row 3 - ... and so on...  and in photo mode (with shutter) are : - shutter down - power to all rows - shutter up - wait - shutter down - read row 1 - read row 2 - ... and so on
If you think it's impossible, you have lost beforehand

1%

Have to try this on 6D, should work like 5D3.. 50D and others will have to post logs.. maybe can undo removing 0 from the shutter list since a1ex applied that fix.

g3gg0

@dlrpgmsvc:
My question was a rhetorical one which i immeadiately answered :)
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

For 6D I found

805F
8061

move when shutter is turned.

But

//~ #define FRAME_SHUTTER_BLANKING_ZOOM   (*(uint16_t*)0x4045184C) // ADTG register 805f
//~ #define FRAME_SHUTTER_BLANKING_NOZOOM (*(uint16_t*)0x40451850) // ADTG register 8061

This did not work. Got lines and shutter read as 1/24

1%

How do I parse this? Do you have to hook GDB to the camera?

adtg.bin
https://mega.co.nz/#!J4RGjDCb!PDdbfC6G7QE-IuZ0AO4AyQu7b-ZKk9WeVRZbUzB-lm4

50D is 105F and 1061

Also.. on 6D the shutter bounce +/- 1? like the fps override did.. 50D is solid one setting.

g3gg0

the bin can be parsed with the python script in the module directory ;)
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!


g3gg0

i uploaded modified versions of adtg_log and trace to my repository.
see https://bitbucket.org/g3gg0/magic-lantern

using these modules, can someone trace crop mode ADTG configuration on 60D or 600D?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

dlrpgmsvc

I wish to be of help into porting this to 550D : can someone help me into specify what to do ? Even preliminary tests or logs reports... but please, even if I'm a programmer, I'm quite new to this programming environment, so, something I managed to understand, while other things not: can you be as specific as you can, so I can get the point ? Many thanks in advance !  ;D
If you think it's impossible, you have lost beforehand

g3gg0

the most important part is trying to understand what the registers in the logs mean.
this means, finding and identifying numbers that could make up the vertical and horizontal resolution etc.

to use adtg_log, you have to find the ADTG_Write function on your camera.
its easy as it usually contains these strings:
"[REG] @@@@@@@@@@@@ Start ADTG[CS:%lx]"
"[REG] ADTG:[%08x] <----- Excel Tab Number"

same for CMOS
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

EOS M and 650D might be easier to trace, we found working crop mode on that.

g3gg0

yeah nanomad tried, but gdb_setup() failed (return value zero) due to the M having a different IV structure.
my recommendation was

MEM(0x0C) = 0xE59FF000;

before calling gdb_setup().

can you confirm that gdb_setup() works then?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

GDB setup hangs my camera.. doing that assignment gives lvalue error in the module.

nanomad

You need to expand the macro by hand. But overwriting stuff in that memory area causes tons of assertions.
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

g3gg0

we fixed it tonight.

just curious - you removed the volatile in MEM macro and it worked?
this is not how it is supposed to work :(
can you re-add it?

volatile just ensures that the compiler does *not* optimize the code.
the compiler will read the variable from RAM every time it is read and write back every time is is written.
without volatile, subsequent reads would get optimized and the variable is kept in registers.

btw, can you upload all those logs?

@all:
if you want to help, can you create a map of all registers and their values for every log we have?
i think it is possible to process them with shell scripts and then export it for google spreadsheet.
the last written value should be used as register value to be shown.

tried it for two 5D3 logs, but the register list will show the *first* register value only.
https://docs.google.com/spreadsheet/ccc?key=0AgQ2MOkAZTFHdHdQVFcyMVExZFdNM1A2NnJSYlFhSmc&usp=sharing
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

nanomad

After going back, I think the bad boy is the function that updates CMOS regs in the module causing, in turn, all kind of assertions.

Here are the LOGs
https://dl.dropboxusercontent.com/u/15964163/ML/650D.101.ADTG-LOGs.zip

edit: Your google link is read-only
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

dlrpgmsvc

Quote from: g3gg0 on July 02, 2013, 10:08:08 AM
@all:
if you want to help, can you create a map of all registers and their values for every log we have?

Please, I need a "dummy-hints" here.
Obviously I don't need a Step-by-Step guide, but only some sparse hints&tips : What I have to do just to start ? Do I must go to g3gg0 repository, download the ADTG module and makefile, then compile it to my side ?
Also, How it works and what I have to do ? Do I must activate it, and how ? Simply by loading it from modules ml menu ? Do I have to activate also raw video module ? And then, do I must make some actions on my camera in order for the log to record something ? And what actions I must do on my camera ? You are talking about ADTG and CMOS: do they are two different logs ? Or do there is a separate module for CMOS ? And where these logs are saved ? ...

Excuse me for all these questions: I'm a programmer and I work with assembly Language also, and I'm sure when I will manage to be "inside" the workflow, I will be of help. Obviously I will write a "dummy-guide" also for this so Others can help as well !  ;-)
If you think it's impossible, you have lost beforehand

g3gg0

Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!