RFQ/BOM 0 로그인 / 등록하다

귀하의 위치를 선택하세요

사용자 이미지

Ask about how to start the mcu task.

Hardware design
1월 13, 2021 by Lennon 472

The main frequency of the board is 32m...

Need to generate a 100hz square wave and a 3000hz square wave,

At the same time, one cycle of 100hz sampling is required, and the sampling frequency is 500m

Finally, data processing, and some other communication tasks.

How to match tasks?

1: You can't use the way of querying taskloop. If you make a square wave in a task, the waveform will be inaccurate. Can only be placed in interrupts.

2: Sampling I put it in a 7600hz timer interrupt (2 waveforms are also done here), but the program flies,

3: No sampling, only 2 square waves are made in the interrupt, it's okay.

How to solve?

모든 댓글

user image

Dorian 게시 날짜 January 13, 2021

The main program has made a simple kernel. It is only tasks with 32 priority tasks. After the initialization is completed, these tasks will be queried, but the square wave and collected data are generated, and it feels like it cannot be put in the task, otherwise the waveform will change.

0
user image

Lennon 게시 날짜 January 13, 2021

Maybe my thinking direction is wrong. I always think about the front and back task scheduling solution, to see if I can put the waveform generation into a single task. If feasible, I only need to start the task regularly in the 7600hz timer interrupt. But there are three in the interruption, a bit. . . .

0

답변 작성

답글을 달려면 로그인이 필요합니다. 로그인 | 등록하다