Search found 7 matches

by ldelana
Fri Nov 27, 2020 12:56 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

Re: incorrect micros() value for stm32f411re


Also, your OP is about F411? why talking about F7 ?


F7 included because then I tried the same code with 3 boards, including F767zi with follow summary results:
- stm32f103 ( correct )
- stm32f446re ( problem )
- stm32f767zi ( problem )
actually I have wires connected to F7.


You could not ...
by ldelana
Fri Nov 27, 2020 1:49 am
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

Re: incorrect micros() value for stm32f411re

I think that stm32duino sets everything for their need to tune F_CPU 216000000 but may I am wrong...
I not used cubemx btw for stm32f767zi following is the default clock config

Image
by ldelana
Thu Nov 26, 2020 9:26 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

Re: incorrect micros() value for stm32f411re

btw, with higher freqs 10khz computed values isn't stable even within this framework

I'm sorry I seen from the scope that the instability in the signal was coming from the signal generator itself, so I setup a more stable pwm generator at 10khz signal using an stm32f108 and then I compared ...
by ldelana
Wed Nov 25, 2020 5:17 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

Re: incorrect micros() value for stm32f411re


Maybe you find interesting to measure a pulse width using hardware timer from this example: https://github.com/rogerclarkmelbourne/ ... MInput.ino

Thanks again stevestrong for the hint, I'll sure give a try.

Meanwhile I managed to make it work using another framework mbed, that was not my ...
by ldelana
Wed Nov 25, 2020 1:50 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

Re: incorrect micros() value for stm32f411re

thanks you stevestrong for suggestions, I tried but the results still the same, even with another board with stm32-f767zi;

only two notes about what you pointed:

1) call micros only one time, I achieved this already in my initial code because of the `if` branch micros() will be executed only 1 ...
by ldelana
Mon Nov 23, 2020 11:50 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

Re: incorrect micros() value for stm32f411re

Thanks for suggestion, I tried moving millis() to the top but nothing changes,
stm32f446re runs 180Mhz and I got the problem explained
while with stm32f103 running at 72Mhz or ArduinoNano at 16Mhz the problem not appears.

I don't understand exactly why an higher mcu freq should cause 20us distance ...
by ldelana
Mon Nov 23, 2020 9:57 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 14193

incorrect micros() value for stm32f411re

I am unable to retrieve a correct value of micros(), following my setup:
- STM32F411RE mcu
- external frequency generated by a pwm 50% duty connected to PC2
- in the hardware interrupt routine I save delta of micros() into a E1_period_us variable
- for testing purpose I setup PC10 output pin when ...

Go to advanced search