2021-03-15 01:20 PM
2021-03-16 12:46 AM
Hello @JMene.1 ,
Have a look on the HAL examples run on STM32L152xD devices within STM32CubeL1 MCU package:
\STM32Cube_FW_L1_V1.10.2\Projects\STM32L152D-EVAL\Examples\TIM\
You may re-use sections available in the examples or get inspired from them to achieve your goal.
Imen
2021-03-16 02:50 PM
Imen, the input capture works correctly. My problem is the ICR register of the RI peripheral. When, with the debug, I try to set bit 17 and 16 to 1 in order to Timer4, I get an error: value out of range. Can I route PC13 to the Timer 4 IC2?
Thanks
2021-03-16 04:57 PM
> When, with the debug, I try to set bit 17 and 16 to 1 in order to Timer4,
>I get an error: value out of range.
This sounds to be the debugger's limitation (what debugger, btw?).
What happens if you try to set it in code? What is the read out value of given register after the write?
JW
2021-03-17 08:52 AM
I tried with cubeIDE and Keil.
If I write the code below, bit 16 is set and not bit 17.
*((uint32_t *) 0x40007C08) = 1<<16 | 1<<17;
value = *((uint32_t *) 0x40007C08);
I tried to set ICx bits and ICOS bits first too, but nothing changed. bit17 is the only one in the ICR register that I cannot modify.
2021-03-18 05:05 AM
@JMene.1 ,
What exactly is written on the STM32L152 you are experimenting with?
@Imen DAHMEN ,
to me, this sounds like a relatively serious hardware limitation. I believe this is worth further investigation.
JW