Firmware Flowchart. More...
Modules | |
Device Start Up | |
Device Start Up. | |
Main Loop | |
Main Loop. | |
Functions | |
int | main (void) |
Application main function executed after device comes out of RESET. More... | |
Firmware Flowchart.
Firmware Task Scheduling
The SMPS Firmware Framework used in this application is organizing high and low priority tasks by a very simple task scheduler providing one common low-priority task level executed on priority level #0 and one high-priority task level executed on priority level #2. The interruption of processes on priority level #0 is enforced by a programmable timer. During system startup, the timer is set to overrun every 100 us, providing a stable high-priority task execution frequency of 10 kHz. All low-priority tasks are only allowed to run after all high-priority tasks have been completed. The real-time control system takes the highest priority within the firmware. This is ensured by using hardware triggers generated by the PWM signal generator logic with its high resolution time-base. The extremely short and optimized control loop code is implemented as monolithic Assembly routine to be most deterministic. Being triggered directly by the switching signal waveform generator, the execution is tightly coupled to the physical power conversion process and also independent from any other software process of the firmware.
int main | ( | void | ) |
Application main function executed after device comes out of RESET.
This function is the starting point of the firmware. It is called after the device is coming out of RESET, starting to execute code. The startup sequence is as follows:
1) SYSTEM_Initialize:
a) Configures the fundamental system components such as
Fundamental components are peripherals which are essential for the CPU to run, such as
b) User-defined Peripheral Module Configurations
This hardware requires some specific peripheral modules to support circuit functions, such as
2) Software Modules Initialization
This application executes five tasks simultaneously:
Each 'Task' is an independent process which is called at a constant execution frequency. The default frequency (OS base clock) set in this code version is 100 us (= 10 kHz). Tasks may slow down their individual execution rate by using internal counters to be executed as integer multiples of the OS base clock.
Definition at line 80 of file main.c.