3 ms·
I (being not a hardware person but able to blink a LED) would start with the diagrams of talking with the device on page 7 and refer to them while reading the t
by mananaysiempre 4y ago
I (being not a hardware person but able to blink a LED) would start with the diagrams of talking with the device on page 7 and refer to them while reading the text descriptions of same on pages 5–6, maybe refresh my memory on how I2C works[1,2] as well. At the same time, almost any controller you can get is happy[3] to talk I2C for you, so it’s unlikely the details matter beyond “controller writes device address and RW bit then (either!) reads from or writes to the peripheral accordingly until end of transaction” (whence the “dummy write” the datasheet says is needed to set the read address). Many even come with libraries that will talk to I2C EEPROMs specifically (because they are everywhere), so the diagrams might not be so important either.
The rest of the datasheet is (as commonly happens with simple digital components) concerned with “how do I wire this up”, “how good of a digital signal can I expect to get out”, “how bad of a digital signal can I get away with putting in”, a refresher on I2C, and miscellanea like power consumption, operating temperature, and sizes of little plastic boxes it comes in. Necessary if you want to design a board properly, not so much if you’re just going to wire it up for a quick hack (the device seems to have a supply voltage and logic levels of “whatever”).
The only thing you maybe do need these for is to look at the board photo and figure out how they wired it. Dot indentation marks pin 1. Pins 1–4 shorted, picture on page 1 says 4 is ground and 1–3 are address, so per page 4 it ends up with[4] address 1010 000. Power (called Vcc for reasons that are not important here) is on pin 5, wired up to top pin of connector on the close-up photo; the next one down goes to data (SDA as I2C calls it) on pin 8; following one goes under the chip but is almost certainly the bus clock (SCL) on pin 6 because that needs to go somewhere; and the bottom is at first glance only connected to an isolated island of copper but the small holes (“vias”) to the other side of the board probably connect it to the other islands so it has to be ground. That leaves write protect on pin 7, unconnected to anything but Vcc (through a dummy “pull-up” resistor to limit how much power the chip will waste examining it), which, to do a sanity check, page 3 says means writes are permitted (so the name of the pin is a bit unfortunately).
There. Done. You still need to find or make something for the other side of the I2C conversation, but either an off-the-shelf programmer or a tutorial for a cheap board with a controller should be sufficient for that. (Won’t be completely trivial the first time around, but it’s a one-time thing like any other development environment.)
[1] https://learn.sparkfun.com/tutorials/i2c/all https://learn.sparkfun.com/tutorials/i2c/all
[2] https://learn.adafruit.com/i2c-addresses/overview https://learn.adafruit.com/i2c-addresses/overview
[3] https://github.com/dekuNukem/bob_cassette_rewinder/blob/622715dcacd0a23d778762e0415d4f4e76071cd5/firmware/code/Src/helpers.c#L19 https://github.com/dekuNukem/bob_cassette_rewinder/blob/6227...
[4] https://github.com/dekuNukem/bob_cassette_rewinder/blob/622715dcacd0a23d778762e0415d4f4e76071cd5/firmware/code/Inc/helpers.h#L11 https://github.com/dekuNukem/bob_cassette_rewinder/blob/6227...