_clkmode
samsearcher
Posts: 13
I'm using this code to flash a LED every second on pin 17 and it works fine
CON
_clkmode = xtal1
_xinfreq = 5_000_000
PUB Toggle
dira[noparse][[/noparse]17]~~
repeat
!outa[noparse][[/noparse]17]
waitcnt(clkfreq + cnt)
This doesn't work
CON
_clkmode = xtal1 + pll1x
_xinfreq = 5_000_000
PUB Toggle
dira[noparse][[/noparse]17]~~
repeat
!outa[noparse][[/noparse]17]
waitcnt(clkfreq + cnt)
Am I missing something here?
I'm using a 5MHz Crystal Digi-key P/N CTX081-ND
is this the wrong code or part?
Thanks
CON
_clkmode = xtal1
_xinfreq = 5_000_000
PUB Toggle
dira[noparse][[/noparse]17]~~
repeat
!outa[noparse][[/noparse]17]
waitcnt(clkfreq + cnt)
This doesn't work
CON
_clkmode = xtal1 + pll1x
_xinfreq = 5_000_000
PUB Toggle
dira[noparse][[/noparse]17]~~
repeat
!outa[noparse][[/noparse]17]
waitcnt(clkfreq + cnt)
Am I missing something here?
I'm using a 5MHz Crystal Digi-key P/N CTX081-ND
is this the wrong code or part?
Thanks
Comments
Okay, I tried it, and both versions worked okay. Are you sure you didn't lose something in the formating of the REPEAT loop in the second case? You can maintain the indents in your post by enclosing the text in code tags.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
[noparse][[/noparse]
This will work
CON
_clkmode = xtal1' + pll1x
_xinfreq = 5_000_000
PUB Toggle
dira[noparse][[/noparse]17]~~
repeat
!outa[noparse][[/noparse]17]
waitcnt(clkfreq + cnt)
This will not work
CON
_clkmode = xtal1 + pll1x
_xinfreq = 5_000_000
PUB Toggle
dira[noparse][[/noparse]17]~~
repeat
!outa[noparse][[/noparse]17]
waitcnt(clkfreq + cnt)
code]
I'm beginning to think maybe I damaged the chip. When I first setup the board I missed the ground to the 3.3v power supply and when I tested the voltage going to the chip it was about 4.5 volts. I fixed the problem and every thing has been fine until I tried the PLL Constant.
I figured that if the chip worked it was fine, now I'm wondering if you can damage part of the chip and not effect the rest.
waitcnt(clkfreq + cnt) in both examples.
Thanks for trying this for me.
·
·· It would appear that the excessive voltage has damaged the PLL circuit on the Propeller.· We have seen this happen at least once before, so it is a good bet.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support