Shop OBEX P1 Docs P2 Docs Learn Events
Clock to run SX — Parallax Forums

Clock to run SX

craziesoncrazieson Posts: 2
edited 2006-03-18 07:26 in General Discussion
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

  • PJMontyPJMonty Posts: 983
    edited 2006-03-17 08:00
    Crazieson,

    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
  • craziesoncrazieson Posts: 2
    edited 2006-03-18 03:34
    Thank you Peter for your prompt reply,
    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 WilliamsJon Williams Posts: 6,491
    edited 2006-03-18 04:10
    What do you mean, "count the time"? Are you wanting to make a real-time-clock? If yes, you'll find a project in the SX/B help file that will be useful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • PJMontyPJMonty Posts: 983
    edited 2006-03-18 07:26
    Crazieson,

    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
Sign In or Register to comment.