STM32F4 Discovery

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...

Library 39- Power consumption modes for STM32F4 23

Library 39- Power consumption modes for STM32F4

For library 39, I made a low power modes library. This allows you to simple put STM32F4 into SLEEP, STOP or STANDBY mode. Point of this modes is simple. You want decrease current on device. If you are working on battery project, this will be very helpful. You can set current down to about 2uA with proper low power mode. I will tell you only the highlights of all 3 power down modes in this post. For detailed informations, check ST’s...

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...

Precise delay with counter 8

Precise delay with counter

If you work at high speed, as STM32F4 devices do (84MHz or more) then this tutorial is not right for you. But, you are able to descrease system speed to any frequency basicly you want. If you want to use delay with systick down timer, look at my library here. You can use great solution, Systick timer to make an interrups for you. But you can also decrease speed to let’s say 42Mhz, and that systick every 42ticks checks for...

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...