Location of clkfreq variable in ram
Btuss
Posts: 20
in Propeller 2
Stupid question but I'm trying to read the clkfreq from a pasm 2 program. I haven't found anything in the documentation. I've seen another program where it was obtained by rdlong var, #20. On my p2 it seems to be at location 68
Comments
See Spin document, Spin2 language -> Variables (page 6).
CLKMODE => $00040
CLKFREQ => $00044
Spin will save the clock and mode (pnut/PropTool save it in a different location to FlexProp).
In Pasm only code it is up to you to save it AFAIK.
Thank you both
Worth noting that the Spin2 interpreter differs from every other language for the P2, which all use the location for $14 for clkfreq. If you want your code to be portable or compatible, it's best to pass clkfreq in to the PASM from the high level language (Spin, C, BASIC, or whatever).
Actually, $14 is used for clkfreq. $1c is used for the user baud rate.
Aargh yes, thanks for the correction. I'll update my original post to fix this.