Microcontroller architectures for real-time control and regulation
Many control and regulation tasks are now performed with the help of Microcontrollers (English: microcontroller). These are highly integrated microprocessor architectures that are integrated onto a single chip along with memory modules such as Flash, SRAM, or DRAM and various peripheral units. Flash is electrically erasable and programmable and is required for storing programs and constant data. SRAM (static RAM) or DRAM (dynamic RAM) is needed as chip-internal memory for variables and the stack. However, DRAM has the disadvantage that its contents must be refreshed cyclically via a refresh logic; this takes time. Various peripheral units are needed, for example, for communication with other electronic control units (ECUs), reading sensor signals, or generating output signals via simple and complex timer units (e.g., for controlling and regulating motors). 
Figure 1: Microcontroller architectures:Single-core microcontrollers and multi-core microcontrollers The microcontroller software is adapted to the specific characteristics of these modules. Embedded development tools and microcontroller boards (e.g., starter kits) are used for embedded software development.
Embedded programming languages Embedded C (EC) and Embedded C++ (EC++)
The ANSI C standard specifies for the C programming language Keywords and their usage are defined. For embedded systems, the tool manufacturer may add special extensions to precisely define, for example, which peripheral control registers should be addressed and how. This programming language with these extensions compared to ANSI C is called Embedded C. For object-oriented software development, an embedded variant of C++ is used, known as Embedded C++ (EC++). In low-level programming, language extensions allow for the consideration of architectural and timing aspects; this enables the implementation of real-time behavior requirements.
Real-time as the basis for the precise processing of software
The definition of real-time in a control system determines the behavior so that specific times and time limits are precisely adhered to. A distinction is made between soft and hard real-time. Soft real-time guarantees adherence to time specifications in most cases, whereas hard real-time must guarantee adherence to time limits in almost all cases. In microcontrollers, peripheral events are synchronized with the central processing unit (CPU, also known as microcontroller unit – MCU) via an interrupt controller or a DMA controller (direct memory access controller).
The individual phases of embedded project development
A foundation for a successful project is, first and foremost, knowledge of how and to what extent the Project requirements (project requirements) must be determined so that all project-relevant aspects are considered when selecting the appropriate microcontroller and developing the software. Nothing should be overlooked during software development, neither functional nor non-functional requirements. A great deal of money and time can be saved by clearly defining the Software architecture (software architecture) saves resources. For example, if software modules are equipped with clearly defined interfaces, they can be tested more easily. A successful software development strategy leads to the development of reusable software modules. In addition to knowledge of microcontroller architecture, this requires very good programming skills in Embedded C (EC) and Embedded C++ (EC++). The use of structures and pointers is a central aspect. Peripheral registers and project data can thus be mapped to suitable structures. In the program code, functions are used to access the elements of the structures. Pointers to the type of structure are required as parameter interfaces. The different access times of the available memory areas depend on the type of connection to the CPU executing the program. Therefore, functions and data structures must be placed (located) in the correct position in the address space according to the chosen microcontroller architecture and the specified real-time requirements of the application.
System requirements determine the microcontroller selection: single-core or multi-core.
The Microcontroller selection The choice of microcontroller (MCU) depends largely on the system requirements. These requirements determine the scope of the program to be processed, the communication methods required via serial interfaces, the type of sensor signals to be read and evaluated, and how many motors or actuators of which type are to be controlled. The required processing power (measured in MIPS: million instructions per second), the size of the required on-chip memory, and the number of port pins to be used determine the microcontroller best suited for this application. The options are single-core microcontrollers (containing one processing core or CPU) or multi-core microcontrollers with multiple processing cores. To determine the correct type, all relevant system requirements that the control system should or must meet must first be defined. This includes the communication requirements, the number and type of input signals (e.g., analog or digital sensor signals), and the output signals to be generated (e.g., pulse-width modulated signals – PWM – for controlling actuators/motors). From this information, the requirements for the microcontroller to be used can be defined. These include, for example, the number of inputs and outputs (I/O ports), the required communication modules (CAN, SPI, FlexRay, Ethernet, etc.), the required processing power of the CPU (central processing unit), and the required memory sizes of flash and RAM. The correct selection of the microcontroller type determines the costs and ultimately the success of a project. In addition, and appropriate to the microcontroller, the necessary development tools, such as compilers, linkers/locators, and test tools, such as debuggers and test tools for white-box and black-box testing, are selected. 
Figure 2: Microcontroller architectures:AURIX Multicore Microcontroller
New project challenges with multicore for software architecture and software design
The use of multicore microcontrollers presents many new challenges for software architecture and design. This is because multiple cores can access shared resources, such as data memory (SRAM), simultaneously. Therefore, the software architecture must clearly define which core should have private partitions in global memory and which cores should be used jointly (e.g., for parameter passing). To prevent inconsistent data access, the system designer must define a multicore-capable memory architecture and read/write access rights in a Memory Protection Unit (MPU) for individual tasks across the different cores.

Figure 3: Microcontroller architectures:Use of shared memory in multicore microcontrollers
The ideal starting point: Microcontroller seminars, training courses, workshops and tutorials
While there are tutorials from component and tool manufacturers on individual topics, these only cover selected aspects. MicroConsult's training courses present the interrelationships that help you gain and maintain an overview of your project. For successful embedded system and software development, it is recommended to acquire proven programming techniques and skills through workshops and seminars offered by competent training and coaching partners.
Microcontrollers: Multicore, Singlecore, Peripherals – Training
Do you want to bring yourself up to date with the latest technology? Then find out more here Regarding training courses/seminars/workshops and individual coaching sessions offered by MircoConsult on the topic Microcontrollers.
Microcontroller Coaching
MicroConsult's coaching services offer the significant advantage that our experts directly contribute their knowledge and experience to your solution process, thereby directly impacting project success. Together, for example, we analyze the potential applications and benefits of new software engineering or management methods, develop concrete implementation measures, and then put them into practice. Coaching: Microcontrollers Training & coaching on the other topics in our portfolio can be found here. here.
We deliver our content to you through both in-person and live online training sessions.
Microcontrollers – Expertise
Valuable expertise on the topic Microcontrollers stands here Available for you to download free of charge. You can find expertise on other topics in our portfolio here. here.
