Input

I am making a board that reads orientation data from IMU, which is a part of my Final Project. The course website listed a couple of options, but I settled down on the BNO055 which has embedded sensor fusion. Following the course example, I made a new board with the ATtiny1614 board. For previous boards, I used the ATSAMD11C, where I needed to bootload the board. This time, per the TA's advice, I don't need to bootload with the ATtiny boards. However, I was quite confused with the purpose of having separate serial communication for read and programming: FTDI-Serial for serial read and UPDI-Serial for programming the board. Then I realized UPDI talks to the UPDI pin, where as FTDI connects to the (TX,RX) pins. To save time, I bought two USB-FTDI adaptors. For connecting to the BNO055, I used a 2x2 JTAG header to save space, but this became a problem later on, which I will discuss later.

Just as I thought I was ready to mill, on the mods interface, some of the traces did not show up. I realized I should have set the design rule where each trace is min. 0.5mm. An example of the design checks looks like arrows marked on the path. The only inconvenience with the checks is that the underlayer poops of traces all need to be cleared...

The milling process went pretty smooth. When I needed to pick up the parts, I realized we were out of ATtiny1614, but we do have ATtiny1624, which thankfully share the same footprint as the 1614. As I was soldering, I accidently mistaken the capacitor pads for the headers and in the process of removing the headers, I ripped of a little bit of the copper trace. I was in a panick, thinking that I would need to remill the board. Zach saved my day by perfroming a surgery: using a ultra-thin copper wire to bridge the traces. Bless! I also milled out the UPDI-Serial board provided by Neil.

After assembling everything, now it's time to test out the board. I followed this tutorial made by Adrian Torres to install the cooresponding library like MegaTinyCore. I also need to setup the updi toolkit for Arduino.

The board is running! The echo file can be successfully loaded. Now it's time to connect the IMU (BNO055). Following Adafruit's tutorial , I downloaded the appropriate library and used the example code "sensorapi.ino". Of course nothing is smooth sailing in this class. The adafruit code wouldn't compile for the 1624. The error message was also not helpful. I dug layers deep to the libraries, cpp files, and header files to find the error but had no hope. Just to make sure nothing went wrong with the board, I tested the BNO055 on the Arduino and the code did compile. After many...many hours of Internet searches, Cedric found this life-saving amendment to the codebase. The key is to modify the new.h file and include the following lines (see screenshot). Boom, now the code compiles!

Now we enter the next phase of the debugging saga. When I connected the BNO055 sensor, the sensor could not be found. This tells me something is wrong with the i2c set up. For the next 72 hours, I had both extremely talented TAs, Eyal Perry and Cedric Honnet, looking at this problem. (Major thank you to both for staying up so late with me and not giving up TAT). We tried a number of things, checking the i2c address, bit banging, scrapping random pieces of code to set the address in Hex. Nothing really worked. After much despair, Cedric suggested that we check the wire connection and continuity just as a sanity check. Remember I mentioned the 2x2 JTAG connector would be an issue? Turns out that was the problem all along. Both because of the color of the wires and the awkward arrangement, I got the wires mixed up -- I accidentally connected power to SDA. Boom, that was it. The BNO is happily spitting out orientation data.

Cedric also showed me how to use the digital analyzer with the Logic 2 software. Basically it's a digital oscilloscope that can tell you what is being transmitted. Quite a handy tool. Here are two screenshots from analyizng the TX and RX of the processor talking to Serial. We can actually tell where we are in the package and compare that with the BNO datasheet. Super cool!