SimpleIDE Question
nchowah
Posts: 4
Hi,
I'm a "newbie" to the SimpleIDE environment. I've been experimenting with a little project and I have a question. When using the SPIN language you have the ability to specify both the crystal frequency and the phase locked loop multiplier. I'm wondering about this with SimpleIDE. It seems like I read, somewhere, that it depended on the type of propeller board that you had when the project was created. I have a propeller professional development board. Can someone tell me what speed it is running at by default and whether or not I have any control over that from within the C implementation for the propeller.
Thanks
I'm a "newbie" to the SimpleIDE environment. I've been experimenting with a little project and I have a question. When using the SPIN language you have the ability to specify both the crystal frequency and the phase locked loop multiplier. I'm wondering about this with SimpleIDE. It seems like I read, somewhere, that it depended on the type of propeller board that you had when the project was created. I have a propeller professional development board. Can someone tell me what speed it is running at by default and whether or not I have any control over that from within the C implementation for the propeller.
Thanks
Comments
The phase lock loop is specified in software, in the code you compile. Most code is written for the stock board at the stock speed, which is 5Mhx crystal with 16x phase lockedloop.
Well written code takes the crystal frequency and phase locked loop into consideration and adjusts any functions that rely on these settings. For example, baurd functions rate need to be adjusted if you change the frequncy or phase lock loop.
So the crystal frequncy is determined by whatever hardware you bought, and you can change the frequency in software.
In your case, I believe the professional development board is still 5MHz crystal, so any stock prgram can usually be expected at 80MHz, unless it is for a particular purpose, and would so such. You can set you own code to whatever frequncy the clock and phase lock loop can generate. You have to make should you account for changing the phase lock loop multiplier in your own code.
Someone will usually correct me if I have made any mistakes.
The Propeller Professional Development Board has the ability to put all the pins where you want them via jumpers, so you can set it up as a "Demo Board", using the appropriate pins for a Demo Board in the Spin File.
Change the phaselocked loop from 16 to another interger from 1 to 16 is how the frequency can be changed in software. Often you need todo a reset of some kind depending on whats going on.
In another environment (propforth) when we change from 80MHz to RCSlow to save power, we do a soft reset or else the comms get messed up because of the way it affects the bvaud rate. when we get another signal and wake from RCslow (low power mode) to normal80MHz mode we again do another reset to ensure the coms are not messed up.
There should be exmples of low power mode in the obex but I'm not familliar with them.
I found it buried within the "propeller.h" as a macro.
"clkset(mode, frequency)"
Frequency is a funny one because as near as I can see it simply sets/update the contents of an internal register for programmatic use later. Clearly the external crystal runs at it's dominant mode frequency.
Mode on the other hand configures the internals to select the 16X tap of the phase locked loop. I have a "Rev. A" propeller professional development board and I've looked it over carefully and I can't see any jumpers that might be interrogated by the chip to establish the PLL setting. Maybe other boards have them, still I wonder. Under the build manager I see several board types but nothing that makes it obvious as to a default PLL setting. Oh well, as Franklin said "experience keeps a dear school, but a fool will learn in no other".
I truly appreciate all of your comments and help. I just may change my xtal to one running at 6.25MHz because the final frequency would make some of the timing math simpler, thank you for the suggestion.
Page 22 gives an overview while Table 1-10 on page 30 shows the details
Both Spin and PASM have a CLKSET command shown on pages 71 and 271 respectively.
https://www.parallax.com/sites/default/files/downloads/P8X32A-Web-PropellerManual-v1.2.pdf
So my next questions are;
1-) How do I make the chip do a "Soft Reboot" from within my code?
2-) Are there any other registers that I should be concerned with after such a reboot to get the comms working?
Again, thanks to all of you that have posted trying to get me straightened out.
RESET would be a call to your initialization routines that read the settings for the comms, and set them up. My stuff reads and starts the comms, sets counters back to zero (to the start) sets the buffers to zero, etc. Your stuff would just set up tyou initialization stuff as a function to call after you change you clock.
I don't recall any reset internalto the prop, aside from pullin the reset line, but that we reset everything, and you would forget what you were doing. But its been a while since we had to do any work in that area, so there maybe stuff I'm leaving out.