ARM programming primer; getting the USART running
posted Nov 26th 2011 3:36pm by Mike Szczysfiled under: Microcontrollers

We find it interesting that PIC and AVR programming is very common in hobby electronics but ARM doesn’t have nearly the same foothold. This is partly because there’s a knowledge barrier involved with making the transition (the other part is probably the lack of DIP packaged chips). But if you’ve worked with 8-bit microcontrollers you can certainly make the jump into the 32-bit realm. Here’s a great opportunity to get your feet wet. This guide will show you how to get the USART on an STM32 Discovery Board working, which makes it easy to get feedback about what’s going on in your program.
One difference you’ll notice when moving to ARM microcontrollers is that there is almost always a library bundle available from the manufacturer which includes all of the functions you need for hardware control (USART, USB, Ethernet, ADC, etc.). That’s the case here, so simply including the USART library makes it a snap to finish the rest of the program. Once you hook up your communications hardware (an FTDI cable in this case) just use the library initialization functions, followed by the send and receive commands and you’ll be pushing messages to a computer terminal in no time.
If you’re trying to use the STM32 Discovery Board with a Linux box here’s a shove in the right direction.






I have recently started programming for an ARM Cortex-M3 (LPC1768). It is great to have the added processing power and peripherals, no more time spent wondering if it’s possible to cram that extra function in. Yesterday i finally managed to get it to send stack traces to a PC when it crashes, really helps debugging. I could buy a real debugger but that requires money, and i lack money =(.