You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

8h 51m 47s logged

I am proud to announce that after 9 hours of coding, I have… still not solved the SECOND MOST EVIL FUCKING BUG I HAVE EVER ENCOUNTERED IN MY ENTIRE LIFE.

the rundown of my project is that I am making an entirely custom mouse. I started this way before stardance, and by the time it started I already had the PCB designed + ordered and a bluetooth mouse connection working. I began logging time around when I started implementing the motion tracking on the mouse sensor through SPI.

communicating with the sensor through SPI took 30 minutes of coding. The problem was the aforementioned evil ass bug I encountered after this, which was basically that the sensor kills itself every time it even barely gets lifted off of the table, and it requires a power cycle to get it back to normal operation. obviously not a very good thing to be happening in a mouse.

now here is the fun part, as I spiral into the depths of insanity:
after changing every software setting in my code that could reasonably fix this issue (sensor force awake mode, SPI transaction issues, SPI clock timings, etc), I decided to test the sensor with some old, verified working code that I had written a month or two prior. One thing to note is that my code so far was written in Zephyr OS while the working code was in Arduino, so I had to make a really jank connection to a different microcontroller board just to run it.

As it turns out, the verified working code.. worked properly. So i made more changes to the Zephyr code, and I still can’t fix the bug. At this point, my Zephyr code is basically a 1-1 recreation of the Arduino code, so I decide to test the Arduino code again to make sure I’m not going insane.

THE VERIFIED WORKING CODE STOPPED WORKING. I HAVE NO IDEA WHY STILL. THE BUG SOMEHOW SPREAD?????
this is what I meant when I said it was evil. i could feel the MALICIOUS INTENT behind this issue as it attempted to destroy EVERY LAST BIT OF MY SANITY.

At this point, I was pretty sure it was a hardware issue, so i re-soldered all the connections, continuity tested them with the multimeter, etc.
it was not a hardware issue.
IT WAS AN OPTICS ISSUE?????
the issue was with the lens that came with my sensor the entire time. I still don’t know what the exact issue is, all I know is that everything works if I take off the lens.

how exactly am I supposed to solve this??? i’m a programmer who knows some hardware stuff. i can’t debug the laws of optics. I did ask AI to help me out (can you blame me at this point?) but it was kind of stupid as per usual.

has any one of u smart people here worked with mouse sensors before??? please send help if you can thank you. I have already ordered a new lens (in case i got unlucky and the one I have is defective) and I am currently considering hiring an exorcist to purge my PCBs of evil spirits.

I was originally going to post a devlog once I got X and Y movement readings on the sensor, but as you can see, I’m a bit stuck at the moment. Another note I’d like to add is that the 9 hours I’ve spent trying to fix this is only the software debugging time. The actual time spent trying to fix this is probably more than double that. I’m too lazy to timelapse me crashing out for several hours.

attached are photos of the sensor lens and my pcb testing rig.

tldr: unfortunately, no progress has been made. evil demons are infesting my project. please send help

0
2

Comments 0

No comments yet. Be the first!