MicroPs Week 10 Reflections

reflection
The End of the Labs (almost)
Author

Jordan Carlin

Published

November 8, 2024

The end of the labs is at hand. It’s hard to believe that I am nearly done with the labs. I made a lot of progress getting caught up on my backlog oif labs this past week. I went back and fixed up lab 4, did lab 5, and nearly completed lab 6.

Wit lab 4, I had mostly finished it several weeks ago. There was just one problem: my songs played at half the expected tempo. The strange things about this was that they had the same frequency, which seemed to imply the issue was in my delay timer and not in the main clock generated by the PLL. After lots of fruitless searching and attempts to correct the problem, I decided to very carefully review my PLL RCC configuration, and there it was. I had shifted all of my bits for one of the PLL registers over by one to the right, so the clo0ck was running at half the expected speed. The reason this had slipped by me was that I also had a misconception (possibly because my frequencies were initially wrong, I no longer remember) in my frequency configuration and thought that I needed to divide one of the values by two that really shouldn’t have been divided. This resulted in me getting the right frequency and masking my main error.

Lab 5 was an interesting one. Once I was familiar with how interrupts work, it really wasn’t all that bad. I had some issues with the specific configuration of a few items, but was generally able to get this one up and running fairly quickly and painlessly. Lab 6 on the other hand has proven to be a nightmare. After countless hours of the WiFi network from my ESP coming and going, I found out that for some reason the CE signal needs to be tied high or the network is not broadcast. However, after doing this the ESP no longer seemed to be communicating with the MCU properly. The MCU was convinced that it was not receiving any requests from the ESP, despite the transmission clearly coming across on the UART line when viewed with a logic analyzer. This is still an unsolved issue with no clear solution. Looking in the debugger, the UART registers all seem to be configured correctly and the data is reaching the MCU, but for some reason it is not being recognized. For now we are declaring this a lost cause and moving on. I might revisit it later, but my plan to wrap up lab 6 is to skip the ESP and just get the MCU communicating with the temperature sensor and view the SPI packets on the logic analyzer (and maybe using a printf statement to view them in the debugger).

Looking forward to putting the finishing touches on these labs and moving on to focusing my energy on our final project. More to come on the progress we’ve made with out final project in my next post.