AVR DDS3 boards have arrived

Finally some update on AVR DDS3 signal generator. Circuit is practically done and PCBs are made. I decided to go with two microcontrollers on board to make it more functional. One microcontroller Atmega328P is gonna be dedicated to user interface and signal generator control. Second Atmega88 is gonna be used for signal generator only. This will give un-interruptable signal output while changing parameters or simply doing signal sweeps. Simple keypad should be convenient for entering frequency values and menu navigation.

Continue reading

Project demo on STM32F103RBT6 using GCC

STM32F103R board is a simple and easy development board to learn STM32 microcontroller programming. Its heart is STM32F103RBT6 ARM Cortex-M3 microcontroller with 128K of Flash and 20K of SRAM memory. It can be clocked at the maximum 72MHz frequency and is considered to be a medium-density performance line microcontroller. Other features include USB, CAN, seven timers, 2ADCs, and nine communication interfaces. Development board has several nice features to get started. First of all, it has an RS232 interface for communicating and accessing bootloader. There also is a USB 2.0 full speed interface connector that also can work as the power supply. Next is a JTAG connector to program microcontroller using tools like J-Link adapter. Two push buttons and two programmable LEDs are hardwired to MCU pins alongside all I/Os connectors.

Continue reading

Harvesting energy with home made solar thermal collector

Nearest star from Earth is Sun. And it emits a massive amount of energy which is free. No surprise many people try to get most of it with minimal cost. Photovoltaic solar panels still have low efficiency and yet are quite expensive. Every day we hear how their effectiveness is increased by introducing new technologies. Anyway, solar panels require direct Sun which in some regions doesn’t appear very often. So how we can get this energy with almost no initial cost? The easiest way to do so is to build a solar thermal collector. You can find lots of high efficient commercial collectors. They look great and at some level works in the winter time when Sun shines. I decided to go simpler. I need hot water only in spring, summer, and fall. In the winter time, I burn wood to heat the house and so water. In the summertime,…

Continue reading

FreeRTOS on STM32

A high-density line of STM32 microcontrollers has quite a bunch of features that can be used in user programs. The more features you add to source the more complicated program becomes and this way it starts to be difficult to keep up with all things. Using an only main loop and interrupts becomes a time-consuming task to manage. If you don’t want to struggle in tuning things up manually, you can use one of much real-time operating systems (RTOS). They are great when you need lots of separate functions to run in parallel so no task would be missed. RTOS scheduler takes care of giving each task a decent time to perform. There are lots of great RTOS systems around. Many of them are free and opensource. It happens so that I love using FreeRTOS which has a quite long history and is flexible enough to fit multiple types of…

Continue reading

Driving Graphical LCD with STM32F103ZET6

STM32F103ZET6 board comes with 3.2 inches graphical LCD which features an ILI9320 controller. Equipped LCD is capable of displaying 252144 colors when driven in 18-bit mode. We are going to run it in 16-bit mode, so we are limiting it to 65K colors. LCD driver is based on existing code found on the internet which was originally developed for STM3210E board. Only minor modifications were needed like assigning right control pins.

Continue reading

Connecting STM32 USART to standard I/O streams in GCC

In many situations when working with STM32 microcontrollers, you will want to output text strings. There is no need to write specialized functions that output specially formatted strings as it is hard to keep up with various cases. It is convenient to use standard I/O streams and its library functions that allows sending formatted data streams. Arm GCC toolchain comes with newlib C library from Redhat, and so it isn’t specially designed for embedded toolchain. To use stdio functions we have to take care of several syscals so-called “stub functions.” These functions usually are provided by operating systems like you would write C programs in Windows or Linux. In our case, we aren’t using any OS, os to avoid error messages while compiling we have to provide these function declarations where most of them are dummy implementations. It’s not something new pick one that you find on the internet. I…

Continue reading

Interrupt based button read on STM32F103ZET6 board

In the previous example, we implemented a simple demo program that reads buttons by continually checking their status in the main program loop. This isn’t an efficient and convenient way to do that. Imagine your application has to do lots of tasks, and in between, you also need to check button status – mission becomes impossible unless you use interrupts. In this part, we briefly introduce to STM32F10x interrupt system and write example code where LEDs and buttons are serviced within interrupts. ARM Cortex-M3 microcontrollers have advanced interrupt system that is pretty easily manageable. All interrupts are controlled inside Nested Vectored Interrupt Controller (NVIC) which is close to the Cortex core to ensure low latency and robust performance. Main features of NVIC include:

Continue reading