Search found 11 matches

by adc_problems
Fri Feb 16, 2024 12:31 am
Forum: General discussion
Topic: How to access low level registers or How to set TIM1 to 128Mhz
Replies: 10
Views: 8131

Re: How to access low level registers or How to set TIM1 to 128Mhz

Found it!

I need to switch the TIM1 clock mux by:

PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_TIM1;
PeriphClkInit.Tim1ClockSelection = RCC_TIM1CLKSOURCE_PLL;


I found that snippet while searching around.

Tim1->getTimerClkFreq();
Still reports 64Mhz but the Oscope shows: 128Mhz clock ...
by adc_problems
Thu Feb 15, 2024 11:38 pm
Forum: General discussion
Topic: How to access low level registers or How to set TIM1 to 128Mhz
Replies: 10
Views: 8131

Re: How to access low level registers or How to set TIM1 to 128Mhz

Understood, thanks.

For anyone else searching: the WEAK void SystemClock_Config(void) lives in generic_clock.c in your variants folder.

Code compiles without issues but somehow i still only get 3,9Khz clock frequency for 14 bit resolution.
I would have expected (128000000/(2^14)) = 7,8Khz.

Maybe ...
by adc_problems
Thu Feb 15, 2024 6:42 pm
Forum: General discussion
Topic: How to access low level registers or How to set TIM1 to 128Mhz
Replies: 10
Views: 8131

Re: How to access low level registers or How to set TIM1 to 128Mhz

fpiSTM wrote: Thu Feb 15, 2024 8:27 am Simply redefine the system core clock config:
Thank you very much!

Do i need to call

Code: Select all

SystemClock_Config()
or does it get called by the framework/core at startup?
by adc_problems
Thu Feb 15, 2024 8:22 am
Forum: General discussion
Topic: How to access low level registers or How to set TIM1 to 128Mhz
Replies: 10
Views: 8131

Re: How to access low level registers or How to set TIM1 to 128Mhz

The STM32G071GBU6N can do 128Mhz on TIM1 and TIM15.

Screenshot 2024-02-15 091626.png

As fas as i see it, the Arduino implementation does not support it because it needs changes in the clock path.
Screenshot 2024-02-15 091727.png
TIM1 (not interested in TIM15) needs to run on clock source PLLQ ...
by adc_problems
Wed Feb 14, 2024 8:50 pm
Forum: General discussion
Topic: How to access low level registers or How to set TIM1 to 128Mhz
Replies: 10
Views: 8131

How to access low level registers or How to set TIM1 to 128Mhz

Hello Girls and Guys!

I am currently in need to generate a high resolution high speed PWM signal.
I wanted to use TIM1 in 128Mhz mode but cant figure out how to set it.

(Using PlatformIO with platform:ststm32 core in Visual Code studion on windows - code runs on a STM32G071GBU6N)


CubeIDE ...
by adc_problems
Tue Sep 27, 2022 9:09 am
Forum: General discussion
Topic: Oversampling not working correctly
Replies: 13
Views: 7203

Re: Oversampling not working correctly

So looks like no one knows why the oversampling isnt working?
:oops:
by adc_problems
Sun Sep 25, 2022 7:58 pm
Forum: General discussion
Topic: Oversampling not working correctly
Replies: 13
Views: 7203

Re: Oversampling not working correctly

The thermal mass is way slower than the RC lowpass with a 1,5hz -3db frequency.

The temperature changes translated to resistance translated to voltage is minimal. There is no way that the temperature is changing that fast.

I will implement a slower RC filter and try again.

But as i tried to ...
by adc_problems
Sun Sep 25, 2022 7:10 am
Forum: General discussion
Topic: Oversampling not working correctly
Replies: 13
Views: 7203

Re: Oversampling not working correctly

I already use a RC filter.
I use a 1k NTC and got linearization resistors:

8,25k to ground in parallel with the NTC with a 825R from the supply to NTC.
That gives me a somewhat linear temperature / voltage curve from 0-60C.

The output of this got a 33n to ground to filter things a bit.
So the ...
by adc_problems
Sat Sep 24, 2022 9:53 pm
Forum: General discussion
Topic: Oversampling not working correctly
Replies: 13
Views: 7203

Re: Oversampling not working correctly

I just noticed that its not the ADCs fault for having such high noise.
My power supply decoupling wasnt working, i got more than 200mVpp noise on the STM32 supply..

That fix might just have eliminated the need for the software oversampling fix. However i still would want to know why this isnt ...
by adc_problems
Sat Sep 24, 2022 8:04 pm
Forum: General discussion
Topic: Oversampling not working correctly
Replies: 13
Views: 7203

Re: Oversampling not working correctly

I am not sure if i want to do that.

I already tried and its not much better. (with 4-8 samples)

Sample accumulation /oversampling can do 256x with 8x shifting this gives quite some averaging for slower signals.

Everything i see in the data sheet says: that should work. So i am not sure why it ...

Go to advanced search