thunderace7
New Member
Hi. Can someone help me with understanding the setfreq command, please?
If I explain how I think it works can you either confirm it or correct me?
As I understand it, a picaxe can use the internal oscillator or an external one.
The internal oscillator is enabled by using setfreq mx, where x represents the speed in MHz. (Or kx for lower, KHz, speeds). If a number is chosen that is not supported by the chip in use PE6 will flag an error. If no setfreq command is used the chip defaults to 4MHz (Or 8MHz for x2 chips).
External oscillator is enabled by using setfreq emx in a similar manner to above. As PE6 has no knowledge of the resonator that is fitted it cannot make any checks other than whether the chosen value is possible with the picaxe in use (I imagine that something like setfreq em24 would be flagged as an error). What happens if I use setfreq em64 but have a 4MHz resonator fitted? Does it give an error message? Does it work out what resonator is fitted and correct the setting? Does it drop back to the default frequency? Or something else?
Is it possible to tell what frequency a picaxe is running at?
Thanks.
If I explain how I think it works can you either confirm it or correct me?
As I understand it, a picaxe can use the internal oscillator or an external one.
The internal oscillator is enabled by using setfreq mx, where x represents the speed in MHz. (Or kx for lower, KHz, speeds). If a number is chosen that is not supported by the chip in use PE6 will flag an error. If no setfreq command is used the chip defaults to 4MHz (Or 8MHz for x2 chips).
External oscillator is enabled by using setfreq emx in a similar manner to above. As PE6 has no knowledge of the resonator that is fitted it cannot make any checks other than whether the chosen value is possible with the picaxe in use (I imagine that something like setfreq em24 would be flagged as an error). What happens if I use setfreq em64 but have a 4MHz resonator fitted? Does it give an error message? Does it work out what resonator is fitted and correct the setting? Does it drop back to the default frequency? Or something else?
Is it possible to tell what frequency a picaxe is running at?
Thanks.