This post was last edited by flyword on 2019-1-28 05:57 Yesterday's post simply used the ADC module. This post starts with using the DAC. Generally speaking, the DAC can be used as a waveform generator. Through the APP module, we can use the DAC to generate the waveform we want very quickly. However, the XMC4800 kit does not have any related hardware designed for testing. Of course, it can also be measured by a multimeter, but I don't have any of these at hand, so I can only simply use the LED light and the serial port to show whether the program is running normally.
Without further ado, let's start. It's actually very simple to use the DAC module. The steps are as follows: 1. Add the APP module of DAC! Then configure the DAC module in turn. The specific configuration is as follows. As can be seen in the figure below, there are 4 modes: PATTERN, single VALUE, RAMP, NOISE. Here I choose the first one for evaluation. 400781 2. Continue to configure the DAC module. Here you can set the relevant parameters of the waveform, such as amplitude, frequency, etc. 400782 3. Select Enable sign output for interfacing with event detectors.
4.Here is a pause to talk about the modules required for this evaluation, as follows:
The function to be realized is as follows: First, after enablingDAC,DAC will run automatically, and then connectsignsignal to the event detector to detect the signal, and trigger the event generator at the same time, and then trigger an interrupt. In the interrupt, the LED light is flipped and the serial port output information is output to detect whether the program is running normally.
5.Connection of DACmodule with event detector and generator. As shown below: 400785 6. Event detector configuration: used to detect the upper and lower edges of the detector signal A. 400786 7. Event generator settings: 400787 8. Related configuration notes: Complete the settings of the relevant IO ports in turn, set them to OUTPUT, and configure the pins to the LED peripherals; complete the UART configuration. For details, please refer to the previous post and pay attention to the pin configuration. 9. Click to generate code, download and run. The screenshots and photos of the final running results are as follows:400788 Actual photo, the white box shows that the led is flipped and lit!400789 This sharing ends here. APP module Regarding DAC, there is also 1 DAC_LUT module, which is a DAC output of the lookup table method. I will share it next time.
This content is originally created by flyword, a netizen of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source