This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calculate CPU-Clock

Hi,

i need to know the cpu-clock of the cpu i am running my program on.

do you have an idea how i can calculate the actual cpu-clock on an C167?

  • No way unless you have some known time reference.

    Sauli

  • how i can calculate the actual cpu-clock on an C167?

    Generally speaking you shouldn't be trying to. Embedded software absolutely has to be configured for the environment it's to be embedded into. The CPU clock frequency should be the first and foremost piece of environment specification to be fixed.

    You can't really calculate the CPU clock speed in any truly useful way. The only option would be to compare the speed of a delay loop against that of a known reference clock external to the controller.

    This is really something you want to control, not measure.

  • If you want to run a single image on multiple hardware versions with different clock speeds, you might be able to add some kind of hardware ID on the boards and read the pins using normal I/O. The hardware ID would then correspond to a fixed CPU speed, causing the software to use different (timer) settings.

    Kind regards,
    Joost Leeuwesteijn