Skip to main content
Became Hot Network Question
formatting
Source Link
Velvet
  • 4.7k
  • 5
  • 18
  • 32

In steady state the line  (output) is high and Wewe have to create pulses that are microseconds long and are low. It is going to be a custom sequence with different pulse lengths  (for example the line would look like all high, then 3us3 μs low, then 4us4 μs high, then 1us1 μs low, then5usthen 5 μs high - 2us2 μs low, then all high etc.etc). 

We have tried standard PWM and PWM one shot, but we always failed to make it work as PWM functions do not work as intented. I mean we cannot simply close PWM and re-run it with new configs as I understood. We also tried to use DMA. We are aware that microseconds long pulses cannot be created by HAL_DelayHAL_Delay function. 

We are using NUCLEO-L452RE-P board. How can we make it work efficiently?

As I am not allowed to share work place material, I cannot post the code we wrote.

In steady state the line(output) is high and We have to create pulses that are microseconds long and are low. It is going to be a custom sequence with different pulse lengths(for example the line would look like all high, then 3us low, then 4us high, then 1us low, then5us high - 2us low, then all high .etc). We have tried standard PWM and PWM one shot, but we always failed to make it work as PWM functions do not work as intented. I mean we cannot simply close PWM and re-run it with new configs as I understood. We also tried to use DMA. We are aware that microseconds long pulses cannot be created by HAL_Delay function. We are using NUCLEO-L452RE-P board. How can we make it work efficiently?

As I am not allowed to share work place material, I cannot post the code we wrote.

In steady state the line  (output) is high and we have to create pulses that are microseconds long and are low. It is going to be a custom sequence with different pulse lengths  (for example the line would look like all high, then 3 μs low, then 4 μs high, then 1 μs low, then 5 μs high - 2 μs low, then all high etc.). 

We have tried standard PWM and PWM one shot, but we always failed to make it work as PWM functions do not work as intented. I mean we cannot simply close PWM and re-run it with new configs as I understood. We also tried to use DMA. We are aware that microseconds long pulses cannot be created by HAL_Delay function. 

We are using NUCLEO-L452RE-P board. How can we make it work efficiently?

As I am not allowed to share work place material, I cannot post the code we wrote.

Source Link

STM32, how to create microseconds long custom pulses

In steady state the line(output) is high and We have to create pulses that are microseconds long and are low. It is going to be a custom sequence with different pulse lengths(for example the line would look like all high, then 3us low, then 4us high, then 1us low, then5us high - 2us low, then all high .etc). We have tried standard PWM and PWM one shot, but we always failed to make it work as PWM functions do not work as intented. I mean we cannot simply close PWM and re-run it with new configs as I understood. We also tried to use DMA. We are aware that microseconds long pulses cannot be created by HAL_Delay function. We are using NUCLEO-L452RE-P board. How can we make it work efficiently?

As I am not allowed to share work place material, I cannot post the code we wrote.