PDA

View Full Version : Propeller Clock Speed



hippy
09-09-2007, 01:24 AM
First the easy one, to check I'm not missing or misunderstanding something obvious - 5MHz XTAL, 16 x PLL = 80MHz, 4 cycles per instructions = 20MIPS, a NOP in a Cog takes 50nS to execute ?

Secondly, what's the drift on the RCFAST clock while it's running / between power cycles ?

And finally, assuming the drift is relatively low for RCFAST, what is the easiest/cheapest way for a Propeller to work out its actual RCFAST frequency ? With a 64KB Eeprom, I was thinking fit an RC and calibrate the RC decay time using a XTAL, store that in the top of Eeprom then have the RCFAST 'production version' determine its frequency by comparing with the reference value.

If drift is low enough it would be easier to just calibrate and note its RCFAST frequency and use that, and for minimal cost and an easy life, fitting an XTAL may be easier than any RC. I'm open to other suggestions.

deSilva
09-09-2007, 01:37 AM
hippy said...
First the easy one, to check I'm not missing or misunderstanding something obvious - 5MHz XTAL, 16 x PLL = 80MHz, 4 cycles per instructions = 20MIPS, a NOP in a Cog takes 50nS to execute ?

Yes. Most other instructions as well...

said...
Secondly, what's the drift on the RCFAST clock while it's running / between power cycles ?

It is considered to be relativly low, but I made no measurements of my own...


said...
If drift is low enough it would be easier to just calibrate and note its RCFAST frequency and use that, and for minimal cost and an easy life

I expect that temperature effects will have the worst influence. 5°C will considerably differ from 50°C (10% ?)

Why don't you want a crystal, which adds only 4% to the Prop prize?

Ariba
09-09-2007, 03:51 AM
hippy
You can also measure the Frequency of the RC Fast with a connected serial Interface. The Baudrate of the sending device is mostly generated from a Crystal and is therfore very exact. So you only have to send the value $00 and measure the Low time, then you can calculate the frequency from 9 Bittimes and the Baudrate.

But I think there are only a few applications where a crystal can be omitted, with th RCfast you have only 12 MHz clockspeed, and thats not enaugh for Video, VGA, fast FullDuplexSerial etc.
I have also made some experiments with a 5 MHz Resonator (a little bit cheaper than a Crystal), but for color generation on video out, this is not practical. Also if you set only one color for the whole screen, you always get psychedelic color pictures - as in the hippy era ... ;)

Andy

deSilva
09-09-2007, 05:26 AM
@Ariba
(1) The datasheet says RCfast can be between 8 and 20 MHz
(2) Ceramic resonantors are not very precise, certainly not for generating synchronisable colorbursts...
(3) When you disable "baseband chroma" in the VCFG register, disconnect the fourth video resistor, and use the six grayscale colours with chroma-bit=0 only you should get a very clear grayscale image...

hippy
09-09-2007, 07:43 AM
Thanks both. The proposed application was primarily bit-banged in-process-output where even 8MHz would be fast enough, but it would be nice to have some low-speed serial diagnostic output ( ~4800 baud ). No need for video or anything which would need ultra-tight tolerances on timing. I now think a cheap 4MHz resonator is the easiest approach.

deSilva
09-09-2007, 07:58 AM
RS232 will work within 3%. So if you have a chance to basicaly calibrate it (e.g. using Aribas most clever idea) - and store it into the EEPROM, my only concern would be temperature... Maybe Paul has some data ?

It would be best if you could make the PC send something first, again using Aribas trick!

Skogsgurra
09-09-2007, 12:11 PM
I once had an RC clock only available in a bitbanging application and all of a sudden, there was a need for tight timing. I used the mains to calibrate the clock. Mains frequency stays reasonable constant, there is not more than +/-0.1 Hz variation (except for "National Situations" like heavy storms or sabotage) usually less. That translates into a 0.2 % accuracy, which often is good enough. But, of course, you need to have the mains voltage available. Doesn't work for battery powered applications.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Paul Baker
09-12-2007, 12:27 AM
I posted a normalized·f vs·t graph a while ago: http://forums.parallax.com/showthread.php?p=663827
While that graph is only from a sample of one, My preliminary results from an expanded sample set shows little variation in the curve.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

redheadedrod
05-18-2015, 05:21 AM
Waking an old thread because I have a question related to this...

I am looking at potentially using an RF receiver for a project that uses a 10Mhz Crystal.
The RF receiver I am looking at is this one:
http://www.hoperf.co.uk/shop/info-RFM01-433-S1-Receiver-Module-433MHz.html

It is designed to be used with a micro processor so should work well with a propeller. If you look at the documentation it is setup to allow the 10Mhz crystal onboard to be used to "power" a microprocessor. Can the Propeller handle this? Would it be as simple as using 8 x PLL?

Just curious at this point if it is even possible or if I would be better to use a different approach. Seems like if I use just one crystal then I might save some power.
This receiver can be used to read Tire Pressure Monitors and potentially other things as well so I might use them for inter vehicle communications as well as reading tire pressure sensors.

Rodney

Peter Jakacki
05-18-2015, 06:05 AM
Waking an old thread because I have a question related to this...

I am looking at potentially using an RF receiver for a project that uses a 10Mhz Crystal.
The RF receiver I am looking at is this one:
http://www.hoperf.co.uk/shop/info-RFM01-433-S1-Receiver-Module-433MHz.html

It is designed to be used with a micro processor so should work well with a propeller. If you look at the documentation it is setup to allow the 10Mhz crystal onboard to be used to "power" a microprocessor. Can the Propeller handle this? Would it be as simple as using 8 x PLL?

Just curious at this point if it is even possible or if I would be better to use a different approach. Seems like if I use just one crystal then I might save some power.
This receiver can be used to read Tire Pressure Monitors and potentially other things as well so I might use them for inter vehicle communications as well as reading tire pressure sensors.

Rodney

No problem with that, you can even leave the Prop setup as if it were a 10MHz crystal. If you use those huge HC49/4 monsters then you certainly would want to get away from having an extra crystal but there are many very small and inexpensive SMD crystals available in 10MHz.

redheadedrod
05-18-2015, 06:19 AM
Ok thanks for the feedback.. Just figure since it is part of the board and is available maybe I should use it assuming I go after that project. Just wasn't sure if there was a good reason why we use a 5mhz crystal over a much faster one. Is it solely for energy consumption? Which from your comment I am guessing probably if I replaced theirs with a small SMD version it would take less power?

Rodney

jmg
05-18-2015, 07:00 AM
... Just wasn't sure if there was a good reason why we use a 5mhz crystal over a much faster one. Is it solely for energy consumption?

Comes down to how important operating within specs is ?
The data sheet has the Crystal limits, to be within spec.

Loopy Byteloose
05-18-2015, 07:23 AM
Thanks both. The proposed application was primarily bit-banged in-process-output where even 8MHz would be fast enough, but it would be nice to have some low-speed serial diagnostic output ( ~4800 baud ). No need for video or anything which would need ultra-tight tolerances on timing. I now think a cheap 4MHz resonator is the easiest approach.

Well, the desire for a serial diagnostic interface indicates that using an RCFAST won't work. You get too much unpredictable drift in timing as temperatures change. (something like 10%)

A resonator or crystal will work. I believe you want something that has 3% drift or less.

The 5MHz crystal tends to be preferred as it can be used at 16x PLL to get 80Mhz -- a conservative top speed.

If you desire to go at 1x PLL, a faster crystal should work within reasonable limits. The 5MHz xtal does conserve energy, but that reduced energy on the oscillator circuit also reduces the potential for RFI and EMI being generated therein. The faster you clock an oscillator, the higher the power drain, and the more noise you may have to deal with.

Publison
05-18-2015, 03:49 PM
Well, the desire for a serial diagnostic interface indicates that using an RCFAST won't work. You get too much unpredictable drift in timing as temperatures change. (something like 10%)

A resonator or crystal will work. I believe you want something that has 3% drift or less.

The 5MHz crystal tends to be preferred as it can be used at 16x PLL to get 80Mhz -- a conservative top speed.

If you desire to go at 1x PLL, a faster crystal should work within reasonable limits. The 5MHz xtal does conserve energy, but that reduced energy on the oscillator circuit also reduces the potential for RFI and EMI being generated therein. The faster you clock an oscillator, the higher the power drain, and the more noise you may have to deal with.

Loopy,

Did you notice the original posting date?

There has been much discussion over the last 8 years.

redheadedrod
05-19-2015, 02:58 AM
The original poster of this thread might not benefit from it but it does make sense to me.. And since the board that has the 10mhz crystal on it is a radio receiver I am thinking it is probably another good reason to use that crystal. Although it sounds like if I replace it with an SMD chip maybe the power consumption will go down a little more and maybe a little less RF since the module IS an RF receiver that I would be using.

Rodney

Phil Pilgrim (PhiPi)
05-19-2015, 03:34 AM
This is an old thread with a brand-new on-topic query, so posts here are in fair territory.

The main reason for using a 10 MHz crystal vs. 5 MHz is physical size. That said, despite the crystal frequency being outside the 4-8 MHz range spec'd for use with the PLLs, I know of no reported case where a 10 MHz input frequency has been a problem. As you surmised, the correct setting for the PLL is PLLx8, which gives you the same 80 MHz clock as 5 MHz in and PLLx16 does. I seriously doubt that the current consumption between using a 5 MHz crystal and a 10 MHz crystal will be noticeable, since the clock frequencies actually driving the microcontroller hardware are the same in both cases. The only increment might occur in the VCO, which would be running at 160 MHz vs. 80 MHz, but that comprises but a small fraction of the overall current budget.

-Phil

JohnR2010
05-20-2015, 06:46 PM
This is an old thread with a brand-new on-topic query, so posts here are in fair territory.

The main reason for using a 10 MHz crystal vs. 5 MHz is physical size. That said, despite the crystal frequency being outside the 4-8 MHz range spec'd for use with the PLLs, I know of no reported case where a 10 MHz input frequency has been a problem. As you surmised, the correct setting for the PLL is PLLx8, which gives you the same 80 MHz clock as 5 MHz in and PLLx16 does. I seriously doubt that the current consumption between using a 5 MHz crystal and a 10 MHz crystal will be noticeable, since the clock frequencies actually driving the microcontroller hardware are the same in both cases. The only increment might occur in the VCO, which would be running at 160 MHz vs. 80 MHz, but that comprises but a small fraction of the overall current budget.

-Phil

I asked this exact question on current usage with a 10 MHz crystal vs 5 MHz about 6 weeks ago. Peter had recommended I switch over to a 10 MHz SMT crystal to save space on my PCB. The only reason I didn't is I couldn't get a definite answer on the additional power usage. I have used the 5 MHz crystal with the PLLx8 setting to save 10 to 15mA over the PLLx16 setting so that is why I was wondering about the power usage with at 10 MHz? Its good to know there wouldn't be much of a difference I just wonder what "much" is. Are you talking 10 to 50uA difference or would it be more in the milliamp range?