[Coco] 6809/6309 Power Analysis

Lothan lothan at newsguy.com
Thu Jan 21 17:54:12 EST 2010

I would use the shunt resistor since it is the easiest mechanism you can use
to directly measure current with an oscilloscope. The basic premise is based
on Ohm's law that I=V/R so using a shunt resister effectively transforms the
formula into I=V. Just keep in mind that this is the basic theory, but it
doesn't take into consideration the actual voltage dropped across the
resistor or the heat dissipated by the resistor so you'll definitely need to
use the formulas in Step 2 and 3 in the link to determine an appropriate
resistor to use.

I don't think you'll need excessively expensive equipment, though. As you
indicate, the biggest obstacle is eliminating the common mode voltage so you
can monitor only the current actually used when processing each instruction.
I'm beginning to feel really old because it's been something like 15 or 20
years since I've mucked with hardware at this level, but I think either a
differential amplifier or an isolation amplifier can be used to do this.
Basically all you really want to measure is the voltage differential between
V(cwai) and V(any other instruction) so it makes sense to attempt to
eliminate V(cwai) from the measurement.

--------------------------------------------------
From: "Boisy G. Pitre" <boisy at tee-boy.com>
Sent: Thursday, January 21, 2010 4:54 PM
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Subject: [Coco] 6809/6309 Power Analysis

> Calling all hardware/electrical engineering gurus on the list...

>

> As some of you know, I am working on my thesis this semester where I am

> exploring power-aware compiler optimizations. I've selected (surprise)

> the 6809/6309 as my evaluation processor and will be retooling RELIC to

> use the power information that I am attempting to gather to make decisions

> about instruction use based on the current that they draw.

>

> I'm hoping you hardware gurus can give me some input on the measurement

> part, in which I am attempting to determine the current draw of the 6809

> when executing specific instructions. The absolute value is not

> important; it is the relative difference of current draw for different

> instructions that I need to move forward.

>

> Just to give you an idea of the type of equipment that I have access to at

> the UL campus:

>

> - Agilent Technologies MS06104A Mixed Signal Oscilloscope with analog

> probes as well as two 54620-61601 8-wire Logic Analyzer probe cables

> - Agilent Portable Logic Analyzer, don't have the exact model number but

> looks like a microwave oven and I am told costs around \$55K.

>

> The ideas brought up so far for measuring current at the instruction

> level:

> - use a PIC with an A/D convertor to measure the voltage.

> - use a shunt resistor (james recommended this method to me as well in

> private email) to measure current and outlined here:

> http://jet-server.commtest.co.nz/kb2/11624.htm

>

> On the software side, I have constructed several test executables that run

> under NitrOS-9 and execute a particular instruction over and over (with

> interrupts masked of course). The baseline measurement instruction is

> CWAI, which puts the processor in sleep mode. The code looks something

> like this:

>

>

> With interrupts masked there should be no activity and the cwai should put

> the processor to a wait mode. I would then take the measuring device of

> choice and measure the current for a fixed amount of time (say 1 second).

>

> Afterwards, I would run the following program which has a series of 100

> MUL instructions (MUL is chosen for presumably higher use of CPU):

>

> ldd #\$0000

> toploop:

> mul

> mul

> mul

> ....

> mul * 100th instruction

> bra toploop

>

> And again, use the same measuring device to measure the current draw for 1

> second.

>

> With a low and high mark, I could then begin measuring other instructions

> and see where they fall with the high-low current range.

>

> My concern is the accuracy of the measurement, since I expect that the

> difference in current draw between instructions is small. This is just a

> guess, but the level of accuracy that I would need to measure the

> difference in current draw between instructions would have to be AT LEAST

> 10e-3, or .001 amp (1 milliamp).

>

> Suggestions? How would you guys do this? Do I really need the high dollar

> equipment that I have access to, or do I need a high accuracy, sensitive

> multimeter that can measure current in very very small amounts?

>

> Any input from the hardware experts here would be much appreciated.

> --

> Boisy G. Pitre

> http://www.tee-boy.com/

>

>

>

> --

> Coco mailing list

> Coco at maltedmedia.com

> http://five.pairlist.net/mailman/listinfo/coco

>