Jeremy Leach
Senior Member
Coming back to using PICAXEs after a very long break, I'm just wondering why the Pause command couldn't be given 'intelligent' constants representing the 'actual' time delay after clock speed has been taken into account.
For instance Pause P_1000 where P_1000 is a reserved word meaning 'Pause for 1000 milliseconds'.
The compiler in the editor could translate this reserved word into an adjusted millisecond value before sending the program to the PICAXE.
I expect there could probably be clever tricks done as things stand by defining calculated constants based on the actual values of 'm4' etc, but this would be cleaner.
Admittedly there would have to be a whole array of pause reserved words, but it could be at least the typical ones used for typical scenarios (for instance writing to LCD or OLED, writing to external EEPROM etc). However it would eliminate the need to edit the pause statements in code when the clock frequency is changed. Much the same as the SERIN t4800_8 reserved words I imagine must operate etc.
An even better option would be to have a new command, called something like PauseReal, which would have one parameter representing the 'real' time you want to pause taking clock frequency into account.
For instance Pause P_1000 where P_1000 is a reserved word meaning 'Pause for 1000 milliseconds'.
The compiler in the editor could translate this reserved word into an adjusted millisecond value before sending the program to the PICAXE.
I expect there could probably be clever tricks done as things stand by defining calculated constants based on the actual values of 'm4' etc, but this would be cleaner.
Admittedly there would have to be a whole array of pause reserved words, but it could be at least the typical ones used for typical scenarios (for instance writing to LCD or OLED, writing to external EEPROM etc). However it would eliminate the need to edit the pause statements in code when the clock frequency is changed. Much the same as the SERIN t4800_8 reserved words I imagine must operate etc.
An even better option would be to have a new command, called something like PauseReal, which would have one parameter representing the 'real' time you want to pause taking clock frequency into account.