Shop OBEX P1 Docs P2 Docs Learn Events
SX Sim truncating — Parallax Forums

SX Sim truncating

BebopALotBebopALot Posts: 79
edited 2006-02-04 00:58 in General Discussion
I want to run my SX28 with a 5.120 MHz crystal oscillator. The SX Sim truncates it to 5MHz. As a result, my timing is off. Is there anything I can do to get the SX Sim not to do that?

Thanks, BBAL

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-02 11:37
    I imagine that you can ask Guenther to add code for such.
    {I think it is in VisualBasic.}

    Alternatively, you could try runing it 10 times faster and adjust your read outs by dividing by ten.
    That would only give a ballpark figure as you would still be short by 0.200.

    Maybe, and just maybe you can get it to operate at 512Mhz and divide by 100.

    I am assuming that it won't accept plain old Hz as a number, only Mhz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 2/2/2006 12:05:15 PM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-02-02 15:22
    BBAL,

    until now, SXSim used a long variable to hold the specified clock frequency - this is why it truncated all "odd" values - shame on me! This is fixed in the meantime, and will come with the next release soon.

    Thanks for pointing out this bug!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-02 15:52
    How is that for response.
    Thanks Guenther.
    Since I also now know it will become available I can think of ways to use it too.

    Please be sure to document the convience.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • BebopALotBebopALot Posts: 79
    edited 2006-02-02 23:36
    Thanks for that reply - I can estimate it like Kramer said. I just wanted to make sure I wasn't doing something like picking a "wrong MHz" crystal or something crazy like that.

    Thanks both to Geunther and Kramer.

    -BBAL
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-03 06:37
    I just talk, G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-02-03 09:24
    As a matter of fact, the MIDI baud rate of 32,000 baud can easily derived from even clock frequencies (much easier than "standard" rates like 38,400). I think this is why the guys who defined the MIDI standard have choosen this baud rate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • PJMontyPJMonty Posts: 983
    edited 2006-02-03 09:48
    G
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-03 09:55
    Ironicially, I always thought the opposite [noparse][[/noparse]That MIDI chose a special figure to make it hard for engineers to make a generic device]. Obviously, I hadn't done the math.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-02-04 00:58
    Peter,

    yes, you are right - the MIDI baud rate is 31250, and not 32000 as I had stated before.

    Well, now that we have an SX device that can be clocked at 50 MHz, instead of just 1 MHz, here are the typical constants for the "standard" SX UART VP @ 50 MHz to handle the 31250 MIDI baud rate:

    baud_bit = 3
    start_delay = 13
    int_period = 200

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.