2025-08-27 11:39 AM
Hi,
On the STM32F303, the TIM1 timer is running in input capture, slave mode – reset, with the trigger source set to TI1FP1 (CH1 direct rising, CH2 indirect falling) to record the incoming stream. It operates with DMA in circular mode using two buffers (separately storing the duration of the high and low states).
I want to further develop the project, and I have two use cases:
1) I want to forward this signal unchanged with minimal (or no) delay using TIM15.
2) In the DMA interrupts TIM_DMACaptureHalfCplt and TIM_DMACaptureCplt, I want to modify the original waveform and then output it through TIM15.
In general, I want the processor to act like a “repeater.”
Any hints would be greatly appreciated — maybe the solution is trivial, but advanced timers are still a bit of a mystery to me ;)
regards
2025-08-27 3:23 PM
> 1) I want to forward this signal unchanged with minimal (or no) delay using TIM15.
To my knowledge, there's no way to output the same channel that is being input without CPU intervention. Some chips have op-amps built in which could to this on certain pins. (op-amp follower). You could use an EXTI interrupt to do this with relatively low delay (order of microseconds).
If it's a PWM signal, you can measure it and then output the same PWM signal. Will have some delay.
> 2) In the DMA interrupts TIM_DMACaptureHalfCplt and TIM_DMACaptureCplt, I want to modify the original waveform and then output it through TIM15.
Might be possible depending on what modifications in particular you are making and the allowable waveform types coming in. For example, a steady PWM signal could be modified, but an arbitrary waveform not as much. You could do ADC -> buffer -> modify -> DAC.
2025-08-27 3:57 PM
The processed signal has a data rate of about 8 kbps, and the delay can be around 10 µs.
The need for modification comes from the fact that the ratio of the high state to the low state is 60:40 instead of 50:50.