"Confessions of a Lazy Engineer: How Claude the AI Saved Me from Death by Datasheets"
I had a very interesting conversation with an AI named Claude a few weeks ago. Over the course of a few days, Claude has proven to me that it can be one my best friends. Meeting Claude was like a caveman discovering fire—minus the grunting and plus a lot more "aha!" moments and fewer singed eyebrows. Like many engineers, my journey with AI went from "meh," to "yikes," to "alright, I guess we're friends now.". Here is how it all started.
I was lazy, which is pretty much how all my tech relationships kick off—procrastination with a side of, "let's see what this button does.” I was working on a personal project which involved collecting data from a sensor through I2C communication. I monitored the I2C bus using a logic analyzer (it’s called Saleae, Inc. e if you are interested). The transactions between the micro controller and sensor (MPU6050) involved writing configurations to registers, reading configurations from registers and reading Inertial measurements. All this data can be a nightmare to decipher with a logic analyzer, mostly because raw I2C transactions are about as informative as a brick wall in a library. Exhibit A:
“write to 0x68 ack data: 0x3B
read to 0x68 ack data: 0x09 0x8A 0x00 0x16 0x40 0xFC 0xFB 0xDE 0xFF 0xFD 0xFF 0xFD 0x00 0x04”
This is obviously nonsense unless you manually visit the sensor datasheet and search for the specific register being read/written to (which is what I was doing for a long time).
Then I thought, what if I could create a higher-level analyzer to interpret all this data and present it in a way that doesn't make my brain hurt? So that's exactly what I did. Thankfully, the amazing engineers at Saleae, Inc. offer a way to write higher-level analyzers in Python, which you can add to their logic analyzer software—making it less of a cryptic puzzle and more like a helpful friend who actually explains things. They provide a guide that describes how to use their API to create user extensions (here). The next step involved delving into the MPU6050 reference manual to decode the I2C transactions. The objective was to convert basic transactions—such as a read or write to a register—into a format that’s easier for humans to understand. For instance, what was once a cryptic transaction now looks like this:
领英推荐
Read to Address: 0x68
Register: Accelerometer and Gyroscope Measurements
Raw Data: 0x9, 0x8e, 0xff, 0xfc, 0x41, 0x22, 0xfc, 0x65, 0x0, 0x2, 0x0, 0x2, 0x0, 0x0
Ax: 2446
Ay: -4
Az: 16674
Gx: 2
Gy: 2
Gz: 0
Now, as a reader, you're probably wondering what any of this has to do with my quasi-romantic relationship with AI that I mentioned at the beginning of the article. Don’t worry, we’re getting to that plot twist soon! As you can infer from the example above, the Python code operates as a state machine, translating transactions based on several factors: the type of transaction (read or write), the register being addressed, and the type of data involved. Think of it as a highly organized interpreter that turns tech jargon into something you can actually understand—like a translator for robot-speak! And this is when Claude came into the picture.
After my chat with Claude moved past my existential crisis questions—like the usual "What the heck is happening in the world?", "Am I even real?", "Can you teach me how to speak to cats?", and "Why does pizza taste like heaven's own ambrosia when I'm wearing mismatched socks at 3 AM?"—things really started to get interesting. We dove headfirst into the truly profound mysteries of life, like whether fish get thirsty and if my neighbor's suspiciously cheerful houseplant is plotting world domination.
On a more serious note, I figured I can utilize AI to first, learn both the Saleae guide to creating the extension and the MPU6050 reference manual, then create the skeleton of the python extension from which I can add to. At first, I wasn’t very optimistic, However, with each successive prompt, my eyebrows ascended to previously uncharted heights on my forehead. In the matter of an hour, I had a fully functioning high-level analyzer that was working exactly how I pictured. The work that would have required one week and a caffeine IV drip, with the help of Claude, was finished in an hour!
If you would like to checkout the HLA extension and the full chat with Claude you can do so here!
Electrical Engineering Co-Op @ Kimberly-Clark | EE Junior @ UW-Madison | STEM Posse Scholar
7 个月Relatable post
Senior Technical & Executive Recruiter hiring at Silicon Labs
9 个月You made this fun to read. Keep it up!!