RFQ/BOM 0 Iniciar sesión / Registro

Selecciona tu ubicación

imagen de usuario

Ask about how to start the mcu task.

Hardware design
enero 13, 2021 by Lennon 466

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?

todos los comentarios

user image

Dorian Publicado en 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 Publicado en 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

Escribe una respuesta

Necesitas iniciar sesión para responder. Iniciar sesión | Registro