Another reason not to blindly trust the EBay Datasheet

A project log for Digital Holga

Conversion of a Holga 120S to digital format with SD card output.

AnthonyAnthony 02/20/2015 at 16:262 Comments

Almost every model of 'Ebay Module Camera' out there (perhaps with the exception of those which are UART based, but my guess would be their CMOS interface is the same, only there is an external clock already 'on board', require a 'heartbeat', or a steady external clock-in signal provided, even when 'powered up', before they will wake up and talk to you over i2c (needed for setting essential configuration registers and properly initializing the camera). [More on this particular topic in a later post]

However, once you've got the 'blood pumping', the first thing to do is establish a connection over i2c (the SDA/SDL lines). I was struggling with this quite a bit though as the official Micron datasheet suggests the hardware register for the device lies at 0x65. However, after numerous attempts at communicating over the bus I was simply not getting any response.

A bit perplexed, I finally resorted to using an i2C scanner script, which basically scans all 127 potential addresses in range and looks for a ping back, or response.

And, aha! Low and behold, finally a response (again, keep in mind if there is no steady clock signal going into the board at XCLK, this technique won't work)! Only the address is 0x5D, totally different from 0x65 specified in the datasheet.

Yet another reason to take a 'curious', rather than 'blind' approach to any components you purchase off EBay.


Anthony wrote 02/23/2015 at 10:49 point

Dear mitjaneho,

Actually I am working on an update to this post as there is another crucial point I became aware of. 

As to the XCLK, at least on the Teensy 3.1 the 'simplest' way is using the analogWriteFrequency() function (unfortunately not available in the standard Arduino libraries). But on Teensy an example would be like this (placed the 'void setup() section):

analogWriteFrequency(20, 8000000); // Sets up a 8 mHz PWM on pin 20
analogWrite(20, 128); // Sets the duty cycle of the PWM on pin 20 to 50% (half the time on, half the time off)

It is also possible to have a direct clock out on an Arduino, but it is a bit more work. It requires editing the fuses on the chip and either using an external programmer, or updating the bootloader.

See this link for more details:

  Are you sure? yes | no

mitjaneho wrote 02/23/2015 at 05:54 point

Really cool that you can pin back the address but there was a simpler way; you should have just typed in mt9d11 in google and the datasheet would have enlisted 0x5D as the 7-bit address.

anyways, just wanted to mentioned the "heartbeat" through the xclk but i am not sure how i can provide that through arduino? is there any external clock pin like in the stm32's?

  Are you sure? yes | no