Clock to run SX
crazieson
Posts: 2
Hello all, Im having hard time figuring out what kind of clock I should use to run SX in Basic. I have a 10MHz crystal and i needed a clock that will best suite its conditions. Can someone help? The code will also be a major help..
Comments
I'm having a hard time understanding your question. Asking what clock you need to run the SX in Basic is like asking what gas you need to drive your car down the road. For the car? Same gas as you use it to drive anywhere else. For the SX? Same clock you use it to run any other code. Do you believe that you need different clocks to run assembly as opposed to SX/B on the SX chip, or are you asking something more like, "What speed clock should I use?" but have phrased the question in a confusing manner?
You then say you have a 10 MHz crystal and need a clock to best suit it's condition. I'm not following you here at all. Are you asking for a circuit to drive a crystal and make an oscillator?
Finally, you ask for some code. Code for what? Code to make a pace maker? Code to send a rocket to the moon? Code to make an LED blink? If you're looking for code to drive a clock, then I think you need to do some more research on how computers work. If not, then you need to phrase the question so it can be understood.
Thanks, PeterM
I have to admit, I was really stranded, and I still am. A little bit more specific; I need to get a code on a crystal with 4MHz to count the time. The only thing I know so far is just the freq directive:
device SX28L, oscxt1, TURBO, STACKX, OPTIONX
FREQ 4_000_000
the rest, Im clueless....Thank you for your time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Sounds like starting with SX/B and the help files and samples is the place to start. If you plan to use the internal clock, the directive is OSC4MHZ instead of oscxt1, but be aware that the internal crystal isn't all that accurate so it probably won't work for a clock.
Thanks, PeterM