Pllena
Bobb Fwed
Posts: 1,119
So how should I execute code to alter the PLL/XTAL?Manual p.29 said...
Allow 100 μs for the Clock PLL to stabilize before switching to one of its outputs via the CLKSELx bits. Once the Crystal Oscillator and Clock PLL circuits are enabled and stabilized, you can switch freely among all clock sources by changing the CLKSELx bits.
In my program I am going into a low power mode:
clkset(%0_0_1_01_010, 5_000_000) 'no PLL
Then I want to ramp up the speed again. Do I have to do this:
clkset(%0_1_1_01_010, 5_000_000) waitcnt(clkfreq / 10_000 + cnt) ' wait 100microseconds clkset(%0_1_1_01_111, 80_000_000)
Or do I do this:
clkset(%0_1_1_01_011, 5_000_000) 'LSB change to use PLL1X waitcnt(clkfreq / 10_000 + cnt) ' wait 100microseconds clkset(%0_1_1_01_111, 80_000_000)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Comments
HTH
Too bad the propeller doesn't have compile-time (or programmed-time) calibrated internal oscillators like some chips have. That would be close enough for me to use, and at 20kHz it would save me a lot of power.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
You could write a simple test app using RCSLOW or RCFAST, monitor pin 31, and use the prop terminal to send across "U" (binary is %1010101) at 9600 baud on the prop-plug COM port. Then report the pin transition times (in clocks) back over the serial link (pin 30) using simple serial at 9600 baud also. Your transition clocks * 9600 should be the number of clocks per second.
edit: you'll need to use your recently discovered timing info to set the proper baud-rate on simple-serial to send your result back.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.