Previously we learned how to compile STM32VL Discovery projects that were included in the package. But to understand how to write our own programs, we need to get to some basics. I think the best place to start is the input and output system (I/O). Before we begin to write some code, let’s go through what’s inside STM32 ports. If you look into the STM32 reference manual, you’ll find that the I/O system is pretty flexible. Port pins can work in several modes: Input floating; Input pull-up; Input pull-down; Analog; Output open drain; Output push-pull; Alternate function push-pull; Alternate function open drain. Pins are organized as 16-bit ports that have their names like PORTA, PORTB, PORC, PORTD… Ports are 16-bit wide; they are controlled with 32-bit words. Individually each port pin can be configured to one of these functions. Additionally, each pin’s maximum speed can be set to one of the values: 2MHz, 10MHz, and 50MHz. STM32 I/Os are 5V tolerant. Anyway, the proper design should use 5 to 3.3V level converters.
ARM microcontrollers are very successfully positioned microcontrollers in the market. Billions of them are used in all areas where control, data processing, in interfacing is needed. ARM microcontrollers have evolved into a high-level product that provides high processing power with the minimum clock frequency and power usage. Practically all major manufacturers are developing their line or ARM processors that share the same standard core functionality, and variations between MCUs starts with peripherals and other external features. ARM microcontrollers are cheap and robust which makes them attractive to use in almost all applications. They are successfully taking the place of smaller microcontrollers like ARM or PIC. Hobbyists also are taking them over.