Stm32 oscilloscope Signal Generator

Source: Internet
Author: User

For the stm32 oscilloscope, there are a lot of online channels. I want to express my design ideas here. This project has been prepared for a long time. First of all, I would like to thank the previous team. I feel that Chen Shi and Yu have received many considerations from two experienced embedded engineers. If it is not for work adjustment or other reasons, it is very likely that the product will come out. However, I am deeply sorry for not finishing the process. Here I will describe my design process, hoping to help my friends who are doing the oscilloscope. It is also a summary of this project.

 

The effective measurement frequency of this oscilloscope is 0.1 ~ 100 kHz

Dual-channel

Integrated Signal Generator

The time axis increments by 1, 2, and 5 in the range of 2us ~ 1 s

Timeline: 12 cells per screen

Hardware structure:
    1. Primary core mongozet6
    2. Touch screen ssd1289 320*240 rgb565
    3. AD: Internal ADC 1 MHz sampling rate of stm32

Dual-channel.

(Design extension external high-speed ad, the above reasons failed to be completed)

    1. Da: a sine wave, sawtooth wave, and square wave within 20 KB of the internal DAC.
    2. Platform: ucosiii,
    3. Image: ucgui
Software Design: Design Philosophy

The entire data process is as follows:

 

 

Data SamplingThere are three parts:

    1. High-speed sampling (2us ~ 20us including 20us );

Take 20us as an example:

20us x 12 x.

The sampling rate is 1 MB, that is, 1 us can only sample 1 piece of data. As mentioned above, the screen width is 320.

In this case, one data entry corresponds to one or several points on the display.

Therefore ~ The maximum sampling rate is 1 MHz for sampling between 20 us.

Continuous sampling mode is adopted.

 

    1. Medium Speed sampling (50us ~ 20 ms, including 20 ms );

In this period, as long as the sampling period is adjusted and the selected timeline is the same, the sampling points can correspond to the points on the screen one by one.

The sampling mode is triggered by a timer.

 

    1. Low-speed sampling (when the value is greater than or equal to 50 ms ).

According to brands such as Haitai Ke's oscilloscope, the screen is displayed cyclically at this low speed (the screen is closed ).

The sampling mode is also triggered by the timer.

 

 

Data Parsing:

    1. Waveform Parameters: Cycle, duty cycle, maximum value, minimum value, and so on.

It is easy to obtain the data parameters after obtaining the sample data.

Here, we need to mentionRelationship between sampling points and display points:

 

Sampling at medium speed and low speed:

The display points of the sampling points correspond one to one.

 

During High-speed sampling:

Regardless of the time axis, the sampling period is 1us;

The relationship between the sampling point and the display point is (320 screen width)/(timeline * 12 grids/1us)

 

    1. Find the trigger point:

Low-speed sampling is not triggered because it is displayed cyclically.

Sample three times the screen data at high speed and medium speed, and compare the data with the trigger line to obtain a matching piece of data for display.

 

 

Signal Generator:

This part is simple. First, calculate a periodic waveform and put it in an array. Then, update da cyclically with DMA.

 

Display:

This part is straightforward:

 

 

 

 

Here are two screenshots:

Http://www.tudou.com/programs/view/xhzx85TF-Is/

Http://www.tudou.com/programs/view/-GiTeVanFhk/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.