Changing Clock Frequencies on the fly...
Sniper King
Posts: 221
Changing Clock Frequencies on the fly...
I set the clock to RCSLOW in the beginning of the program then When the pin 3 goes high it allows the program to continue.· The first thing it does is to set the clock speed to XTAL + PLL16x.· Program execution stops here. Don't Work
<subject line added by Moderator>
Post Edited By Moderator (Paul Baker (Parallax)) : 8/27/2008 8:58:28 PM GMT
{{ PIR UDA Sensor.spin, v1.1,Michael King ┌──────────────────────────────────────────┐ │ Copyright (c) 2008 Michael S. King │ │ See end of file for terms of use. │ └──────────────────────────────────────────┘ }} CON VAR OBJ Clock : "Clock" Send : "FullDuplexSerial" PUB main Clock.init(5_000_000) clock.setclock(RCSLOW) dira[noparse][[/noparse]16]:=1 repeat waitpeq(%0100, %0100, 0) 'Wait port Port 3 to go high clock.setclock(XTAL1 + PLL16X) 'Set clock to really fast waitcnt(1000000+cnt) outa[noparse][[/noparse]16]:=1 'PIN High of PWR to switch XTEND module on send.start(31,30,0,9600) ' start FullDuplexSerial clock.pauseMsec(500) 'Wait a bit for the XTEND to be ready send.str(string("<*00000001*S*>")) 'Send activation of sensor Message clock.pauseMsec(500) ' Wait for message to be sent outa[noparse][[/noparse]16]:=0
I set the clock to RCSLOW in the beginning of the program then When the pin 3 goes high it allows the program to continue.· The first thing it does is to set the clock speed to XTAL + PLL16x.· Program execution stops here. Don't Work
<subject line added by Moderator>
Post Edited By Moderator (Paul Baker (Parallax)) : 8/27/2008 8:58:28 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
without seeing your clock object it is difficult to see what could be happening.
Look at the attached object that shows how to change the clock spped on the fly, I wrote it for autonatically detecting between different gaming platforms.
Regards,
Coley
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX Forums - The home of the Hybrid Development System and PropGFX Lite
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Digital Technology Group
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.