Sx28 Square Wave
Hello,
I was given this code by Terry a while ago. This was to create a square wave.
Device SX28, Oschs2, Turbo, OptionX, StackX
Freq 50_000_000
OutPin Pin RA.0 Output
Interrupt NOCODE 434_782 '217 khz
OutPin =~ OutPin
Returnint
Program Start
Start:
End
It works fine but is it possible to sweep a frequency range in this interrupt?
I want to start at 180 khz and end at about 225 khz
How many steps can this code do between the stated range?
Thanks,
Cenlasoft
I was given this code by Terry a while ago. This was to create a square wave.
Device SX28, Oschs2, Turbo, OptionX, StackX
Freq 50_000_000
OutPin Pin RA.0 Output
Interrupt NOCODE 434_782 '217 khz
OutPin =~ OutPin
Returnint
Program Start
Start:
End
It works fine but is it possible to sweep a frequency range in this interrupt?
I want to start at 180 khz and end at about 225 khz
How many steps can this code do between the stated range?
Thanks,
Cenlasoft
Comments
With a reload value of 139 you will get (50,000,000 / 139) / 2 = 179856 Hz
With a reload value of 111 you will get (50,000,000 / 111) / 2 = 225225 Hz
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
Post Edited (Bean (Hitt Consulting)) : 2/25/2009 10:31:26 PM GMT
Thanks Bean, I will try it tonight
Cenlasoft
I have been trying Terry's sweep code with no luck. I am sure it me doing something wrong. I used a scope and an LCR circuit to see if I could get to resonance. If I use the interrupt without sweep at one frequency, it works.
Device SX28, Oschs2, Turbo, OptionX, StackX
Freq 50_000_000
OutPin Pin RA.0 Output
reload VAR BYTE
Interrupt NOCODE
OutPin =~ OutPin
Returnint reload
Program Start
Start:
FOR reload = 139 TO 111 STEP -1
PAUSE 1000 ' CHANGES SWEEP SPEED
NEXT
GOTO Start
End
I am trying to get resonance but the square wave produced is not accurate enough.
Thanks for any hints.
Cenlasoft