2017-11-27 08:30 AM
Hi,
I'm quite new in the wonderful world of STM32. I have a personal project where I would like to simulate a Somfy remote emitter/receiver. If I connect the receiver to my logic analyzer, I can see the signal. The protocol has been reverse engineered so it's not the problem to understand it.
My question is: 'what's the best way to capture the signal coming from the receiver' ? I've read the STM32 documentation about TIMER feature but I'm not sure it's the more efficient way to proceed.
One the signal is captured, how can I emit it ? Using TIMER again ?
I've looked for simple code which records and plays back a signal but I didn't find anything for the STM32...
Thanks,
Pierre
PS: Just in case, I've attached a capture of the signal I want to process. Here is the description:
https://pushstack.wordpress.com/somfy-rts-protocol/
#input-capture #stm32-f1Solved! Go to Solution.
2017-11-27 01:16 PM
STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\TIM\InputCapture\main.c
STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\TIM\OCToggle\main.c
The goal being to measure the pulse widths in a form you can decode, and to generate similar arbitrary waveforms. I've posted many examples over the years, some may address the requirements, none specifically SOMFY, not something I'm using or have reason to use.
2017-11-27 08:48 AM
You can use Input Capture to place the signal edges with respect to an internal time line, ie time stamp the edges
In 2017 I'd probably use an STM32L4 part with a 32-bit TIM
Output could probably be don't using Toggle mode, where the edges were described in a pattern buffer feed by DMA triggered by the placement of the last edge.
2017-11-27 08:59 AM
Thanks Clive One for your advice.
As it's a personal project, I'm using a cheap STM32F103 development board. Of course, if in the future I produce a commercial product, I will migrate to a more recent MCU.
Don't you have a piece of code to share (or an URL) on how to do it ? It will simplify my life as the documentation is quite complex with a lot of registers to play with.
Pierre
2017-11-27 01:16 PM
STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\TIM\InputCapture\main.c
STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\TIM\OCToggle\main.c
The goal being to measure the pulse widths in a form you can decode, and to generate similar arbitrary waveforms. I've posted many examples over the years, some may address the requirements, none specifically SOMFY, not something I'm using or have reason to use.
2017-11-27 02:04 PM
Hi Clive One,
Thanks for the references. I will try to modify the code to obtain what I need.
Cheers,
Pierre