Monthly Archive: October 2014

MPU-6050 6-axes gyroscope and accelerometer 113

Library 43- MPU-6050 6-axes gyro and accelerometer for STM32F4

MPU-6050 is a 3-axes accelerometer and 3-axes gyroscope MEMS sensor in one piece. It can also measure temperature. It is very cheap device but also very powerful. It can measure simultaneously three (X, Y and Z) channels for accelerometer and gyroscope at the same time with 16-bit resolution. This chip is also compatible with MPU9150, except that MPU9150 has 3axes magnetometer (or compass) included. MPU-6050 Features Accelerometer 4 selectable full scales (2G, 4G, 8G and 16G) Gyroscope 4 selectable full scales...

Servo motor 71

Library 42- Control RC servo with STM32F4

Library 42 allows you to simple connect and interface RC servo motors with STM32F4. They are small, cheap motors, commonly used for RC (Radio Control), small scale robotics and more. Servos are really simple to interface. They expect 50Hz signal on the input. According to the pulse length (duty cycle) they rotate between 0 and 180 degrees. If signal has 1ms pulse length, motor rotation will be 0 degrees and if signal has 2ms length, then it will have 180degrees rotation. Any pulse length...

STM32F4 FFT example 147

STM32F4 FFT example

As you maybe know, STM32F4 is Cortex M4 with DSP instructions. This allows you to make a FFT with a few simple steps. For that purpose, I have made an example, on how to create FFT with STM32F4. I recommend use my FFT library for future use. It is built on ARM DSP library with everything included for beginner. When the ARM company issued Cortex-M4 core, it also published DSP libraries for mathematics and other stuff. And there are also...

Library 41- STDIO implementation for STM32F4 11

Library 41- STDIO implementation for STM32F4

After I made a tutorial on how to use printf with STM32F4, I decided to make a library for printf and other functions that are able to output data to the stream. This library allows you to basically use unlimited different output streams, but just one can be use with printf at a time. You can use other output functions, like fprintf, which accepts stream pointer as parameter to know where to output data. Library Features Output strings using printf...

Use printf to output stream on STM32F4 46

Use printf to output stream on STM32F4

It would be nice, if you can simply just use printf to direct output strings to USART, LCD, etc. With ARM C, you are able to do this. You just need to implement some things and you are ready to work. New STDIO library is available here. To enable printf functionality, first you need to create a new __FILE struct. This struct is then called with FILE struct. It can have only one dummy parameter, but it has to be created, because...

Library 40- Output clocks from STM32F4 14

Library 40- Output clocks from STM32F4

STM32F4 has capability to output different clocks on specific 2 pins. You are able to output clocks in original frequency (no prescaler) and also with prescaler values 2, 3, 4 and 5. 2 pins are used to output different frequencies. They are not able to output the same clocks. You can output: MCO1 HSI: High Speed Internal oscillator, 16MHz RC HSE: High Speed External oscillator, or External User clock LSE: Low speed, 32768Hz oscillator or ceramic resonator PLLCLK: Output clock...