I want to find which speed the 14M2 is running in a program that uses M32, M16 and K31 at different stages; there's an interrupt with a serout so I need to be able to restore the right speed after serout, before return from interrupt.
It seems that the SFR called OSCCON at $99 ($19 in Bank 1). My reading of the manual suggests that PEEKSFR, $39, b0 should access OSCCON. But according to westaust's table it should be PEEKSFR, 143, b0.
In the simulator, both addresses return 0 for all setfreqs.
At last, the questions;
Which is the peeksfr address to use to read OSCCON in a 14M2?
Does the simulator work on SFRs?
Am I approaching the original problem, returning from an interrupt at the right clock speed, in the best way?
Thanks,
Derek
It seems that the SFR called OSCCON at $99 ($19 in Bank 1). My reading of the manual suggests that PEEKSFR, $39, b0 should access OSCCON. But according to westaust's table it should be PEEKSFR, 143, b0.
In the simulator, both addresses return 0 for all setfreqs.
At last, the questions;
Which is the peeksfr address to use to read OSCCON in a 14M2?
Does the simulator work on SFRs?
Am I approaching the original problem, returning from an interrupt at the right clock speed, in the best way?
Thanks,
Derek