Tagged: STM32F4 discovery

Library 38- External interrupts for STM32F4 31

Library 38- External interrupts for STM32F4

A new library is here. 38th are external interrupts. This library allows you to very easly use external interrupts for your needs with just one function and function handler. I have written everything you need to start. For more informations on how external interrupts works on STM32F4 with pins and lines and so on, you should look at my external interrupts tutorial. I tried explain there everything as best as I can. I think it’s quite understandable. I will just...

Program STM32F4 with UART 14

Program STM32F4 with UART

STM32F4 devices have great feature. They can be programed with only USB to UART converter. Each device has bootloader inside, which supports UART programming. This is not very great method for Discovery boards, because they have better and faster solution on board, ST-link. But if you are working own board, then this solution can be quite nice. In this tutorial, I will go through step-by-step how to program device with USB->UART converter. I will use FTDI’s home made converter. This...

Library 35- LIS302DL or LIS3DSH accelerometer 62

Library 35- LIS302DL or LIS3DSH accelerometer

Maybe you’ve noticed one chip between four leds on STM32F4-Discovery board. This chip is accelerometer. On market, there are 2 versions of STM32F4-Discovery board. First release had LIS302DL (old board) and new release (current) has LIS3DSH device. LIS3DSH has 5 selectables full scales (2/4/6/8/16G), old LIS302DL has only 2 (2.3/9.2G). I made a simple library which supports both devices. Library automatically recognize connected device, if there is any. You just have to check which is on board, because different devices...

Library 34- STM32F4 as USB HID Device 47

Library 34- STM32F4 as USB HID Device

With USB HID Device library, you can turn STM32F4 to be a keyboard, mouse or gamepad device. It also supports all three settings at the same time. Device is shown to computer as “Keyboard; Mouse; Game controller“. This library allows you to use 2 gamepads at the same time, one keyboard and one mouse. For mouse you can use left, middle and right buttons, X and Y cursor axes and wheel vertical rotation. For gamepads, you can implement 16 buttons...

PWM graph 62

Library 33- PWM for STM32F4

I had enough of each time configuring PWM for some reason, so I decided to make a library for it. This library allows you to use PWM signal on all possible timers on all possible pins for timer. I made it for controling servos, but it can be used for anything else. PWM works in FAST PWM mode. You just set your PWM frequency, timer you will use, channel on timer and you are ready to go. If you need...

HC-SR04 sensor on STM32F4xx device 29

Library 30- Measure distance with HC-SR04 and STM32F4

I have at least 10 HC-SR04 sensors at home so I decided to made a library for it. This sensor can measure distance between 2cm and 4meters. It can produce about 40 measurements per second. His working angle is about 15degrees, On the start, you have to send 10us starting pulse at TRIGGER pin. After that, on ECHO pin high pulse is returned in relation to the distance. Large distance means large high signal. You have to give sensor some time...