STM32F103 math package

OP #7114844
Rate this post
useful
not useful
calculation time fixcomma for si5351


I have a project with Arduino UNO where the execution time for the line 
below is 5,78 ms. The line is part of a Wobbler, which is running with 
64 steps only. I awaited 1.28 ms with BluePill. After porting to 
STM32F103 see yourself.
1
si5351.set_freq_manual((fnow) * 100ULL, pll_freq, SI5351_CLK0); //4,5 ms
2
//bin von BluePill enttäuscht

My expectation was, using BluePill, 5,78 / (72/16) MHz = 1,28 ms. Result 
see above.
Only 22% quicker.
I'm using only fixcomma variables.

Any proposals?

Codes available if wanted.
Guest #7115600
Rate this post
useful
not useful
Rudi D. wrote:
> Any proposals?

It looks as if there is no proper setup for the clock. Therefore the 
chip runs from only a slow internal RC-oscillator. Another idea is, that 
the function "si5351.set_freq_manual" does it's calculations in a very 
clumsy way. Or both, slow clock and clumsy algorithm.

W.S.
Guest #7124185
Rate this post
useful
not useful
Independent on I2C speed 100k or 400k nothing changes.
Still 4,4 ms for the si5351 Command.

Also the time needed for encoder interrupt is very short. If  I set the 
interrupt to 5 ms -missing some encoder steps- does not change the 4,4 
ms.

I'm familiar with fixcomma in assembler with tiny4313 and wobble 
frequencies at max. 70 HZ. DDS Project in RMorg 2014-2015 with AD9850 up 
to 30 MHz.

I think this would be a solution, but the si5351 is much more complex 
comp. to AD9850. I want to use the si5351 up to  120 MHz. With some 
phase mod. to have some sound.
Will see if I have enough drive to step into the si53551 deteils 
registers and communication.
Guest #7124294
Rate this post
useful
not useful
ruilxa wrote:
> I think this would be a solution, but the si5351 is much more complex
> comp. to AD9850.

The SI5351 is a clock-generator based on PLL - it gives only a digital 
output. The AD9850 is a DDS - it gives an analog output and needs a low 
pass filter on the output.

While the AD9850 is very agile (it only needs to set the phase-offset to 
switch it from one frequency to another) the SI5351 needs some time to 
settle the VCO and its phase-loops.

Both chips are complex in their own way, but the use of the SI5351 ist 
much more complicated compared to the AD9850, because the SI needs a 
combination of 2 integer numbers, which give the best approximation to 
the desired frequency - while the AD needs only the best value for the 
phase increment.

W.S.
Guest #7124337
Rate this post
useful
not useful
Rudi D. wrote:
> si5351.set_freq_manual

is this from some public library? When it was designed for Arduino with 
AVR, a common problem is the superfluous usage of type double. With 8 
Bit AVR, the calculations were performed as float, but when used with 
Cortex-M, expensive double math is used.

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now