Prop stops spinning...
siljamicke
Posts: 66
How come a program which works just fine in one clockspeed, all of a sudden fails when sped up?
I have an audio application, which outputs audio fine with:
but fails miserably with:
The outputted audio should be well within audio frequency, so it's got nothing to do with transposing the audio above the limit for hearing.
I'm crossing some other sort of threshold here, probably electrical... I get two pops, (where there should have been a stream of pops = PWM, ) for the last two PLL settings...
My prop is powerded by two AA batteries (3 volt). On the pin outputting audio i have a 220R, a 4.7uF from the resistor to ground (Low pass RC), and a 220uF DC blocking cap. Electrically i always shoot from the hip, as long as it works somewhat so so, it's fine for me! But maybe i'm being to naive here assuming it should work for all clockspeeds...
I have an audio application, which outputs audio fine with:
_CLKMODE = XTAL1 + PLL1X _CLKMODE = XTAL1 + PLL2X _CLKMODE = XTAL1 + PLL4X _XINFREQ = 6_000_000
but fails miserably with:
_CLKMODE = XTAL1 + PLL8X _CLKMODE = XTAL1 + PLL16X _XINFREQ = 6_000_000
The outputted audio should be well within audio frequency, so it's got nothing to do with transposing the audio above the limit for hearing.
I'm crossing some other sort of threshold here, probably electrical... I get two pops, (where there should have been a stream of pops = PWM, ) for the last two PLL settings...
My prop is powerded by two AA batteries (3 volt). On the pin outputting audio i have a 220R, a 4.7uF from the resistor to ground (Low pass RC), and a 220uF DC blocking cap. Electrically i always shoot from the hip, as long as it works somewhat so so, it's fine for me! But maybe i'm being to naive here assuming it should work for all clockspeeds...
Comments
How are Yours Propeller PCB build.
If so, my guess is that there are some calculations for the timing done in a driver. If you do these calculations the wrong way you can have a overrun in between.
For example:
8 * 6_000_000 means that _clkfreq equals 48_000_000. So, if some code multiplies _clkfreq with a number bigger than 89 you have an overrun and the result of the calculation will be wrong. And very likely smaller than the expected value. So, doing a waitcnt with this result might cause the problem.
PCB?!! Muahahaha! I use a mix of breadboarding and sort of laying conducting wires upon other conducting wires, hoping that they'll stay put. Don't bother trying to calculate stray capacitances in my setup, hehe.
@MagIO2 (now i noticed the spelling of your nick name, it's an i not L)
Yes other programs run fine in 6mhz*pll16. And i am not basing any calcs on clkfreq. It should scale just fine. It sounds like the prop goes "Hey man, i just don't feel like bothering flippin your damn pin on and of at like thousands of times per second. Half is enough, my arm hurts, and the sound sucks anyway!"
I realize i will have to attach some code and schematic, i will do that asap!