Magic Lantern Firmware Wiki

Analog/digital timing generator?


g3gg0: the ADTG is some ADC and Timer/Generator
it can:
a) convert analog signals 
b) is a precision timer
c) might be able to generate the logic signals to trigger CMOS reading,
   like row/col addressing

The ADTG is expected to be the part responsible for converting CMOS analog sensel values to a digital data stream and control its clock and address lines. It also seems to be an accurate timing generator for this purpose.

This device is manufactured by Analog Devices especially for canon as a customer part. This means there is no freely available datasheet. Also AD support team cannot access anything of this part. As a result, we will not get any information, if not from canon themselves. (if you know more about this device, please contact us)

Similar chip for CCD sensors, found on CHDK forum:

AD9923A - CCD Signal Processor with V-Driver and Precision Timing Generator

These registers are used for configuring low-level sensor timings and probably other parameters, like ISO, number of scan lines and so on.

Some (or all?) register values are encoded with NRZI -

Research code[]

adtg_log (saves log files)

adtg_gui (interactive menu)


 [REG] @@@@@@@@@@@@ Start ADTG
 [REG] ############ Start CMOS
 [REG] ############ Start CMOS16 OC_KICK  // only for newer cameras

CMOS registers[]

 0 - ISO related?
 1 - image moves up and down (vskip)
 2 - struggles with left/right (hskip)
 3 - flags/start?
 4 - ?
 5 - ?
 6 - ?
 7 - that reg 7 is frightening, looks like the cmos is dieing


CMOS[0]: 0x203 at ISO 100
---- ------xx default 11, setting to 00 results in dark image with very low stdev
---- ---xxx-- ISO, values from 000 to 100, ascending (ISO 100-1600)
---- xxx----- second ISO field (as in dual ISO), disabled by default (see next bit)
---x -------- enables second ISO field (default 0)
--x- -------- enables vertical OB clamping maybe (setting it to 0 results in severe horizontal banding that looks like random walk)
-x-- -------- compresses the image horizontally (left side squashed, right side black)

CMOS[4]: 0x242 at iso 100...800 and 0x244 at iso 1600
---x -------- looks like some vertical dual ISO
-x-- -------- seems to cleanup 0.2 or 0.25 stops of shadow noise
No effect observed on the other bits.

ADTG registers[]


 800c - vertical line skipping
 805e - shutter blanking in zoom mode
 8060 - shutter blanking without zoom
        range: from 0 to fps_timer_B - 1
        if blanking is 0, that's full duty cycle (1/fps shutter speed)
        if blanking is fps_timer_B - 1, that's zero duty cycle (black image)
 8178 - called dwSrFstAdtg1[4]
 8179 - called dwSrFstAdtg1[5]
 8196 - called dwSrFstAdtg2[2]
 8197 - called dwSrFstAdtg2[3]
 8178, 8196 and 82f8: image height (default 1321, 1321, 1320 in 1080p and 695, 695, 694 in 720p). Decreasing works, increasing doesn't...


(copied from g3gg0's emails)

 0x800C causes vertical line skipping and drives the auto-iso and wb mad :)

 0x8830 only slightly changes the color of the image. no real brightness change, maybe a little.
 0x88B0 has no noticeable influence.

 0x8880 is some weird black value? (value 0x0800 means normal)
 0x8882 looks like is green bayer pixel gain
 0x8884 is red gain
 0x8886 is blue gain (value 0x400 means normal)

    [0x8172] line count to sample. same as video resolution

    [0x8900] <- [0x0000]
    [0x8812] <- [0x0000]
    [0x8908] <- [0x0000]

    [0x800C] <- [0x0002] <- some kind of interlace distance? does not affect crop mode
    [0x802C] <- [0x0110]
    [0x8047] <- [0x0110]
    [0x8079] <- [0x0101]
    [0x82F3] <- [0x0306] <- line count that gets darker?!

    [0x8000] <- [0x0006]
    [0x8000] <- [0x0005] (causes interlacing)

ISO related
    [0x8882] <- [0x0400]  <- green?
    [0x8884] <- [0x0400]  <- red?
    [0x8886] <- [0x0400]  <- blue?
    [0x8888] <- [0x0400]     overwrites 0x8886

    [0x8880] <- [0x0800]  <- general gain?

ISO extension:
                100-1600   3200     6400
    [0x8830]    [0x0001] [0x0003] [0x0003]
    [0x88B0]    [0x0000] [0x0000] [0x0001]

       reg     all       1920@25   1920@24   1280@50   640@25  1920@25DZ  1920@24DZ
    [0x802C] [0x0110]                                          
    [0x8047] [0x0440]                                          
    [0x8079] [0x0000]                                          
    [0x8170] [0x0401]                                          
    [0x8172]            [0x06F0]  [0x03BB]  [0x03BB]  [0x06F0]  [0x0617]  [0x0617]
    [0x8173]            [0x0C52]  [0x026F]  [0x026F]  [0x0453]  [0x0453]  [0x0C01]
    [0x82F3] [0x0005]
 0x40694cd4: (shutter blanking time between frames, calculated)
    [0x805F]            [0x0002]  [0x00cd]  [0x0002]  [0x0002]  [0x016f]  [0x00c7]
    [0x8061]            [0x0002]  [0x00cd]  [0x0002]  [0x0002]  [0x016f]  [0x00c7]