[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 389: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Nikon Hacker • View topic - Lens serial communication

Lens serial communication

Wifi, USB, GPS, Grips, Mics, Ext Power, Lens, Flash

Re: Lens serial communication

Postby coderat » Wed Nov 06, 2013 3:35 pm

coderat
Core Developer
 
Posts: 2283
Joined: Fri Apr 26, 2013 10:21 am
Been thanked: 450 times

Re: Lens serial communication

Postby astronomer » Wed Nov 06, 2013 3:38 pm

User avatar
astronomer
Developer
 
Posts: 722
Joined: Fri Apr 06, 2012 10:06 am
Location: US
Been thanked: 293 times

Re: Lens serial communication

Postby coderat » Wed Nov 06, 2013 3:42 pm

coderat
Core Developer
 
Posts: 2283
Joined: Fri Apr 26, 2013 10:21 am
Been thanked: 450 times

Re: Lens serial communication

Postby astronomer » Wed Nov 06, 2013 4:01 pm

User avatar
astronomer
Developer
 
Posts: 722
Joined: Fri Apr 06, 2012 10:06 am
Location: US
Been thanked: 293 times

Re: Lens serial communication

Postby lain » Wed Nov 06, 2013 4:41 pm

User avatar
lain
Developer
 
Posts: 189
Joined: Fri Mar 29, 2013 3:42 pm
Been thanked: 111 times

Re: Lens serial communication

Postby lain » Wed Nov 06, 2013 5:12 pm

Ok, dumping the data I've collected as a zip file.
Contents:
* D800 + AF-S DX Nikkor 35 f1.8G [Power On] [2 Full AF without lock].txt
* D800 + AF-S DX Nikkor 35 f1.8G [Power On] [Multiple AF without lock].txt
* D5100 + AF-S DX Nikkor 35 f1.8G [Power On in MA mode] [4 Full AF cycles with no lock].txt
* D5100 + AF-S DX Nikkor 35 f1.8G [Power On] [Live View] [Multiple AF no lock] [Power Off].txt
* D5100 + AF-S Nikkor 14-24 f2.8G [Power On in MA mode 24mm] [Full MF] [Zoom to 14 and Full MF] [Zoom to 20 and Full MF].txt
* D5100 + AF-S Nikkor 14-24 f2.8G [Power On in MA mode] [2 Full AF no lock] [Full MF].txt
* D5100 + AF-S Nikkor 14-24 f2.8G [Power On in MA mode] [Zoom 24-14 then 14-24].txt
* D5100 + RokiBowYang 8 f3.5 HD Fisheye [Power On and meter twice].txt

As you can see this includes the requested Rokinon/Bower/Samyang AE-only lens. This one actually forced me to fix a few issues in my parser, and answered a question I had before. Earlier I noted that the camera asserts H/S for an unknown period of time, then releases it and waits for the lens to then assert H/S to acknowledge, at which point a command can be sent to the lens.
Nikkor glass always asserted H/S before the camera released it, so it was just continuously asserted. Being lazy, I neglected to address the possibility of H/S being released by the body then asserted by the lens some time later. Well, this Rokinon lens did exactly that. A lot. When adding support I also added a message any time that happens, which you'll see throughout the log. Sorry for the clutter, I can turn it off in future dumps if it's a bother.

Speaking of the Rokinon, it does not support cmd 0x28, but instead supports cmd 0x27, which is mentioned briefly in this patent. All that is mentioned is that it gives lens information such as AE, AF, and similar data, which is obvious by looking at it anyway. The patent is a painful read, I wouldn't bother. Anyway, I think cmd 0x27 is just an older or lesser version of cmd 0x28 which gives less data. Perhaps the aberration or vignette information is less detailed?

The Rokinon responds to several commands with 0xFF. The patent that keeps on giving explains that 0xFF is how a lens should respond if it does not understand a command, so there ya go.

leegong and coderat, I hope this helps you in understanding the firmware :techie-studyinggray:
Lots more lenses to test soon on the D800, D5100, and upcoming D70. I'll probably try them on my F5 as well just for fun :grin:

Anyway, I'm rambling :teasing-blah: Let me know if there's anything I've forgotten or any specifics I should focus on!
Attachments
Lens Data Nov06-2013.zip
(99.17 KiB) Downloaded 207 times
User avatar
lain
Developer
 
Posts: 189
Joined: Fri Mar 29, 2013 3:42 pm
Been thanked: 111 times

Re: Lens serial communication

Postby coderat » Wed Nov 06, 2013 5:28 pm

@Lain
You can add protocol descriptions and command bytes info to WIKI. Or if you want I add this for you. At least starting part about electrical things, H/S line assertion, communication - excellent info. The world deserves to read this ! :)

Later commands, when we are sure what they are.

Thanks a lot,
coderat
coderat
Core Developer
 
Posts: 2283
Joined: Fri Apr 26, 2013 10:21 am
Been thanked: 450 times

Re: Lens serial communication

Postby lain » Wed Nov 06, 2013 5:31 pm

User avatar
lain
Developer
 
Posts: 189
Joined: Fri Mar 29, 2013 3:42 pm
Been thanked: 111 times

Re: Lens serial communication

Postby astronomer » Wed Nov 06, 2013 8:17 pm

User avatar
astronomer
Developer
 
Posts: 722
Joined: Fri Apr 06, 2012 10:06 am
Location: US
Been thanked: 293 times

Re: Lens serial communication

Postby leegong » Thu Nov 07, 2013 12:32 am

Hi , lain ,
My understanding to CMD 0xE8 ,0xE0 and 0xEA , probably sth is uncorrect :
CMD 0xE8 , parameter0 = byte 0x6 , parameter1 == 16bits AF_step (signed , little endian ) , parameter2 == CMD 0xE0 , parameter0 = enum {0x6 , 0xE} , depending on unknown flag which is strongly related to status of AF , parameter1 = unknown byte ,
parameter2 = 16bits AF_step (signed , little endian ) , which is exactly smae as parameter1 of CMD 0xE8 .
But i'm not sure about it , could you please manage to confirm them ? whatever they are correct or not .
BTW : CMD 0xEA has no input AF step or AF amount , but it's absolutely related to AF operation . what do you think about it ?
it just tells lens "do it according to setting of CMD 0xE8 or 0xE0 " ? wild guess of course .
EDIT : CMD 0xEC : parameter0 = unknown byte , , which is same as parameter2 of CMD 0xE8 .
Best regards ,
Leegong
leegong
Core Developer
 
Posts: 2143
Joined: Mon Mar 19, 2012 12:21 am
Location: Hangzhou , China
Been thanked: 553 times

PreviousNext

Return to External Hacks

Who is online

Users browsing this forum: No registered users and 2 guests