What is the highest frequency square wave I can generate?
Hugh
Posts: 362
Hi,
I need to generate a square wave and the Props I have lying around seemed a good thing to try. What is the highest frequency square wave that I can generate with the Prop? I'm not competent with ASM and on/off/on/off in Spin might not be very effecient.
There isn't a target value as such, I'd just like to know where the limit is likely to be - or NE555 here we come..!
Many thanks
Hugh
I need to generate a square wave and the Props I have lying around seemed a good thing to try. What is the highest frequency square wave that I can generate with the Prop? I'm not competent with ASM and on/off/on/off in Spin might not be very effecient.
There isn't a target value as such, I'd just like to know where the limit is likely to be - or NE555 here we come..!
Many thanks
Hugh
Comments
it's more like: Bye bye NE555 !
The highest frequency you can generate with the PLL of a counter is about 160..200 MHz. Every cog of the Propeller has two such counters.
But if you want to do it just by software with a PASM loop, you need 2 instructions, one for pin-toggle one for jump back in the loop, so you get a square wave frequency of 5 MHz (@80 MHz system clock). With an unrolled loop you can get 10 MHz for a short time.
Hope this helps
Andy
Neat, A typical Kuroneko trick ;-)
Check out the counter section of the PEK (available from "help" menu). You can set these counters from Spin.
I'm no expert on counters but I followed the tutorial to make the PWM section of my motor control demo code. The code will let you adjust the frequency of the PWM on the fly. I don't recall what the max frequency was. I think it was pretty high if you just needed two bits of resolution (square wave).
I'd be surprised if there aren't better ways to do this in Spin.
Edit: As I think about this a bit, I realize the PWM example probably isn't a good one. IIRC there was some setup code for easy PWM cycle. I think this would interfere with a nice square wave. Hopefully someone more knowledgeable about counters will chime in on how to do this in Spin.
http://obex.parallax.com/object/187
edit: after looking at my scope pictures again, the ringing was on both transitions, see attached and notes below from my PropBSC module testing http://forums.parallax.com/showthread.php/143318
"10MHZ propeller generated signal. Ch2 is on the Propeller* Pin (P5). CH1 is on the Translator 5V Logic IO pin (PB5) This is showing the performance of the translator at 10MHZ. Signal loaded through a 4.7k resistor to ground."
-Phil
My experience indicates that ringing will almost entirely disappear if you arrange the circuit so you can connect to it without the use of a longish scope ground lead. For high speed circuitry scope measurements I use a home-built ground connection spring that is only 0.1 inches long. That makes all kinds of noise go away.
Cheers,
Peter
Sapieha has run a DIP prop at 115MHz but I have only achieved ~113MHz on a QFP. But I would not take these frequencies as reliable.
Am I missing something ???
Presume P4 for the example....
BTW the original example should work for P0.
$FFFF_FFEF + 1 = $FFFF_FFF0
$FFFF_FFF0 - 1 = $FFFF_FFEF
How silly of me. I just couldn't see the forest for the trees