Shop OBEX P1 Docs P2 Docs Learn Events
Disconnecting XTAL with digital switch — Parallax Forums

Disconnecting XTAL with digital switch

groggorygroggory Posts: 205
edited 2012-01-26 15:24 in Propeller 1
I am working on low power, portable design based around a propeller.

One power saving avenue I'm exploring is using the propeller's built in resonator @ 22kHz and a single cog to run in a power saving mode and monitoring a few outside parameters.

When I need better timing for high speed serial or other situations I would use a 5MHz crystal (or maybe 80 MHz crystal and no PLL ...or similar).

The problem arises around the fact that even if you don't use the external crystal it still takes power to keep it oscillating. As such, I would like to remove it from the circuit when I'm not using it. To do this I'm looking at using a digital switch (such as the Fairchild FSUSB31K8X) to remove it.

Do you see any problems in me doing this?

The xtal leads will increase...which means perhaps I should stick with the 5MHz crystal to reduce switching speeds so that board layout isn't as much an issue.

Lead capacitance will increase by around 3.7 pf and lead resistance will increase by around 6.5 ohms.

...I think the chip I'm looking at isn't the best candidate...but what do you think about the concept? Have any better ways of going about this?

Comments

  • pedwardpedward Posts: 1,642
    edited 2012-01-26 13:09
    I don't think the 80Mhz crystal will work, the internal PLL steps up to 16x the crystal, then back down to the selected tap. I've tried a 48Mhz crystal with no luck. I seem to recall that the range is 4-8Mhz for the crystal.

    Have you instrumented the Propeller in both standalone RCSLOW mode and with the crystal attached in RCSLOW mode? I don't know how the silicon is configured, but there is a timing delay in going from one mode to another to allow it to settle, it's possible that the xtal is not oscillating when you switch out of PLL mode. I can't say for any certainty though.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-26 13:16
    I think you're correct about the suggested crystal range, but several Parallax products use a 10MHz crystal. The Hydra and the Propeller Backpack both use 10MHz crystals (I'm pretty sure anyway).

    I'm also pretty sure an 80MHz crystal wouldn't work.

    Does a 5MHz crystal really draw power if you're using RCFAST or RCSLOW?
  • groggorygroggory Posts: 205
    edited 2012-01-26 13:36
    Yes, a crystal draws power if you're using RCFAST or RCSLOW.

    I think an 80MHz crystal will work as long as you disable the PLL.

    I think the maximum speed for a crystal is around 12MHz when using the PLL due to hardware 3rd harmonic filtering limitations in the prop.


    ..........

    Power usage on propeller (single cog running)
    RCslow (~20khz) 70 microamps (.07 milliamps)
    RCfast (~12mhz) 0.8 milliamps
    RCfast with xtal 5mz activated but chip still running on RCfast 1.12 milliamps
    xtal (5mhz) 0.6 milliamps pll off
    xtal (5mhz) + pll1x (5mhz) 1.3 milliamps (The pll itself operates at 80mhz, x1 is a tap)
    xtal (5mhz) + pll8x (40mhz) 2.9 milliamps
    xtal (5mhz) + pll16x (80mhz) 4.8 milliamps

    reset (reset button pressed) 0.8 milliamps
    programming (being programmed F11 from PC, propeller uses 12mhz RCfast) 3.9 milliamps
    brownout occurs at around 2.7 volts, at 2.5 volts 0.2 milliamp, at 2.2 volts 0.09 milliamp

    http://forums.parallax.com/showthread.php?84907-Propeller-Current-Draw
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-26 13:45
    Thanks for the additional information.
    groggory wrote: »
    I think an 80MHz crystal will work as long as you disable the PLL.

    This would be very cool. I'm just surprised I haven't heard of it being done. I've been following the Propeller forum for a few years and I don't recall any mention of using an 80MHz crystal (which isn't to say it hasn't been discussed).

    Thanks for your patience.
  • Christoph_HChristoph_H Posts: 31
    edited 2012-01-26 14:02
    groggory wrote: »
    Yes, a crystal draws power if you're using RCFAST or RCSLOW.
    My understanding is that you if you're using either RCFAST or RCSLOW constants, both the OSCENA (and PLLENA) bits get switched off. So the crystal won't be oscillating.
    If you only change the CLKSEL[2..0] bits and leave OSCENA enabled, the crystal oscillator will continue the draw current.
  • groggorygroggory Posts: 205
    edited 2012-01-26 14:09
    My understanding is that you if you're using either RCFAST or RCSLOW constants, both the OSCENA (and PLLENA) bits get switched off. So the crystal won't be oscillating.
    If you only change the CLKSEL[2..0] bits and leave OSCENA enabled, the crystal oscillator will continue the draw current.

    Gotcha. So when I want to be in 'low power mode'

    Switch off the OSCENA and PLLENA
    Use RCSLOW or RCFAST (as appropriate)
    Run a single cog
    Run @ >2.7V (above brownout)
    Use peripherals connected to high pins (P31,P30, etc) (takes more current to access pins farther down the chain due to internal losses in the propeller).
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-26 14:23
    Generally, you want to change to RCSLOW first, then disable the oscillator. When switching out of RCSLOW, you first start up the oscillator, allow it to stabilize for a time, then switch to whatever crystal-derived clock rate you want. You can switch from RCSLOW to RCFAST while waiting for the oscillator to stabilize if you want. There are some examples of this in any of the loaders I've put in the ObEx. For example, look in the WinBond driver. The loader could be running with any clock and the newly loaded program provides a new CLKMODE value to use. The loader has to switch reliably from one to another before giving control to the Spin interpreter.

    Look at the various power consumption graphs in the Propeller's datasheet. They give a pretty good measure of the power consumption under different conditions. As with all CMOS, the slower things switch, the less power they take, so RCSLOW is best for pure low power consumption.

    I wouldn't worry about which I/O pins you use. There's not really any difference among them. The chain is from one cog to another and there's not much logic involved there. I'd be more concerned about using WAITxxx instructions as much as possible to stop the cog when waiting for a time interval or I/O condition. When stopped, the cog draws minimal power.
  • groggorygroggory Posts: 205
    edited 2012-01-26 14:42
    Excellent advice.

    I think that'll work great.
    Mike Green wrote: »
    Generally, you want to change to RCSLOW first, then disable the oscillator. When switching out of RCSLOW, you first start up the oscillator, allow it to stabilize for a time, then switch to whatever crystal-derived clock rate you want. You can switch from RCSLOW to RCFAST while waiting for the oscillator to stabilize if you want. There are some examples of this in any of the loaders I've put in the ObEx. For example, look in the WinBond driver. The loader could be running with any clock and the newly loaded program provides a new CLKMODE value to use. The loader has to switch reliably from one to another before giving control to the Spin interpreter.

    Look at the various power consumption graphs in the Propeller's datasheet. They give a pretty good measure of the power consumption under different conditions. As with all CMOS, the slower things switch, the less power they take, so RCSLOW is best for pure low power consumption.

    I wouldn't worry about which I/O pins you use. There's not really any difference among them. The chain is from one cog to another and there's not much logic involved there. I'd be more concerned about using WAITxxx instructions as much as possible to stop the cog when waiting for a time interval or I/O condition. When stopped, the cog draws minimal power.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-01-26 14:49
    Hi Mike;
    This is kind of a related topic.
    Is there a way to get RCSLOW to run at 9.6KHz or less?
    If the Props clock was < 9.6KHz one doesn't need to pass FCC radio emission testing.

    Duane
  • pedwardpedward Posts: 1,642
    edited 2012-01-26 15:13
    Heat it up a lot???

    The real way would require some major chip-fu, because the sillycon is in control.
  • groggorygroggory Posts: 205
    edited 2012-01-26 15:24
    Hi Mike;
    This is kind of a related topic.
    Is there a way to get RCSLOW to run at 9.6KHz or less?
    If the Props clock was < 9.6KHz one doesn't need to pass FCC radio emission testing.

    Duane

    You could connect a very slow external oscillator to satisfy this I suppose
Sign In or Register to comment.