Spin - shortest duraition for pause
Hi all
Making good progress now with my little project. I have yet to receive the DDS but am hopeful that it might work first time.
I have been experimenting with delays to run my data clock. Using the code:
Using this expression I hit a minimum of about 40us below which the code locks up.
1) Is this due to the 381 cycle delay for reading cnt?
2) Is PASM the only way to go faster? (I have to send data so it's not just a clock that I need)
Must say that I am finding my Propellor programming very interesting. It's nearly as absorbing as my network analyser!
Cheers
Richard
Making good progress now with my little project. I have yet to receive the DDS but am hopeful that it might work first time.
I have been experimenting with delays to run my data clock. Using the code:
Duration := 200
Duration := clkfreq/5_000_000*Duration 'Duration in 200ns steps
Using this expression I hit a minimum of about 40us below which the code locks up.
1) Is this due to the 381 cycle delay for reading cnt?
2) Is PASM the only way to go faster? (I have to send data so it's not just a clock that I need)
Must say that I am finding my Propellor programming very interesting. It's nearly as absorbing as my network analyser!
Cheers
Richard
Comments
con _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 ' use 5MHz crystal ' _xinfreq = 6_250_000 ' use 6.25MHz crystal CLK_FREQ = ((_clkmode - xtal1) >> 6) * _xinfreq MS_001 = CLK_FREQ / 1_000 US_001 = CLK_FREQ / 1_000_000
I use the CLK_FREQ constant (and other calculated constants) in my programs -- this might help you speed things up a bit. Ultimately, though, for sheer speed PASM is going to be the way to go.
That's very clever. Jon, do you have any idea about how much time using these constants saves vs. having an in-line calculation?
Thanks.
Do I use these constants in the form:
Repeat Dosomething Waitcnt (us_001 + cnt) 'Wait 1us Dosomethingelse