View Full Version : CLKFREQ change during runtime

11-17-2010, 03:49 PM

I have a problem with the clkfreq.
I try to open a file (it is working), but the clkFreq value change during this process and I don't know why. The value befor open: 80.000.000, value after : 3.

waitcnt(cnt + 2 * clkfreq)

if strcomp(fsrw.openFile(fileNamePtr,"r"),fileNamePtr) == false
ser.str(string(13,10,"File not found!"))
return -1'fail
waitcnt(cnt + 2 * clkfreq)

Please Help!


Mike Green
11-17-2010, 04:28 PM
It's very difficult to tell what's going on from just a small program fragment. Usually the problem is somewhere else. Keep in mind that CLKFREQ is just the 1st 4 bytes of memory. If you're using pointers and the pointer value is zero, it's easy to accidentally change CLKFREQ via a pointer reference. For example,

LONG[ Pointer ] := 3

will change CLKFREQ to 3 if Pointer is zero.