SquareWave change frequency without interrupt last cycle
Julian800
Posts: 31
Hi All,
I am doing some squire ware frequency change in high speed (1ms update).· By using SquareWave Object, it change Frequency (FRQA register ) without knowing last square ware cycle finished or not. ·I know the PHSA accumulation and decide Pin output. I can use assembly (mov Result, phsa ) read phsa register and go into loop, but what value I should wait for #0 or ??
I am doing some squire ware frequency change in high speed (1ms update).· By using SquareWave Object, it change Frequency (FRQA register ) without knowing last square ware cycle finished or not. ·I know the PHSA accumulation and decide Pin output. I can use assembly (mov Result, phsa ) read phsa register and go into loop, but what value I should wait for #0 or ??
Comments
-Phil
thanks for your help. I thing the best way is to change FRQA when pin State change.
In SPIN we could use
waitpeq(%0100, %0100, 0) 'Wait for· P2 to be high
waitpne(%0100, %0100, 0) 'Wait for P2 to not match prev. state
FRQA:= xxxx
Post Edited (Julian800) : 6/1/2010 6:29:52 AM GMT