cancel
Showing results for 
Search instead for 
Did you mean: 

TIM15 in Slave Mode, Gated Mode to count the time a signal is High

danielbathtub
Associate III

Hi, 

 

I want to count the time that an incoming level signal is high for. 

To achieve this I setup Timer 15 as a Gated Mode Slave, which has it's counter counting while the trigger input is high. The trigger input is the Filtered Timer 15 Channel 1. For some reason when I connect my signal to my input Timer. Nothing Happens. The signal on the IO Pin TIM 15 CH1  is a 2V square Wave.

My own software seems correct. I then moved to Hal to see if I can achieve it.  

I've tried to use HAL to achieve this without any luck here is my HAL software.

Uploaded is the main and IOC file

I am working on the STM32G071

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
danielbathtub
Associate III

Solving my own problem: 

The issue is that I was using the Timer in One Pulse Mode. 

This is incorrect, without setting the Timer in One Pulse Mode, everything works as expected and the Timer accurately clocks while the trigger input is high  

 

View solution in original post

1 REPLY 1
danielbathtub
Associate III

Solving my own problem: 

The issue is that I was using the Timer in One Pulse Mode. 

This is incorrect, without setting the Timer in One Pulse Mode, everything works as expected and the Timer accurately clocks while the trigger input is high