Propeller Timing / Output frequency
heathclf
Posts: 43
I'm running a propeller chip at 80MHz, and am trying to see how precise I can get some timing. I tried :
T1 := cnt
waitcnt(1 + cnt)
T2 := cnt
dT := T2 - T1
outa[noparse][[/noparse]9..4] := dT
Hoping that only a few ticks would go by, and I could see the binary number on my LEDs but had to wait much much longer in order for it to even execute fully, which is a little confusing, as cnt is supposed to keep track of each 'tick' and I thought I remembered reading that each instruction was 4 ticks.
So then, I hooked it up to a function generator (this time running the paralax at 80MHz), to see how fast of a wave I could output and using code similar to:
repeat
!outa[noparse][[/noparse]pin]
waitcnt(TimeDelay + count)
could only get a square wave with a high time and low time of 390 counts each (~17kHz square wave). The wave is nearly perfectly square, and so I don't get why I can't get it to execute faster than that.
Any help with these two very similar questions would be greatly appreciated.
Thanks
T1 := cnt
waitcnt(1 + cnt)
T2 := cnt
dT := T2 - T1
outa[noparse][[/noparse]9..4] := dT
Hoping that only a few ticks would go by, and I could see the binary number on my LEDs but had to wait much much longer in order for it to even execute fully, which is a little confusing, as cnt is supposed to keep track of each 'tick' and I thought I remembered reading that each instruction was 4 ticks.
So then, I hooked it up to a function generator (this time running the paralax at 80MHz), to see how fast of a wave I could output and using code similar to:
repeat
!outa[noparse][[/noparse]pin]
waitcnt(TimeDelay + count)
could only get a square wave with a high time and low time of 390 counts each (~17kHz square wave). The wave is nearly perfectly square, and so I don't get why I can't get it to execute faster than that.
Any help with these two very similar questions would be greatly appreciated.
Thanks
Comments
-Phil
Does anyone know when the assembly documentation is supposed to be completed?
Thanks.
You can generate much faster pulses in Spin using the built-in counters.· Check out the Frequency Synthesis object in the Propeller Object Exchange.
·
I normally use it as an object, so have modified it to work standalone.
/Nicke