To make everything easier to follow, I will show you some essential concepts about Microcontroller Programming today.
1. What are typical thing inside an ARM Cortex-M4 microcontroller?
- First is the most important part, a processor
- In many microcontrollers, the processor takes less than 10% of the silicon area, and the remain things are:
- Program memory (e.g., flash memory)
- SRAM
- Peripherals
- Internal bus infrastructure
- Clock generator (including Phase Locked Loop), reset generator, and distribution network for these signals
- Voltage regulator and power control circuits
- Other analog components (e.g., ADC, DAC, voltage reference circuits)
- I/O pads
- …
2. Material
To start the development, you need to prepare at least these thing:
- Development suites: the development suites range from open-source free tools, to budget low-cost tools, to high-end commercial packages:
-
- Keil Microcontroller Development Kit (MDK-ARM)
- ARM DS-5 (Development Studio 5)
- IAR Systems (Embedded Workbench for ARM Cortex-M)
- Red Suite from Code Red Technologies (acquired by NXP in 2013)
- Rowley Associates (CrossWorks)
- Texas Instruments Code Coposer Studio (CCS)
- Atollic TrueStudio
- …
-
With more than 10 different vendors selling C compiler suites for Cortex-M microcontrollers, deciding which one to use can be a difficult choice. But you don’t need to worry, Keil Microcontroller Development Kit is very enough for Microcontroller Programming and event ROTS programming.
- Development boards: there are already a large number of development kits for Cortex-M4 microcontrollers from various microcontroller vendors and their distribution. In this tutorial, I choose STM32F411E-Discovery Board to help you understand the essential thing inside a ARM Cortex-M4 controller in short time.
You can buy it very easy with not too high price (600 000 VND) for one board with almost everything to start.
- Debug adaptor: debug adaptor functions allow you to download program code to the microcontroller, and to carry out debug operations like halting and single stepping.
ST-Link and ULINK debuggers above are the most typical tools for all microcontroller programmer when work with ARM cortex. However, STM32F411-Discovery Board help you to save amount of money by providing a ST-Link embedded inside.
One more compelling reason to choose this board to start the development.
- Software device driver: the term device driver here is quite different from its meaning in a PC environment. In order to help microcontroller software developers, microcontroller vendors usually provide header files and C codes that includes:
- Definitions of peripheral registers
- Access function for configuring and accessing the peripherals
By adding these files to your software projects, you can access various peripheral functions via function call and access peripheral register easily.
- Example: help you to understand and start everything fast, https://stm32f4-discovery.net/ is a good channel for you, also my blogs 😀
- Document and other resource:
- Schematic: STM32F411 Discovery Board
- Datasheet: STM32F411VET06 chip
- Application note: http://infocenter.arm.com
- Other equipment: depending on the applications, you might need additional hardware that interfaces to the development board
- LCD: display information to user
- Logic Analyzer: investigate signal data of UART, I2C, SPI, CAN, … protocols
- Sensors: temperature, humidity, atmosphere, accelerometer, … to receive information from enviroment
- Actors: motors, robot arm, switch … to do the action that commanded by processors
- Communication devices: WIFI, GPS, BT, RADIO … modules are very interesting devices to make your application becomes useful in real life
3. What should we do next?
Let prepare those above thing as much as possible, it will save your time when building your application with Arm Cortex-M4 and STM32F411 Discovery board after that.
Next post I will show you the process to build an microcontroller software.
4. Reference document
The content in this post is triggered from The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors.
Thanks author Joseph Yiu very much for a great book.