53.4.2. QEO_DAC_OUT
53.4.2.1. Overview
The QEO_DAC_OUT sample project demonstrates the functionality of QEO (Quadrature Encoder Output) peripheral in generating waveform signals based on position information. QEO can receive position information either through software injection or from hardware (such as MMC), and generate corresponding waveforms (such as sine wave, cosine wave, etc.) based on preset wave type and resolution settings, which can be output as analog signals through DAC.
53.4.2.2. Working Process
This example demonstrates two working modes:
Software Position Injection Mode Configuration steps:
Initialize QEO module and configure wave output mode
Configure wave generation parameters:
Set wave type (e.g., cosine wave)
Set resolution lines to determine wave period
Configure three-phase wave phase shifts (120° and 240°)
Software position injection process:
Calculate position increment value
Enable software position injection
Cyclically inject position values to generate wave samples
Wait for wave calculation completion
Get and store wave output values
Disable software position injection
Hardware Position Input Mode
In this example, the MMC (Motor Motion Control) peripheral provides position information to QEO, which generates wave outputs in real-time based on the received position information.
Configuration steps:
Initialize QEO module with the same wave parameters as software mode
Configure hardware position input:
Connect MMC position output to QEO through TRGM
Configure MMC open-loop prediction mode
Enable motor timestamp function for synchronization
53.4.2.3. Hardware Setting
Observe the output voltage waveforms on the specified DAC pins (Please refer to Pin Description section).
53.4.2.4. Notes
QEO supports outputting 3 wave signals, but the actual observable waveforms are limited by the available DAC channels on the development board
Wave output value range is 0-65535, corresponding to DAC full-scale output
In software injection mode, position value range is 0-0x100000000, evenly divided according to resolution lines
53.4.2.5. Running the Example
When the project runs correctly, you will observe the following:
Serial terminal output:
QEO DAC wave example
QEO generate wave with software inject position
qeo wave0 output:
65535
65526
65496
// ... more data points ...
QEO generate wave base on hardware(MMC) provide position
Waveform output:
Using tools like Excel, you can plot the serial output data to visualize the phase relationship of three-phase waveforms:
Using oscilloscope to observe actual output waveforms on DAC pins: