CycleOps Pro300 PT to ANT+, Part 7, V1 is back with better software

I’ve received several requests for updates on the V2 hardware. I’ve had a breadboard version of the V2 sitting on my desk for months. I haven’t yet found the advantages of the ESP8266 processor enticing enough to make new PCBs and deal with the new headaches that will come with trying to get everything working as well as it was on the ATmega32U4.

Back to the development on the ATmega32U4, I went off to find a solution to the memory issues. The power meter conversion code is relatively small, the majority of the space was being consummed by the library for the OLED display, while very nice to have it isn’t really needed for the device to function. At the time I was using Adafruit_SSD1306 an excellent library that includes test and image support. For what I was going, text only was just fine. Hunting around GitHub and Google I found the very well designed SSD1306Ascii. While not a drop in replacement for the previous library do the conversion over took me a few hours and memory usage went from close to 90% where I was dealing with random reboot and odd issues to a much more comfortable 44% of program memory being used. Solution found, time to move on to the next issues.

I prefer to bike outside whenever the weather allows but with December here on the East Coast of the US mother nature doesn’t always allow for that. I’ve been using the CycleOps bike with Zwift just about every day and have started to see random spikes of both power and cadence on my plots. This was unacceptable.

I wish I could put out 1000+ watts

Near the beginning of this project I purchased a Saleae Logic 8 logic analyzer. This has turned out to be one of the most valuable tools in my collection of electronic debugging. For a data packet with no noise we can see that the shortest time for any single bit of data is 1.57ms. Any time a bit is less that this we know that must be an error bit

Data Packet with no errors

Looking for when a high signal is <1ms I was able to find a packet with a glitch.

Data Packet with glitch that was causing spikes

Now that the glitch had been identified I was able to write code to check if a data bit was being read while a glitch occurred. If this happened the code will not update power or torque and will wait for the next data packet. The disadvange of this is that power and torque will be updated at a 2 second interval when a glitch is detected rather than the standard 1 second of each packet. This was a minor price to pay for power and cadence data that is spike free. All of these changes can be found in the GIT Repository CycleOpsPro300PTtoANTPlus

Copyright blinkyme 2023
Tech Nerd theme designed by Siteturner