[GD32E503 Review] Simple Oscilloscope Experiment (Continued 2)
[Copy link]
In order to improve the effect of the simple oscilloscope experiment, I tried to change the method of ADC conversion and graphic display. First, the ADC conversion and display were performed in segments, that is, 300 sets of ADC conversion data were read first, stored in the cache array, and then the first 238 data were displayed on the screen in a graphical manner, and then read again, and then displayed, and so on. The reason why 238 data are displayed is that the screen width is 240 columns, and 1 column is left on each side as a frame line, and 238 columns are actually used for display. But the test effect is still not ideal, it is still a straight line that changes up and down. The following is an animation of the test process:
The signal source in the current experiment is a linear low-voltage power supply from the mains, with a frequency of 50Hz, and one cycle should be 20 milliseconds. I want to read the ADC conversion data once every millisecond, so that 20 sets of data can just show a sine wave cycle (of course, the negative half cycle is a straight line). Theoretically, about 12 cycles of half a sine wave can be displayed on the screen. According to this idea, I use Systick interrupts to drive ADC conversion and reading, and display it in the main loop. But the actual test effect is still not ideal, and the waveform changes into a rectangle. The animation of the test process is as follows:
It seems that I still need to go back and learn some basic knowledge such as typical circuits of the oscilloscope's specific working methods.
|