Development environment

Embedded development environment

This project will be using 8-bit Atmel AVR microcontrollers, simply because they’re what I’m most familiar with. Am developing in C using the AVR port of the GCC compiler.

Initial development was started on an ATmega168 on an Atmel STK500 development board, which provides dual serial ports (programming & application comms), plus leds and buttons for testing. I think it’s fair to say this board is a bit out of date, I suspect most people these days would just opt for an Arduino. The plan is to migrate to an AVR with native USB support for the next prototype, such as the ATmega32U4.

So far, the development on the embedded side has just been a couple of test harnesses. The first receives a number between 1 & 100 over the PC serial link, and sets the cable position accordingly. The second receives the Golden Cheetah real-time training messages, and passes back the button status.

Golden Cheetah development

Adding the new device support to Golden Cheetah was probably the area I was least confident about, but has been going reasonably smoothly (after the usual head scratching when looking at a complex new code base for the first time!). I imported the project into the Eclipse IDE, which has been a big help with following and debugging the code execution.

The new code is based on the existing Comptrainer and Fortius classes, which were fairly easy to get to grips with. I suppose the main difference is that instead of all the usual telemetry being retrieved from the trainer, it’s being retrieved from another real-time source and sent to the trainer (where it can be used by the firmware for the resistance calculations).

Currently, am just working in a local git repository, but when things are a bit more stable, I’ll create a fork on GitHub and push my branch there for more visibility.

Calibration

With the high level motor control and communications code falling into place, probably the next thing to consider is going to be the mapping between GC requests for load/slope and the selected resistance. Next post will cover some first stabs at calibration & creating a speed/power/resistance map.

Advertisements