UM2163
Hardware
layout and configuration
DocID030224 Rev 1
9/30
Once the information is received, the channel states are converted into 16-bit words for the
GPIO peripheral and they are stored in the embedded Flash, with the timing information.
After programming, the PC is no longer required, so the board becomes a stand-alone
device.
Different patterns can be stored and you can select the one to use at run-time.
The same MCU can implement two different solutions for real-time execution.
The first solution
involves the use of the STM32 direct memory access (DMA) peripheral,
which can transfer data from memory to any peripheral register, GPIO included, without the
intervention of the MCU core.
To trigger DMA transfer, a general purpose timer is used, that works at the system clock
frequency and basically acts as a counter: the reload value (the value at which the counter
returns to zero) is stored in the auto reload register (ARR).
The timer triggers two different DMA channels in two different moments:
•
the first channel is triggered at each reload event and transfers the new GPIO word to
the ODR;
•
the second is triggered at a constant time after reload and transfers the new duration
information to the ARR
The timer preload feature is enabled, so that the new ARR value is effective only at the
next reload. Since the time needed by the first DMA channel to update the ODR is a
constant, considering the reload trigger as a starting point, the time between two different
GPIO updates is simply given by the ARR value.
The DMA circular buffer feature can be enabled to allow automatic regeneration of the
same pattern at each end. This solution has the advantage of being fully managed by
hardware, thus, the MCU core is completely free for any user requirement.
The main drawback is that each timing value between two subsequent states cannot be
lower than a minimum value to guarantee enough time for both DMA channels to perform
their transfers.
Figure 5: Solution 1 with STM32 direct memory access (DMA) peripheral
The second solution
is designed to overcome the DMA minimum duration requirement
and directly involves the MCU core:
•
during run-time, the core generates the binary assembly code it needs to load and
store each word in the ODR. Any unnecessary instructions like control loops are
avoided; the code is only a succession of simple load/store instructions;
Содержание UM2163
Страница 17: ...UM2163 Hardware layout and configuration DocID030224 Rev 1 17 30 Figure 13 Program 4...
Страница 26: ...PCB layout UM2163 26 30 DocID030224 Rev 1 6 PCB layout Figure 23 Top layer Figure 24 Inner layer 1...
Страница 27: ...UM2163 PCB layout DocID030224 Rev 1 27 30 Figure 25 Inner layer 2 Figure 26 Inner layer 3...
Страница 28: ...PCB layout UM2163 28 30 DocID030224 Rev 1 Figure 27 Inner layer 4 Figure 28 Bottom layer...