cancel
Showing results for 
Search instead for 
Did you mean: 

Some issues regarding STM32 simulation of SENT protocol

ZhixinNi
Associate

Hi,

I am using the STM32F407VET6 chip to simulate the SENT protocol. I have encountered some issues and would appreciate it if professionals in the forum could provide some answers.

1.Since the SENT protocol signal needs to change the output waveform based on the transmitted data, I attempted to use the TIM BURST feature of the chip to simulate the SENT signal. I am configuring it using STM32CubeMX software. Below are the relevant configurations:

ST论坛1.png

 

ST论坛2.png

 

ST论坛3.png

 

ST论坛4.png

2.The SENT protocol specifies that one tick is 3μs to 10μs. I initially set the PWM to a period of 3μs with a 50% duty cycle square wave and output it. Since I am not very familiar with the TIM BURST feature, I first used the HAL_TIM_DMABurst_WriteStart() function to attempt to modify the waveform originally output by the chip. I plan to change the waveform to the synchronization signal in the SENT protocol, which involves outputting 5 ticks of low-level signal and 51 ticks of high-level signal.

Initial PWM output waveform:

ST论坛5.png

The desired SENT waveform:

ST论坛6.png

Specifications related to the SENT protocol:

ST论坛7.png

3.Source code of the program:

ST论坛8.png

ST论坛9.png

4.The problem I'm facing now:

(1)The program code I wrote is not able to change the waveform. I’m not sure if there’s an issue with my initialization or if there’s a problem with the usage of the HAL_TIM_DMABurst_WriteStart function.

(2)I have a question about the HAL_TIM_DMABurst_WriteStart function. Since I want to modify the values of the ARR, RCR, and CCR1 registers, I'm not sure if modifying the ARR register value has any relation to the value set during the initialization configuration.

 

I hope the relevant persons can answer my questions,thanks.

0 REPLIES 0