Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to switch external oscillators? — Parallax Forums

Is it possible to switch external oscillators?

vladkvladk Posts: 26
edited 2015-12-23 15:35 in Propeller 1
Hi All, sorry for stupid questions in advance! I'm just a nub wanted to know more...

The question is - is it possible to dynamically change the external oscillators?

What I mean is: imagine we have 3 different external oscillators (for different purposes - 5.0MHz, 6,25MHz and xyzMHz), we have of course pins (or any other HW abilities) to select the desired oscillator.
My question is: are we able to phisically change the real external oscillator?
«1

Comments

  • vladkvladk Posts: 26
    edited 2015-12-23 15:45
    To be more clear:
    By "phisically" I meant "dynamically switch external oscillators from the cog's code while being able to control the situation".
  • vladkvladk Posts: 26
    edited 2015-12-23 16:30
    Why the question have ever arised? Ok.

    1. We have a lot of VGA drivers already but there is still no universal VGA driver for any particular purposes.
    2. To be "all-purposes VGA driver" an application should be able to switch between many of xVGA timing options.
    3. kuroneku is the King in non-waitvid hi-res applications but his state-of-the-art drivers are tied with the bandwidth factors.
    4. another available waitvid-based VGA-drivers are also tied up to a specific pixel-rates.

    that's why I asked of a way of HW swiching between oscillators - it would be possible to create an "universal" VGA driver to support most of the supported modes of visualisation (simply by loading a cog/cogs by an appropriate driver by a request from the user side).

  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-12-23 13:25
    The speed setting for the Propeller is global, not by cog, and all cogs are running simultaneously hence there is no way to run cog x at one speed and cog y at another.
  • JonnyMac wrote: »
    The speed setting for the Propeller is global, not by cog, and all cogs are running simultaneously so there is no way to run cog x at one speed and cog y at another.
    Yes, I know it. Let's think of the global oscillator change.

  • And there is another question - is it possible to construct an electrical scheme which is capable to demultiplex several oscillators to the one Propeller input (I mean pins XI/XO) ?
  • vladkvladk Posts: 26
    edited 2015-12-23 15:36
    .
  • BeanBean Posts: 8,129
    I have tried doing that between a 10MHz TCXO and a 10MHz reference input. And it would lock up the propeller sometimes.

    It would probably work if you switched the propeller to internal clock during the change over.

    Bean
  • Bean wrote: »
    I have tried doing that between a 10MHz TCXO and a 10MHz reference input. And it would lock up the propeller sometimes.

    It would probably work if you switched the propeller to internal clock during the change over.

    Bean

    Hi, Bean

    Is it means that even when switching between internal/external frequences at the same rate there are the problems arises?


  • I suspect that unless your external sources are synchronous you may well violate the clock input timing spec.
  • vladkvladk Posts: 26
    edited 2015-12-23 16:14
    Ok, lets's imagine an algorithm:
    1. I'm a Spin code that is runing NOW at a fixed X MHz (external), a VGA-driver in a cog is displaing something;
    2. Now I (the spin code) have got somehow (either by pin observing or by monitoring a value in the main RAM or somehow else) the knowledge that I have to change the external oscillator frequency (mainly becourse a user have changed a video-mode);
    3. I switch to the internal oscillator temporarily;
    4. I just change the state of pre-defined pins (or send a command by SPI or inform another cog to do it etc.) to select ANOTHER external oscillator (from the set of availables);
    5. Me (or another cog) changes (selects) another external oscillator;
    6. I switch from the internal frequency (see point 3) to the selected external oscillator (Y MHz).
    7. I (re)load a cog with the appropriate VGA driver;
    8. The user sees the video-mode he expected (640x480, 720x400, 800x600, 1024x768 - from 80x30 8x16-font ending up to 128x96 8x8-font chars with different foreground/background/blink attributes, with 256x192 pseudo-graphics).

    Would it work?
  • BeanBean Posts: 8,129

    Bean
    vladk wrote: »
    Hi, Bean

    Is it means that even when switching between internal/external frequences at the same rate there are the problems arises?

    No, I think that is okay. We were switching between two external frequency sources.

    Bean
  • Bean wrote: »
    Bean
    vladk wrote: »
    Hi, Bean

    Is it means that even when switching between internal/external frequences at the same rate there are the problems arises?

    No, I think that is okay. We were switching between two external frequency sources.

    Bean

    Sorry, I was confused by "it would lock up the propeller sometimes".
  • Step 5A - wait 100us for the PLL to stabilise.
  • vladkvladk Posts: 26
    edited 2015-12-23 15:43
    .
  • vladkvladk Posts: 26
    edited 2015-12-23 15:16
    Step 5A - wait 100us for the PLL to stabilise.

    So, you think it IS possible, doesn't you? (I mean it's possible to dynamically change external oscillators)
    It sounds good! ))

    I'm not an electronic engineer - how could the scheme with oscillators demultiplexing would be drawn?
    I just need an idea - I don't comrehense how signals between an oscillator and the chip are going, what are they, what are the restrictions on them and how to connect in between flawlessly.

  • Bean wrote: »
    I have tried doing that between a 10MHz TCXO and a 10MHz reference input. And it would lock up the propeller sometimes.

    It would probably work if you switched the propeller to internal clock during the change over.

    Bean

    Hi Bean,

    I was thinking a while and realized I didn't understand what was wrong in your case - two almost equal external sources, propeller hanged up sometimes.
    Could you elaborate?

  • Maybe it's possible to use a DS1077 to clock the prop?
  • vladkvladk Posts: 26
    edited 2015-12-23 16:58
    Maybe it's possible to use a DS1077 to clock the prop?

    Wow! How can I miss it! ((
    Excellent idea in the scope of the topic - but I'm still not an electronic engineer and not a guru in propeller's abilities.

    abecedarian, I would be happy if anyone in charge of knowledge confirmed your solution.

    Nevertheless, I've thrown the idea to think the thought of switching oscillators [this idea was dead from the entry as I now understood] and just starting to go thinking around your idea.

    Thanks a lot! I suspect you'll free a lot of minds from my stupid problem ))


    BTW, abecedian, you know - if your idea works it should resolve all the problems with different video-drivers! Could you check it? [My Propellers & boards are still in delivery]


    Best regards, Vladislav

  • Here's what can happen if you just switch between two oscillators at an inconvenient time:

    osc_switch.png

    The runt pulse can violate the Prop's timing requirements and cause it to hang.

    -Phil
  • vladkvladk Posts: 26
    edited 2015-12-23 17:03
    Here's what can happen if you just switch between two oscillators at an inconvenient time:

    osc_switch.png

    The runt pulse can violate the Prop's timing requirements and cause it to hang.

    -Phil

    Sorry, Phil - the image isn't accessible from my side ((

  • Here's what can happen if you just switch between two oscillators at an inconvenient time:

    osc_switch.png

    The runt pulse can violate the Prop's timing requirements and cause it to hang.

    -Phil

    Nevertheless - could you please expand the abecedarian's idea to use external PROGRAMMABLE clock generator?

  • Here's the missing image:
    300 x 136 - 5K
  • BeanBean Posts: 8,129
    Phil, Is there a standard solution to avoid getting the runt pulse ?

    Bean
  • vladkvladk Posts: 26
    edited 2015-12-23 17:22

    The runt pulse can violate the Prop's timing requirements and cause it to hang.

    Here's the missing image:

    Phil, thank you!

    But the idea is to switch clock frequence "softly", let me re-post early thougts:

    Ok, lets's imagine an algorithm:
    1. I'm a Spin code that is runing NOW at a fixed X MHz (external), a VGA-driver in a cog is displaing something;
    2. Now I (the spin code) have got somehow (either by pin observing or by monitoring a value in the main RAM or somehow else) the knowledge that I have to change the external oscillator frequency (mainly becourse a user have changed a video-mode);
    3. I switch to the internal oscillator temporarily;
    4. I just change the state of pre-defined pins (or send a command by SPI or inform another cog to do it etc.) to select ANOTHER external oscillator (from the set of availables);
    5. Me (or another cog) changes (selects) another external oscillator;
    6. I switch from the internal frequency (see point 3) to the selected external oscillator (Y MHz).
    7. I (re)load a cog with the appropriate VGA driver;
    8. The user sees the video-mode he expected (640x480, 720x400, 800x600, 1024x768 - from 80x30 8x16-font ending up to 128x96 8x8-font chars with different foreground/background/blink attributes, with 256x192 pseudo-graphics).

    Would it work?
  • vladkvladk Posts: 26
    edited 2015-12-23 17:45
    Bean wrote: »
    Phil, Is there a standard solution to avoid getting the runt pulse ?

    Bean

    If I understand correctly, a runt pulse will appear to happen anyway if we change input frequency anyhow.

    Is there a decision to resolve the problem? Or the frequencies are fixed for us forever? Is it our limit with Propeller?

  • vladkvladk Posts: 26
    edited 2015-12-23 18:20
    Ok,
    1. what are the consequences of changing from an internal clock to the external? I thought it is Ok by the manual.
    2. if Ok, then what or who can stop me from establishing my frequency (XTAL+PLL) ?
    2a - where is here their runt pulse?
    3. if Ok, then what or who can stop me from establishing my frequency back to internal?
    4. Now I want to switch back to external frequency - You say it can be a runt pulse...

    Ok, lets think of external PLL to avoid runts!
    How is the schema of a Phase Locked Loop (PLL) connected between PX8 and DS1077 should looks about?
    Hope it will cost of a tiny chip and a couple of resistors and condensators.
  • vladkvladk Posts: 26
    edited 2015-12-23 18:18
    To be pedantic, please, clarify how the very 1st time (from startup) the chip switches from internal to external frequency without any runt pulse?
  • Hmmm...

    Just a question - at what frequences (discrete or continuous) the Propeller works?
    The manual says AFAIK about boundary values.

    Does Propeller work at any frequency inside the boundaries?
    If no, what is about precize values in between known boundaries?
  • vladkvladk Posts: 26
    edited 2015-12-23 19:07
    .
  • vladkvladk Posts: 26
    edited 2015-12-23 19:17
    Hope to get an answer later (((
Sign In or Register to comment.