|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
In my formula below, you can often reduce the error by a judicious choice of the output-stage divider value. Choose one that makes the calculated PLL denominator be as close to an integer as possible,
In my formula below, you can often reduce the error by a judicious choice of the output-stage divider value. Choose one that makes the calculated PLL denominator be as close to an integer as possible,
|
By
Paul WB6CXC
· #84005
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Here's a useful (very simple) equation for finding a PLL fractional-divider denominator when you are searching for a particular frequency step (Fdelta): Fx = reference oscillator frequency in Hz, OutD
Here's a useful (very simple) equation for finding a PLL fractional-divider denominator when you are searching for a particular frequency step (Fdelta): Fx = reference oscillator frequency in Hz, OutD
|
By
Paul WB6CXC
· #83997
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Milt, I'm using 32-bit unsigned integer math (sometimes), so 128*b fits easily. The problem with single-precision floats is that the 128*b in the first part of P2 is a very large # that won't fit: P2
Milt, I'm using 32-bit unsigned integer math (sometimes), so 128*b fits easily. The problem with single-precision floats is that the 128*b in the first part of P2 is a very large # that won't fit: P2
|
By
Glen Leinweber
· #83836
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
There is no need to cast these as floats. (128 x b) / c, using all integers and integer math gives you identical results. Yes, you can use floats if you like, and then, assuming enough floating-point
There is no need to cast these as floats. (128 x b) / c, using all integers and integer math gives you identical results. Yes, you can use floats if you like, and then, assuming enough floating-point
|
By
Paul WB6CXC
· #83818
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Glen, Aren’t you missing something? B and C are normally cast to floats before calculating B/C. Since B is less than or equal C, the ratio is less than or equal to 1. This is then multiplied by 128, r
Glen, Aren’t you missing something? B and C are normally cast to floats before calculating B/C. Since B is less than or equal C, the ratio is less than or equal to 1. This is then multiplied by 128, r
|
By
Milt
· #83807
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Yes, single-precision floats are dangerous, especially when calculating that nasty P2 that's giving me grief. recall that P2 requires multiplying "b" by 128, then subtracting (c * floor (128* b/c)). T
Yes, single-precision floats are dangerous, especially when calculating that nasty P2 that's giving me grief. recall that P2 requires multiplying "b" by 128, then subtracting (c * floor (128* b/c)). T
|
By
Glen Leinweber
· #83806
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Hi All, The very reason I prefer programming in assembly. John
Hi All, The very reason I prefer programming in assembly. John
|
By
jmh6@...
· #83784
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
I keep mentioning Bresenham dividers. Here's a simple pseudocode example: Ratio = b / c counter = 0 loop forever { if (counter < 0) counter = counter + b else counter = counter + (c-b) } And that's it
I keep mentioning Bresenham dividers. Here's a simple pseudocode example: Ratio = b / c counter = 0 loop forever { if (counter < 0) counter = counter + b else counter = counter + (c-b) } And that's it
|
By
Paul WB6CXC
· #83782
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
I've not seen the MDAS precedence problem in the SiLabs specs. I will sometimes over-parenthesize my own equations to avoid integer overflow or to use truncation as required, or just to group things t
I've not seen the MDAS precedence problem in the SiLabs specs. I will sometimes over-parenthesize my own equations to avoid integer overflow or to use truncation as required, or just to group things t
|
By
Paul WB6CXC
· #83781
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
I’ve been watching this discussion and I have to ask — is anybody watching the hierarchy of mathematical operations? This includes SiLabs. Unless otherwise defined by parentheses, multiplication and d
I’ve been watching this discussion and I have to ask — is anybody watching the hierarchy of mathematical operations? This includes SiLabs. Unless otherwise defined by parentheses, multiplication and d
|
By
Jim Strohm
· #83780
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Yes, but the P1 and P3 values also change. There are many ways to design a fractional divider (and I've designed a few), so this result doesn't surprise me and I assume the numbers all work out in the
Yes, but the P1 and P3 values also change. There are many ways to design a fractional divider (and I've designed a few), so this result doesn't surprise me and I assume the numbers all work out in the
|
By
Paul WB6CXC
· #83779
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
I would still maintain that thinking of a fractional part of c is not correct. The value of c is arbitrary and it is just your method of choosing c that results in thinking c can have a fractional par
I would still maintain that thinking of a fractional part of c is not correct. The value of c is arbitrary and it is just your method of choosing c that results in thinking c can have a fractional par
|
By
Ron Carr
· #83762
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Floating point is also bulky in terms of Flash memory usage. All the calculations for the Si5351A can be done using 32-bit integer arithmetic... I recall one step required 64-bit but I re-coded an ite
Floating point is also bulky in terms of Flash memory usage. All the calculations for the Si5351A can be done using 32-bit integer arithmetic... I recall one step required 64-bit but I re-coded an ite
|
By
Hans Summers
· #83751
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Yes, exactly, and this is why we try to avoid floating point in speed-critical applications when using processors without FPUs.
Yes, exactly, and this is why we try to avoid floating point in speed-critical applications when using processors without FPUs.
|
By
Paul WB6CXC
· #83748
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
The SAMD21 does not have hardware floating point; floating point operations have to be done by slow subroutines. Your PC has an FPU, as do many higher end ARM processors.
The SAMD21 does not have hardware floating point; floating point operations have to be done by slow subroutines. Your PC has an FPU, as do many higher end ARM processors.
|
By
Shirley Dulcey KE1L
· #83747
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
The processor I'm using is the ATSAMD21 Cortex M0 (the same one used in the Arduino Zero), and it's native 32-bit with single-cycle hardware multiply, so working with bytes doesn't really speed things
The processor I'm using is the ATSAMD21 Cortex M0 (the same one used in the Arduino Zero), and it's native 32-bit with single-cycle hardware multiply, so working with bytes doesn't really speed things
|
By
Paul WB6CXC
· #83746
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Certainly SiLabs intended this, which results in an unsigned integer whose range lies between 0-127, hence their floor(128 * b/c) I wonder if you might help the compiler speed up the following calcula
Certainly SiLabs intended this, which results in an unsigned integer whose range lies between 0-127, hence their floor(128 * b/c) I wonder if you might help the compiler speed up the following calcula
|
By
Glen Leinweber
· #83744
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Ron, It would seem your approach is valid - many others manage with this approach, where "c" is truncated to an int before doing any further math for P1, P2. Same with "b": truncated. Perhaps its safe
Ron, It would seem your approach is valid - many others manage with this approach, where "c" is truncated to an int before doing any further math for P1, P2. Same with "b": truncated. Perhaps its safe
|
By
Glen Leinweber
· #83742
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
Another one more thing: I looked at the faster I2C options, and the Si5351 will indeed run at the 400 kbit/s "Fast Mode". I selected this rate (arduino "Wire" library: Wire.setClock(400000)), and foun
Another one more thing: I looked at the faster I2C options, and the Si5351 will indeed run at the 400 kbit/s "Fast Mode". I selected this rate (arduino "Wire" library: Wire.setClock(400000)), and foun
|
By
Paul WB6CXC
· #83740
·
|
|
#si5351a #synth #programming Si5351 programming: a deep dive
#si5351a
#synth
#programming
One more thing, if you aren't modifying the numerator in that equation, you don't have to update the "P3" register. This can save significant time as it reduces the number of I2C writes. I have a quic
One more thing, if you aren't modifying the numerator in that equation, you don't have to update the "P3" register. This can save significant time as it reduces the number of I2C writes. I have a quic
|
By
Paul WB6CXC
· #83720
·
|