Xtal1 + pll16x
PaulF
Posts: 62
Hi, I'm new to the Prop and I'm really looking forward to using this high spec chip. I am working my way through the Propellor manual, but i can't get the Blinker2.spin object to work when I set _CLKMODE = XTAL1 + PLL16X.
It works when I use XTAL1 + PLL8X.
I have also tried to use Debug_Lcd_Test which also uses XTAL1 + PLL16X but no joy there either. Any suggestions?
It works when I use XTAL1 + PLL8X.
I have also tried to use Debug_Lcd_Test which also uses XTAL1 + PLL16X but no joy there either. Any suggestions?
Comments
_xinfreq = 5_000_000
if the board you have is based on a 5MHz crystal as some (hydra) has a 10MHz Crystal
JT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
yes i have _xinfreq = 5_000_000. The crystal is a 5Mhz, as I said the program runs fine with xtal1 + pll8x but not with xtal1 + pll16x.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
(b) There are situations when the crystal is not connected correctly or malfunctioning. In that case the Propeller is using a rather undefined frequency... This might work with some PLL-values and not with others...
So can you make sure the Processor runs at 40Mhz with your setting? This needs no special equipment, but rather the observation of the LED blinking, and recalculating the delay!
----
Edit:
(c) There are some crystals that better work with XTAL2 but this is rare....
Post Edited (deSilva) : 2/24/2008 11:32:06 AM GMT
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000
MAXLEDS =1 'Number of LED objects to use
OBJ
LED[noparse][[/noparse]6] : "Output"
PUB Main
{Toggle pins at different rates, simultaneously}
dira[noparse][[/noparse]16..23]~~
LED[noparse][[/noparse]NextObject].Start(16, 100_500_000, 1)
LED[noparse][[/noparse]NextObject].Start(17, 100_500_000, 1)
LED[noparse][[/noparse]NextObject].Start(18, 500_000, 1)
LED[noparse][[/noparse]NextObject].Start(19, 500_000, 1)
LED[noparse][[/noparse]NextObject].Start(20, 500_000, 1)
LED[noparse][[/noparse]NextObject].Start(21, 500_000, 1)
LED[noparse][[/noparse]NextObject].Start(22, 500_000, 1)
LED[noparse][[/noparse]NextObject].Start(23, 500_000, 1)
' LED[noparse][[/noparse]0].Start(16,2_000_000, 0)
repeat
PUB NextObject : Index
{Scan LED objects and return index of next available LEDobject.
Scanning continues until one is available.}
repeat
repeat Index from 0 to MAXLEDS-1
if not LED[noparse][[/noparse]Index].Active
quit
while Index == MAXLEDS
I shall come back to the S/W issues later... I need some time to check, as there are some funny things I do not understand in Blinker2...
Post Edited (deSilva) : 2/24/2008 12:34:19 PM GMT
_clkmode = xtal1
_xinfreq= 5_000_000
the program does not execute. However if I use xtal1 + pll1x (or pll2x, pll4x, pll8x) it seems to run. I have also modified the code to use delays in milliseconds but the delays appear to about half of what I expected.
As I have no prior experience with crystals, what will happen if I use a crystal with a different frequency? What range of crystals can I use with the demo board.
Thanks again for your help
Use a different test program, e.g.
Check whether it's 1 Hz (half second on, half second off) at Pin 0 (or take another pin by changing DIRA)
The propeller should ALWAYS work with it's internal RC clock @ 12 MHz
Then change yout clock settings and see how long it goes well.
Crystals: You can use nearly every crystal between 1 to 10 MHz!
Post Edited (deSilva) : 2/24/2008 12:45:59 PM GMT
Kind regards to all
Paul
And as you are not using COUNT = 0 but COUNT = 1 this could give peculiar effects..
My remarks here:
(a) DIRA in the main program is redundant and confusing
(b) When COUNT has expired in OUTPUT, the variable "Cog" is reset but the COG itself is not killed; this gives most intersing effects when experimenting...
(c) The technique used (use of NextObject) is far beyond the grasp of the beginner, and could be considered very bad style even for very advanced programmers.
(d) The permanent use of nested one-liners leaves the beginner helpless. Yes I know it's the way Start and Stop are used; but it will do no harm do write it out more extensively in the beginning.
(e) As I avoid using the REPEAT count variable outside the loop (to many options in too many languages ) I have not been aware that it is one above the limit when the loop terminates regularly (and one below when counting backwards?) This is used very a-propos in one of the central examples... I do not like that...
Post Edited (deSilva) : 2/24/2008 1:15:09 PM GMT
I'm also new to the Propeller, and I lost·a couple of days trying to figure out this same problem·... so I called Parallax Tech Support, and was told that this issue with "PLL16X" not working, but "PLL8X" working, is a "known issue" (i.e., a known bug with some Propellers which had been shipped to customers), and so they sent me a replacement PropStickUSB.·
The replacement PropStickUSB does not have this problem, i.e.,·it·works·just fine·with "PLL16X".
In the meantime, while waiting on the replacement unit, I·got into the habit of changing every program to use "PLL8X", as I don't trust that every·Propeller I get in the future will continue working properly if·the software·uses "PLL16X", and I don't want one of my robots·to fail·at an inopportune moment.
Good Luck!
Kevin
I believe the Propstick uses a 10MHz crystal. You can't use PLL16X with a 10 MHz crystal because that would give you a system clock of 160MHz which is way out of spec.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yes, Good point... the PropStickUSB comes with a 5MHz crystal (at least the two that I've had, both came with 5 MHz crystals).
And Yes, you are correct, PLL16X *should* always work with the 5MHz crystal, but my first PropStickUSB (I got it·a few weeks·ago) did not work when set to PLL16X, but did work when set to PLL8X.··
To see this in the manual, for anyone experiencing this issue, go to the PropStickUSB page:
http://www.parallax.com/Store/Microcontrollers/PropellerProgrammingKits/tabid/144/CategoryID/20/List/0/SortField/0/Level/a/ProductID/506/Default.aspx
and download the PDF manual entitled "Setup and Testing Lab and Code (.zip)·", v1.0, and go to page 29, section 9.c., where the manual informs the reader that if they have a problem running PLL16X, to try PLL8X, and if that solves the problem, then they·should contact Parallax Tech Support.· That's the issue my PropStickUSB had, that's why I contacted tech support,·that's how I learned about this issue, and got a replacement PropStickUSB.
When·I called tech support,·I was told there was a "known issue" with a batch of Propellers, (I have no idea what batch) and·Parallax replaced the PropStickUSB for me, which I appreciate.···
The new, replacement PropStickUSB works just fine with PLL16X and the 5MHz crystal.···
Kevin