Pages are not fully translated for the English language.

Latest posts

Control Unit

Control Unit

The problem of lack of space is pungent for all small models. Since I manufacture almost all the peripherals by myself, they take quite enough space. All my processors are not small as well. Thus, I have been continuously shrinking all my peripherals. But everything has its limits.

I told myself to get some smaller processor for my peripherals. I wanted it to be based on similar architecture that I currently use (ARM, STM32). I found a company mikroe that sells small board with STM32F4 processor. I liked in instantly. It had enough pings and peripherals outputs. But there were 2 problems: First, the board was not available in my country. Second, it was quite expensive. Problem 1 was solvable, the second one only painful.

Then I though, that having a small processor I should build also small peripherals. Design of the board for lights and servo motors control was quite simple. I used my favourite 74HCT541 bus driver (I use it as a 3.3V to 5V converter). But I am not capable to build small h-bridge to control motors. Nevertheless, I managed to find Pololu driver (DVR8835) that suits both by dimensions and parameters. Again, it was not available in the Czech Republic but it was cost effective.

I designed and created a second board for the two DVR8835 modules. The second one is also equipped with all the remaining pins of the processor.


I have not anticipated the difficulty to make the processor actually work. I started quite standardly. The first goal was the output pin – light up a LED. But, the board has no debugger and Mikroe does support only its own compiler and ides. Thus, I had to deeply study all available materials, datasheet and hugely use my common sense. The most difficult was the initialization and start up configuration. This includes clock, clock dividers and peripherals. Everything without debugger using only output on pins.

Making the diodes blink was half of the battle. As the second step, I tuned exact setting of different divider to set requested CPU clock and to create interrupts to calculate system time. Then, I continued in settings of the peripherals and busses – PWM, USART, etc. The last step was to put the ADC into operation using DMA.

Finally, everything went well and I created a library for my control unit that configures, initializes and controls all the peripherals. And what does it do? It handles XBee communication, controls 4 LED outputs, 4 motors and 4 servos. Further, it manipulates with 13 pins, where 9 can be used as ADC and 4 more as a timer (e.g. PWM).

Pictures, schemes, videos

Click the image to show it in higher resolution
Printed PCB for ironing
Bought peripherals
Soldered strip pin
My own peripherals etching
Tunning part for 4 lights and 4 servos
Separate parts of the control unit
Control unit, side A
Control unit, side B
The final test
Eagle software scheme

Source codes

Click the label to show the source code
libF4Mini.c: main file
libF4Mini.h: headers file

Back to Robotics STM32.