Simple ADC use on the STM32

Here is a bit of a look at how to use the ADC on the STM32 for simple applications. The ADC peripheral on the STM32 processor is a flexible but complex beast. The peripheral driver library should make it relatively easy to use. After all, there is no need to remember the names of all those pesky registers and bitfields. There are anything up to 18 multiplexed channels that can be converted singly, continually, scanned or discontinuously. The results can be transferred to memory through DMA and some devices have two or more ADCs for simultaneous conversions. With all those options, simple reading of an ADC port is a little tricky…

(more…)

Continue ReadingSimple ADC use on the STM32

Nokia 3410 LCD on the STM32

et-arm-stm32-nokia-lcd-1.jpgThe Nokia LCD displays are among my favourite toys. Generally, I use a monochrome display intended for the Nokia 3410 ‘phone. This a display size of 96 x 48 pixels and can display bitmaps as well as text in 6 rows of 16 characters. It is smaller than the more common 16×2 text-only displays, easier to drive, cheaper, uses fewer connections, much more flexible and is readily available. And now, I have connected one up to my STM32F103 Cortex-M3 processor. As a first go with the SPI peripheral on these processors, it has been quite instructive…

(more…)

Continue ReadingNokia 3410 LCD on the STM32

ETT STM32 ARM Stamp

et-arm-stamp-stm32-1 While I have a couple of STM32 development boards already, I was looking around for something a bit more flexible. Somehow, development kits always seem to have the wrong set of peripherals and pins I want to play with are not available. After a bit of hunting, I came across this board, made by ETT. It comes in a convenient, small size with two single rows of pins for the IO. Perfect for plugging into a breadboards for some proper playing…

(more…)

Continue ReadingETT STM32 ARM Stamp

STM32 on the Mac – The ST Peripheral Driver Library

It would be nice to start with a simple LED flashing, blinky type application. Well simple is a bit of an overstatement. The code to blink an LED is easy enough but those nice folk at ST have provided a special peripheral driver library. This library abstracts much of the hardware from the user and should make for more portable code. The library sources are all in standard C and are supposed to compile up just like anything.  Even with the benefit if an IDE, this would be a bit tricky to set up. Without one, it means a lot of messing about with makefiles, linker scripts and startup code. This is how I set up mine on a Mac. Much the same arrangement will work just fine on a PC. Included is a project template to speed things up…

(more…)

Continue ReadingSTM32 on the Mac – The ST Peripheral Driver Library

STM32 and the Olimex ARM-USB-OCD on a Mac

arm-usb-ocd As a bit of a backup to the whole bootloader thing, I bought an Olimex ARM-USB-OCD JTAG adaptor. This is a multi purpose device that provides you with a USB JTAG interface to the ARM, a USB serial port and a power supply for your target board. It looks pretty useful and is supported by the openOCD project as well as Rowley Crossworks. JTAG is fast for flash programming and pretty well a one-touch solution in Crossworks. I was quite excited when it arrived and hurried to get it set up. By now, I should know better…

(more…)

Continue ReadingSTM32 and the Olimex ARM-USB-OCD on a Mac

STM32 Arm-Cortex bootloader

One of the more attractive features or the STM32 processors, at least in their more recent revisions, is the presence of a built-in serial bootloader. JTAG is all very well but you need extra hardware and then software to drive it. If you want to do in-circuit debugging, it is ideal. However, for my use, I don’t much want a 20 pin header and I find the debugging feature for a micromouse to be a little redundant. Debugging can be done on a static test rig. But then, if I want to update the mouse software, a serial bootloader is perfect and I can use the same serial connection to communicate with my code when it is running

(more…)

Continue ReadingSTM32 Arm-Cortex bootloader

CodeSourcery GNU Toolchain for the ARM on a Mac

CodeSourcery are the maintainers of the GNU Toolchain for ARM processors. They have a range of commercial offerings but, if you are prepared to use command-line tools, they also provide just those as Sourcery G++ Lite. The Lite edition includes the GNU C and C++ compilers, GNU Assembler and Linker, GNU debugger and Instruction Set Simulator. For Windows and Linux hosts, these are available as binary distributions that simply install and are ready to use. For the Mac, you need to build them from sources available on the CodeSourcery site.

(more…)

Continue ReadingCodeSourcery GNU Toolchain for the ARM on a Mac

ARM Cortex-M3 (STM32) development on the Mac

stm32-chip

The whole ARM processor core thing is really attractive. Here is a widespread, powerful core available in a whole bunch of packages and processor combinations from a range of suppliers. Then there came the Cortex-M3 version. More interesting still is the ST processor series known as the STM32. These really are interesting. they are cheap, readily available, fast, have a peripheral set that could be made for the kind of tasks I am most interested in and you can get free or low cost development tools…

(more…)

Continue ReadingARM Cortex-M3 (STM32) development on the Mac

STM32 and the Segger/IAR J-Link

segger_j_link I finally got a day to play with some of my new toys. These are the IAR STM32-SK and the IAR J-Link debugger.The IAR J-Link is a re-badges Segger unit and I believe they are identical. I was quite excited about having a real debugger to use. – especially as programming the STM32 through the bootloader is a bit of a fiddle. Things didn’t turn out quite as I had hoped…

(more…)

Continue ReadingSTM32 and the Segger/IAR J-Link