Today Sibille and I made great strides on the bare-metal code for the led-driving processors.
Yesterday we left off unable to see the PWM outputs on the processor pins. Today we started by remedying an oversight: we set about configuring the clocks.
On top of that, it turns out that yesterday we didn’t pay enough attention when reading the documentation for the board: the documentation includes pinout information for other boards with other processors, and we were looking at the wrong processor…
We were then able to use a Saleae Logic analyser to observe the PWM output. At first, the frequency was off, and we spent much time looking at our clock configuration before realising that the timer prescaler didn’t behave in the way we expected (it turns out that frequency division ration if the prescaler value plus one, which is a neat way of avoiding a “division by zero” type of situation).
We then used an interrupt triggered by Timer 1 to cleanly turn off all the outputs after a given number of repetitions.
We checked each PWM output, and while most work as expected, there are still a few issues: we can’t detect the outputs for Timer 1 and Timer 9. These are the only ones on GPIO E and on the bus APB 2, so we’ll start by looking there. We know that Timer 1 at least is running, because we use it to trigger an interrupt. We’ll keep looking.
Meanwhile, Vlaya is working on sending SPI frames from the main board (with a STM32H743). As soon as she’s done, we will also test our code for SPI reception and keep you posted !
While we were discussing some code issues with Alexis, he suggested to generate the code directly with STM32CubeMX.
So we used it to check our clock initializations and will use it to correct the future mistakes we make in our code. However now that we’ve written all this code we don’t want to throw it away to use STM32CubeMX’s auto-generated code, at least for our tests.
Today, we also spent a lot of time trying to solder wires on our ball bearing. To ease this task, as explained here, we use 2 tubes: one inside the ball bearing in copper, the other one surrounding it in brass. This whole structure is isolated from the fixed base by a 3D-printed case.
Karim (him again !) helped us solder the wires because we had never used hot-air soldering before. But we later accidentally disconnected a wire during the assembly process, so we had to redo it on our own. Here is a picture of what it looks like:
Though, we couldn’t test the power transmission because we forgot the isolating tube in the mechanic workshop. We’ll try it as soon as possible 🙂