Opublikowano przez Mateusz Salamon, temu

Insanely Accurate DS3231 RTC on STM32

Not everyone may know this, but real-time clocks, or RTCs, are only as accurate as their clock source. Most often, such systems are driven by a 32.768 kHz frequency. STM32 has a built-in RTC, but exactly the same rule applies to its accuracy. Generally, what STM32 offers as an internal RC oscillator for the RTC is not of the highest quality and is susceptible to temperature changes. Connecting an

(more…)
Opublikowano przez Mateusz Salamon, temu

Ridiculously Simple Hardware Encoder Handling on STM32

An encoder is a great device. You surely know some equipment where a knob would rotate endlessly while adjusting some parameter (e.g., an audio amplifier). A very nice idea to replace a classic potentiometer. Encoders are also very often used to measure the rotation angle of motors. In automation and robotics they are

(more…)
Opublikowano przez Mateusz Salamon, temu

Are an I2C Converter and an LCD a Good Match?

I often come across the statement that it’s better to connect an LCD display via an I²C expander because it “eats” only two microcontroller pins instead of a minimum of 6. It’s true that it saves pins, but as we all know—nothing comes for free. Today I’ll check for you what you need to account for when you connect an LCD over I²C using popular modules based on PCF8574 chips.

(more…)
Opublikowano przez Mateusz Salamon, temu

STM32 Has No EEPROM, But… Fortunately, There’s EEPROM Emulation (Based on F1, F4).

I remember when I wanted to use EEPROM in STM32 for the first time. Everything went great until the moment I actually wanted to use that memory. It turned out that… not all STM32s have EEPROM! Those lacking this feature are especially the F series. What to do in such a situation? You can use an external I2C/SPI chip or… emulate EEPROM in the built-in FLASH memory. Come, I’ll show you how to do it.

(more…)
Opublikowano przez Mateusz Salamon, temu Opublikowano przez Mateusz Salamon, temu

How to waggle your servo horn? ( ͡° ͜ʖ ͡°) STM32 meets a servo.

Model hobby servomechanisms, or servos for short, are a very interesting type of actuator. They move around an axis, similar to regular motors, except the rotation is not continuous. The mechanism rotates only by a “given angle.” In other words, with a servo you set the position in which it should be. Supplying voltage alone is not enough. A servo requires

(more…)
Opublikowano przez Mateusz Salamon, temu Opublikowano przez Mateusz Salamon, temu Opublikowano przez Mateusz Salamon, temu

No More Multiplexing on GPIO! MAX7219 in Action, Part 2

Recently we made a 7-segment display multiplex itself thanks to the magical MAX7219 chip. Today I’ll show you how these chips let you handle a theoretically infinite number of displays. We’re talking about the daisy-chain connection these wonderful chips offer. In a moment you’ll see how, without using more pins, you can connect and control as many displays as you want. Let’s get to it!

(more…)
Opublikowano przez Mateusz Salamon, temu

No More GPIO Multiplexing! MAX7219 in Action, Part 1

I remember how many years ago multiplexing an LED matrix was a nightmare for me. Geez… how badly I went through it. From today’s perspective I don’t understand my past self at all. It really isn’t as difficult as it seemed to me back then. Today it’s even simpler! We have specialized multiplexing chips designed for LED displays, and that’s beautiful. Let’s get cracking!

(more…)