ChipKIT is an excellent substitution board for Arduino. It offers better performance as it is based on a PIC32MX320F128 microcontroller based on 32-bit architecture. The microcontroller has 128K of Flash and 16K of SRAM onboard. Having Arduino Uno shape factor, ChipKIT offers more than 42 programmable pins. ChipKIT, like Arduino, can be programmed with a bootloader that communicates to the PC through USB-to-USART converter chip FT232RQ. Digilent has developed an STK500v2 based bootloader that works on PIC, so it is easy to program using the AVRDUDE tool. Besides that, they adapted an Arduino environment to work with ChipKIT boards. It’s called Mpide. It also supports Arduino boards, but it aims to program ChipKIT boards. Programming experience is pretty the same as for Arduino, and even most of the examples written for Arduino work on ChipKIT. This is true since there are no specific hardware elements touched like program memory or EEPROM. As you know, Arduino is rich in hardware support libraries as all shields are designed for Arduino. Latecomers like ChipKIT, even if they are hardware compatible, may have some difficulties with library integration due to the different architecture.
These things happen all the time. When you start a new project but from the beginning start feeling that it’s not what you wanted. Usually, they end up collecting dust. I think there is nothing shameful because it is better to fail than do nothing. There are thousands of examples where people start new projects with enthusiasm, but they never reach the daylight. But without those efforts, we wouldn’t see other great projects and products. Not all of them are made from the first try. It’s been over a year since the announcement of the AVR DDS3 signal generator. As you have noticed, there is no progress so far on it. And I am going to give up on it for a couple of reasons. From the beginning, I didn’t feel comfortable with it.
Finally, some updates on the AVR DDS3 signal generator. The 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. The second Atmega88 is gonna be used for signal generators only. This will give un-interruptable signal output while changing parameters or simply doing signal sweeps.
STM32F103R board is a simple and easy development board to learn STM32 microcontroller programming. Its heart is an STM32F103RBT6 ARM Cortex-M3 microcontroller with 128K of Flash and 20K of SRAM memory. It can be clocked at the maximum 72MHz frequency and considered a medium-density performance line microcontroller. Other features include USB, CAN, seven timers, 2ADCs, and nine communication interfaces. The Development board has several excellent features to get started. First of all, it has an RS232 interface for communicating and accessing the 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 a J-Link adapter. Two pushbuttons and two programmable LEDs are hardwired to MCU pins alongside all I/Os connectors.
The 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 at a 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 can we 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 wintertime when Sun shines. I decided to go simpler. I need hot water only in spring, summer, and fall. In the wintertime, I burn wood to heat the house and so water. I usually boiled water using an electric boiler in the summertime, which generates excellent bills at the end of the month. No more… So I started this project, which is still in the testing phase. But seems to work fine. Let’s go through the build process to make a simple solar collector using…
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 the existing code found on the internet, originally developed for the STM3210E board. Only minor modifications were needed, like assigning the proper control pins.
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 their library functions that allow sending formatted data streams. Arm GCC toolchain comes with the newlib C library from Redhat, so it isn’t specially designed for the 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, so 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 noticed that it was written for STM32 Discovery. I named it newlib_stubs.c and placed it in the startup directory. Among system functions implementations like _write(), _fstat(), etc., there are also USARTs assigned to standard streams:
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 an advanced interrupt system that is pretty easily manageable. All interrupts are controlled inside Nested Vectored Interrupt Controller (NVIC), close to the Cortex core, to ensure low latency and robust performance. Main features of NVIC include:
Last time we have made a good starting point with setting up a project template for the STM32F103ZET6 development board using GNU tools. Using the same project template, we can move forward and start programming other elements. This time a quick note about adding a button library. This is a modest implementation that initializes port pins and then reads their status. The Development board is equipped with four user-programmable buttons named WAKEUP, TAMPER, USER1, and USER2. We will not care about the meaning of names; use them as general-purpose buttons for now.
The LPC2148 development board is a mighty board with an ATM7TDMI series microcontroller considered an old guy compared to Cortex ones. But still, these are widely used and are powerful. The Development board has some handy features installed. 12MHz crustal allowing to run the processor at full 60Mhz speed. Couple RS232 ports, VGA connector, PS/2 connector for keyboard or mouse, 20-pin JTAG, SD/MMC slot, USB B-type, 8 LEDs driven with a serial-in parallel-out shift register, 2×16 LCD, buzzer, audio jack with an amplifier, two programmable buttons, and 256Kb of I2C interfaced EEPROM. The microcontroller itself has 512KB of internal flash and 32+8KB of RAM. All ports are accessible, and any external hardware can be disconnected with jumpers. This is a great board for prototyping and end application.