4433 views|5 replies

4

Posts

0

Resources
The OP
 

ucos-iii multi-channel acquisition system and display [Copy link]

 Hello everyone~ First of all, let me describe my design content: I want to make an eight-channel data acquisition system based on ucos-iii. The first channel can collect a maximum voltage of 18mv, the second channel can collect a maximum voltage of 90mv, and the remaining channels can collect a maximum voltage of 3.3V. At most two channels can be used for acquisition at the same time, and there is also a curve display of the voltage value. And the key input voltage value range, if it exceeds the set voltage, an audible and visual alarm will be issued. Then there are the problems I am facing now: 1. When collecting data from the ADC, does the data processing need to be determined according to the transfer function of the filter amplifier circuit? 2. The initialization of each module is written in the .C file of the module. Do the specific operations need to be written in the task function in the main function? 3. What is the sampling frequency generally used for voltages within 30Hz, and is it necessary to use a hardware timer to sample it regularly? 4. When my program is running, it stops in the loop of reading the DMA data transfer completion flag; that is, the completion flag has not changed. 5. Should the LCD background display interface and the curve display interface be placed together in the while of a task, or should the background be placed under main and the curve display interface be placed in the while of the task? 6. For the tasks of 6 buttons and 8 ADC channels, should each button and each channel be written as a separate task, or how should they be written? I have a lot of questions~~ Please help me~~ I am doing my graduation project in my senior year, and this is my first time using ucos-iii. When I write programs, the programs often get stuck, and I am not sure how to arrange the code positions so that the system can run normally. In addition, I also have some programs and books for ucos-iii on the stm32f103zet6 board. Friends who need them can also contact me. Thank you all

Latest reply

Embedded real-time operating system μC/OS components are recognized for their high reliability, superior performance, clear source code and excellent documentation. μC/OS software meets the strict standards required by safety-critical industries and is an ideal choice for functional safety and critical system design! If you have any questions, please follow McTech Technology for more information.   Details Published on 2019-7-24 16:46
 

4

Posts

0

Resources
2
 
Another question is, should the voltage acquisition and display be done first and then displayed? In this case, should the acquisition task and the display task be combined into one task? If real-time acquisition and display are to be achieved, how should these two tasks be arranged? ?
 
 
 

525

Posts

235

Resources
3
 
1. The data processing in the question refers to converting AD values into voltages. When collecting voltages in different ranges, the sampled values need to be amplified to the appropriate range. For example, if you amplify the maximum 18mV voltage to a sampling system of 3.3VREF, it is about 180 times amplified, and then the voltage value corresponding to AD can be calculated. 2. It is up to you to decide where to write the function. A good habit is to write it in modules, for example, put the key-related operation function in key.c and the display-related function in display.c. 3. According to the Nyquist sampling theorem, a sampling rate of 2 times the signal frequency can reflect the original state of the signal. But the higher the more detailed, the more realistic the restoration. 4. When debugging the microcontroller, please debug the required modules separately first, and then debug them together. 5. The background belongs to the background task, and the curve belongs to the foreground task. They must all need to be refreshed and need to be done in while. 6. The buttons are placed in one task. AD can be placed in one task according to the needs, and those with high real-time requirements can be placed in one task, and those with low requirements can be placed in another task. In addition, from the questions you asked, it can be known that you learned microcontroller programming temporarily to cope with the graduation project.
 
Personal signature爱电子,爱生活
 
 

4

Posts

0

Resources
4
 
wsdymg posted on 2018-4-27 00:06 1. The data processing in the question refers to converting the AD value into voltage. When collecting voltages in different ranges, the sampled values need to be amplified to the appropriate range. For example, you...
Thank you very much for your reply~~ Actually, I have learned microcontroller programming for a long time... I am ashamed to say that I used to program with routines, and I really understood very few. After reading your answer, I have a few more questions to ask: 1. I have made a hardware circuit for amplification and filtering at the front end of ADC sampling. The -3dB bandwidth is about 30HZ, but if the input voltage frequency is larger, the output voltage amplification factor will become smaller, which will produce a large error. I heard that it is necessary to add software compensation in the program to reduce the error. But does the specific software compensation only need to be calculated through the amplification factor or does it need to add a transfer function to calculate? 2. The required modules have been debugged successfully separately, but when combined, they will be stuck in the while loop of some functional functions. Are there any combination techniques under the ucos-iii system? 3. If the key task is placed in a task, is it in the form of key scanning or key interrupt mode? Will the key scanning mode affect the real-time performance of the system? If it is in the key interrupt mode, I have read the interrupt routine of ucos-iii. It sends an interrupt signal to the corresponding task in the interrupt service function to execute the interrupt task. Does the use of external interrupts require the execution of the task by transmitting the interrupt signal? 4. For the acquisition and display of voltage curves, according to the process, data should be acquired first, and then the curve should be displayed. Should these two statements be written in one task? 5. Is it important to read the DMA transfer flag to determine whether the data has been transferred? If this block is added to the program, it will be stuck.
 
 
 

1234

Posts

4

Resources
5
 
Let's not talk about how to program it. I think you don't even know the circuit. The maximum voltage of 18mV is enough for you to handle with just a VREF reference power supply.

 
Personal signature天地庄周马;江湖范蠡船。
个性签名还是放QQ号吧,2060347305,添加说明EEworld好友
 
 

227

Posts

0

Resources
6
 

Embedded real-time operating system μC/OS components are recognized for their high reliability, superior performance, clear source code and excellent documentation. μC/OS software meets the strict standards required by safety-critical industries and is an ideal choice for functional safety and critical system design! If you have any questions, please follow McTech Technology for more information.

 
Personal signature

欢迎关注“麦克泰技术”

 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list