Question on Counter applications
Steel
Posts: 313
I loaded the code for "Demonstration of PWM version of NCO/PWM counter mode"
I set up the filter with a 10k and a .1uF cap.
Everything works great.· I see the ramp from 0 to 3.3V.
I changed the period to 4096 for 12-bit resolution on the value.· The ramp is still there.
So I am trying to toggle 'parameter' from $FFF to $000 repeatedly to create a square wave:
·repeat
····· Parameter := $FFF
····· WAITCNT([noparse][[/noparse]clock cycles]+ CNT)
····· Parameter· := $000
····· WAITCNT([noparse][[/noparse]clock cycles]+ CNT)
Unfortunately, the fastest 'real' square wave that I can get is 200hz?· Anything faster than that, the square wave begins attenuating dramatically.
Am I doing something wrong, or does the NCO not handle audio-resolution.
I would *really* like to make a frequency generator that runs up to 20k and I was under the impression that this could be done.· Right now I would be lucky to get 1k?
Shaun
Post Edited (Steel) : 9/14/2007 4:57:04 PM GMT
I set up the filter with a 10k and a .1uF cap.
Everything works great.· I see the ramp from 0 to 3.3V.
I changed the period to 4096 for 12-bit resolution on the value.· The ramp is still there.
So I am trying to toggle 'parameter' from $FFF to $000 repeatedly to create a square wave:
·repeat
····· Parameter := $FFF
····· WAITCNT([noparse][[/noparse]clock cycles]+ CNT)
····· Parameter· := $000
····· WAITCNT([noparse][[/noparse]clock cycles]+ CNT)
Unfortunately, the fastest 'real' square wave that I can get is 200hz?· Anything faster than that, the square wave begins attenuating dramatically.
Am I doing something wrong, or does the NCO not handle audio-resolution.
I would *really* like to make a frequency generator that runs up to 20k and I was under the impression that this could be done.· Right now I would be lucky to get 1k?
Shaun
Post Edited (Steel) : 9/14/2007 4:57:04 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
(http://en.wikipedia.org/wiki/Low-pass_filter)
*Peter*
I leftt out all units just to entertain you