how do we measure current consumed by microcontroller due to execution of specific code directly, without considering number of cycles,etc?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
how do we measure current consumed by microcontroller due to execution of specific code directly, without considering number of cycles,etc?
I'd be interested to know why you want this information. I guess you could write some kind of assembly language code that repeats the instruction over and over again, with a jump back to the start at the end of it all. That way the specific instructions power consumption would dominate the average.
But I don't think it would be very helpful on the UCD31xx family even if you knew the power consumption for each instruction. I don't think that there's much variation, or that the instruction execution is that big a part of the overall power consumption. Let me give you my top two reasons:
2. Much of the power in the UCD31XX microcontroller goes to the peripherals, the DPWM, the Filters, the EADC. A lot of the rest goes to the memories, regardless of what the instruction is
1. The biggest reason is that the UCD31XX ARM7 core is a simple RISC core. It doesn't have instructions that do 5 things simultaneously, like the MACDLT instruction on the C2000 family. It doesn't have a single cycle multiply. Instructions either transfer between memory and registers, or do simple mathematical operations on registers. All of the complex high speed operations are handled by the DPWMs and the Front Ends and the Filters.
So looking for power savings by selecting which instructions to execute probably isn't very fruitful.
Happy Debugging
Ian Bower
I'm somewhat familiar with the MSP430. I assumed you were interested in the UCD3138, since it's pretty much the only widely supported Digital Power processor. Some of my comments are still relevant, but he MSP430 is designed more for low power, so it's probably got more clock gating. And it's a little bit less RISCish, as some of its instructions to mathematical operations on memory. So there's probably more power variation from instruction to instruction.
But this isn't really the forum for that kind of discussion. I'd suggest that you look around for an MSP430 forum that covers this. I don't think it will be hard to find. Low power consumption has always been a very high priority for the MSP430.
Happy Debugging,
Ian Bower