Pushing prototyping with STM32F4Discovery to new level

STM32F4Discovery board is already quite powerful and stacked with many handy features. On a single board, you can find a three-axis accelerometer, MEMS microphone, DAC with D class amplifier that can output sound through the built-in audio jack. Also, there are a couple of LEDs and a button for fast access. And of course, the core of this board is STM32F407VGT6 ARM Cortex-M4 microcontroller that packs series of great features including DSP instructions and floating point unit. But eventually, with such power, you will miss several other handy features that could be used in your project. Think of LCD, Ethernet, RS232 interface and even camera. You could start making your extension boards that include additional features, but why bother, since there already are several extension boards available for it. Let us go through them and see the features you could get without a heating soldering iron.

Continue reading

Setting up CoIDE with GNU tools

For some time I’ve been using Codebench ARM GCC tools for developing software for ARM microcontrollers. As IDE I used plain Eclipse which I had to configure by myself. It worked pretty well, and there is nothing wrong with this. Anyway, sometimes it gets a little annoying to keep an eye on configurations and manual settings. So I decided to give a try CooCox IDE which claims to be free and open. It seems that already supports all the microcontrollers I like to use. Along to this change, I am also moving to a different GCC tool collection. Codebench free tools are great, but on another hand, there are some limitations. One of them is release times. They are releasing their free tools twice a year, so updates and other improvements cannot reach as fast as you’d expect. Another thing I am concerned – disabled hard float functionality. If you…

Continue reading

You know basics of ARM. Whats next?

You’ve probably noticed that day by day more complex hardware gets closer to a user. Of course, I am talking about microcontrollers and processors. Several years ago it was a challenge to have running Linux on board. Now almost everyone has Raspberry Pi and doing crazy things. As I have noticed not many hobbyists are building their boards to get things done. There is a wide variety of ready made developing boards depending on size, speed, price that it looks not worth spending time on what’s already done. Everyone seems to be grabbing Arduino and building amazing projects. In a couple of years, enthusiasts used to crunch ARM projects like cookies. This is thanks to the choice of cheap development boards and improving free software tools. But the most critical role in this is the manufacturers. They finally noticed that hobby market could be a powerful driving mechanism. Ignoring it…

Continue reading

Bit Band operations with ARM Cortex microcontrollers

I got few questions from our readers about the bit-band feature in ARM Cortex microcontrollers. It may seem to be a prominent topic, still may lead to come confusion while using bit-banding. So let’s look at this feature a little bit closer. Why use bit band Simply speaking Bit banding method allows performing atomic bitwise operations to memory areas. Why use bit banding? The most straightforward answer is because ARM Cortex doesn’t have something like BIT CSET or BIT CLEAR commands like most of the 8-bit microcontrollers do. So this is somewhat a workaround solution. Another question may rise – Why not using the read-modify-write method? Again this method is not reliable in some cases. For instance f there is an interrupt during this operation it can cause data corruption. Other situation may occur in embedded OS when different tasks may modify the same memory location. So we want a…

Continue reading

Basic touch screen routines up and running

STm32 touch screen

STM32103ZET6 prototyping board comes with LCD having touch screen capability. It is a great way to interact with the device. Practically speaking Touch screen is a resistive film that can be accessed as a regular potentiometer which value depends on touch point. Depending on voltage drop it is possible to calculate the coordinates. There is a touch screen controller which takes most of the hard work – it has internal ADC that measures the voltage and sends a value to the microcontroller using one of the selected interfaces (I2C or SPI). In the board, there is a common ADS7843 controller used, which talks to the microcontroller using SPI. After playing around, I’ve put a messy code that reads touch screen coordinates. It is a glued code from various sources, so it is only to fix some results. Currently, the code reads a bunch of values, then averages to get rid…

Continue reading

Updating STM32 C template with CMSIS V3

So far we’ve been using an old template with CMSIS version 1.30. Since then it was updated several times by adding support of new Cortex processor families, fixing several bugs and adding new features. They also changed the folder structure of CMSIS to be more generic. And there is a CMSIS DSP library integrated. With it, you can do complex math tasks using only a few lines of code. So why not upgrading our software template for Sourcery Codebench G++ toolchain with new CMSIS. Also, we are going to get rid of external makefile with ARM GCC Eclipse plug-in. How to install and use this plugin we discussed in previous posts (part1 and part2). First of all download the latest CMSIS package from arm.com/cmsis. You will have to register to access download files. Package with CMSIS, DSP library and documentation weights about 45MB. Since we are working with ST32 microcontrollers,…

Continue reading

Setting up Eclipse to work with GNU ARM plug-in. Part 2.

Continue of part 1. First of all, let us select the proper processor type. As we are using Cortex-M3 processor, then we go to Project->Properties menu (or right click on project name in the project explorer and select Properties). First, in Tool Settings list is Target Processor. So we select processor cortex-m3: Be sure to choose settings for all configurations, so you don’t have to do this twice when selecting Debug or Release.

Continue reading