cancel
Showing results for 
Search instead for 
Did you mean: 

Timer Problem

Hi everyone.

 

I am driving a Neopixel LED with a PWM signal in DMA mode using a timer. Even though all variables are the same, my code works with timer 3, but the same code doesn't work with timer 2 with the same timer configuration. Why could this be? I checked for a 16-32 bit difference, but they say it's not related to that. I have an STM32G431 Nucleo board. I tried all pin configurations for timer 2 channel 1, but it didn't work. İf it's normally and ı cant use this for neopixel, I will change timer but I use other timers for different jobs with  different frequences. But ı dont thinks so.

13 REPLIES 13

@Andrew Neil wrote:

Have you checked that the Nucleo board doesn't have something else on PA2 ?.


Yes, it does:

AndrewNeil_0-1759222059547.png

https://www.st.com/resource/en/user_manual/um2397-stm32g4-nucleo32-board-mb1430-stmicroelectronics.pdf#page=16

via: https://www.st.com/en/evaluation-tools/nucleo-g431kb.html#documentation

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Sorry for late answer. I dont use PA2, and ı tried other pins in timer 2.

So what is the difference between the working case, and non-working case?
İt's not same signal. But I can't get a good visual because it's not a continuous periodic signal. Both of them.



@cereyanmühendisi wrote:

Sorry for late answer. I dont use PA2


Sorry, yes - it's PA5

But do you have the board correct configured for that?

AndrewNeil_0-1759231892068.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I cant understand, did u mean ı confused pins? if it is, probably no. Because ı can take basic pwm signal with same pins. I use this picture. 

image.png