cancel
Showing results for 
Search instead for 
Did you mean: 

PWM gating one signal with another and capturing PWM encoded data

Linas L
Senior II

Hello. I need to gate 125KHz PWM (50:50) signal with another to make special RFID packet.

For simple programming, it would be possible just to create buffer with data and use DMA to copy CCR register values to PWM generator. This means single triggered operation with no overhead from MCU.

Problem is I have very high carrier frequency that means a lot of data for DMA to transfer.

Is is possible to gate PWM signal one with another ? ( like gate CH1 with CH2)? I am not aware of this in STM32, but maybe i missed this part ?

If not, i have to write software that basicaly wrytes CCR register from 0 to 50% based on timing to generate requared waveform.

And second related question. I need to capture signal that has data encoded in PWM width ( like 30 is 0,-70% is 1)

Is where some-kind hardware way to do this simply ?

At the moment I am using GPIO to get transitions, and at the edge reading timer time to figure out timing. It works, but is brute force method Would say

1 REPLY 1

Which STM32?

> Is is possible to gate PWM signal one with another ? 

Yes, see timers internal master-slave interconnection and Gated mode description in the SMCR register.

 > I need to capture signal that has data encoded in PWM width

Read the PWM input subchapter in TIM chapter in RM.

JW