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

How to get to know the exact instruction address or find the instruction address for least current consumption?

Hello to all,

In order to measure the current variation due to instruction address location. I filled the memory with NOP instructions and tried to observe the variation in the current consumption due to change in the instruction address, although the instruction is throughout same.

And as a result, I have got the current consumption, but from the captured current consumption for multiple times, I think there is some periodic behaviour is occurring, but couldn't find the instruction address on which it's beginning and on which it ends. Since the frequency of measurement is 12MHz and target processor is ARM Cortex-M4. Is there any way to find out the least current consumption on which instruction address???

  

Thanking you,

Regards,

Himanshu 

Parents
  • This is just theory; I do not know if it will work.

    I think you can make very accurate measurements if you use an external oscillator, which you can control by another microcontroller running at higher speeds.

    As already mentioned, you can change the state of a GPIO-pin.

    This can be done to synchronize, so you know that you're at address 0x200 for instance.

    Since each NOP will always take one clock cycle, then you can use the external microcontroller to count the clock cycles.

    So in this example, you have a pin-toggle at address 0x200, then you set your counter to 0x200 and increment it each time the oscillator's pin go high.

    -So if you can find a microcontroller, that can handle such high frequencies, then that might be the most accurate way.

    (perhaps by using a timer input capture pin on a STM32H7, you could set the counter register to the starting address and let the timer count on each rising edge of the oscillator pin; the STM32H7 might be able to measure the temperature using external sensors, but it seems you have equipment for this already).

    You might also be able to peek inside the MCU by using SWD, but I would expect that to be more inaccurate and also use some extra power, so it would affect the results.

Reply
  • This is just theory; I do not know if it will work.

    I think you can make very accurate measurements if you use an external oscillator, which you can control by another microcontroller running at higher speeds.

    As already mentioned, you can change the state of a GPIO-pin.

    This can be done to synchronize, so you know that you're at address 0x200 for instance.

    Since each NOP will always take one clock cycle, then you can use the external microcontroller to count the clock cycles.

    So in this example, you have a pin-toggle at address 0x200, then you set your counter to 0x200 and increment it each time the oscillator's pin go high.

    -So if you can find a microcontroller, that can handle such high frequencies, then that might be the most accurate way.

    (perhaps by using a timer input capture pin on a STM32H7, you could set the counter register to the starting address and let the timer count on each rising edge of the oscillator pin; the STM32H7 might be able to measure the temperature using external sensors, but it seems you have equipment for this already).

    You might also be able to peek inside the MCU by using SWD, but I would expect that to be more inaccurate and also use some extra power, so it would affect the results.

Children