Maker Pro
Maker Pro

68HC11 & Code Performance

R

rasega

Jan 1, 1970
0
Hi,
I'm trying & debugging a little software wrote by me and some other
friend of mine in 68HC11 Assembly code.
Now I'd like to "benchmark" this software !!

What's the best way to estimate and/or measure the duration of the main
program or some little cycle ??
How can I also know what's the dimension taken on 68HC11 RAM by the
software since I know how many KB it takes on my pc ??

Thank to All for any suggestion...
 
B

BobG

Jan 1, 1970
0
I just run the subroutine 1000 times in a loop with a 'begin' and 'end'
printout and time it with a watch
 
A

Anthony Fremont

Jan 1, 1970
0
rasega said:
Hi,
I'm trying & debugging a little software wrote by me and some other
friend of mine in 68HC11 Assembly code.
Now I'd like to "benchmark" this software !!

What's the best way to estimate and/or measure the duration of the main
program or some little cycle ??

I usually toggle an i/o pin at the beginning and end of the routine.
Then use an o-scope to measure the time.
How can I also know what's the dimension taken on 68HC11 RAM by the
software since I know how many KB it takes on my pc ??

If you wrote it in assembler, you should "just know" the answer.
 
R

rasega

Jan 1, 1970
0
What about using the "time" function with PCBUG11 ??
Sorry, I'm a newbie than...Why (and how !!) I "just know" the answer
please ??
 
B

BobG

Jan 1, 1970
0
Each assembly language instruction takes from 2 to 6 cycles depending
on how complicated they are, so laets say 3 cycles average, and a cycle
is xtal/4, so 8mhz xtal->2mhz instruction cycle-> 500 or 600 thousand
instructions per sec, 500 or 600 instruction per ms. So if you
subroutine is 100 inline instructions, I bet it takes a 5th or a 6th of
a sec. Time it and tell me if I'm right.
 
J

Jasen Betts

Jan 1, 1970
0
Hi,
I'm trying & debugging a little software wrote by me and some other
friend of mine in 68HC11 Assembly code.
Now I'd like to "benchmark" this software !!

What's the best way to estimate and/or measure the duration of the main
program or some little cycle

set one of the output pins when you enter it and clear it when you exit,
attach an analogue voltmeter to the pin, the voltage you see represents
the fraction of time spent in that section of code. if you want to
measure duration attach an oscilloscope.
How can I also know what's the dimension taken on 68HC11 RAM by the
software since I know how many KB it takes on my pc ??

that depends what the program does.
as for how much memory the machinne code itself ocupies lookup the
details on the motorola Srec format and open your assembler output
in a text reader.

Bye.
Jasen
 
rasega said:
What about using the "time" function with PCBUG11 ??
Sorry, I'm a newbie than...Why (and how !!) I "just know" the answer
please ??

The reason you should 'just know' is that the assembler (any I've used)
requires you to define the RAM locations you're going to use so you
have a list. Count them up. The assembler likely generated a list file
showing the memory locations used for RAM, tables and code.

The software that would help is a simulator. Google for it as there may
be some freeware. The simulator will display the running total of
machine cycles used for each instruction. Knowing the crystal frequency
and number of machine cycles vs crystal (its in the data book. The
..PDFs are freebie downloads from Freescale) you can tell the run time
to the microsecond.

GG
 
J

John Fields

Jan 1, 1970
0
set one of the output pins when you enter it and clear it when you exit,
attach an analogue voltmeter to the pin, the voltage you see represents
the fraction of time spent in that section of code. if you want to
measure duration attach an oscilloscope.

---
No. Benchmarking code isn't quite the same as setting ignition
point dwell on a '55 Chevy. The SET and CLEAR trick is OK, but you
need to use that signal to gate an external counter and then, when
you get the result, subtract out the execution times of the SET and
CLEAR instructions to get the real length of the cycle.
---
that depends what the program does.

---
No, it doesn't. All he wants to know is how much of an HC11's RAM
is being used by his process and, since he assigned storage, all he
has to do is count up them variables.

In any case, his output listing should give him the last used byte
of RAM and, since he orged the first byte, (or his assembler did
when it was told what it was assembling for) a simple subtraction
will define the space.
---
as for how much memory the machinne code itself ocupies lookup the
details on the motorola Srec format and open your assembler output
in a text reader.

---
I think you're trying to bullshit your way into an arena where you'd
best not venture if you want to stay out of trouble.

For example, Motorola "S" records contain much more than just object
code, so why would you want to use them to determine the length of
the program when you can use your assembler's output listing and
save yourself a lot of grief?
 
B

BobG

Jan 1, 1970
0
think you're trying to bullshit your way into an arena where you'd
best not venture if you want to stay out of trouble.

John Fields
Professional Circuit Designer
=================================================
You should add a line that says "and Programming Expert" so we know
there is some credibility behind all the bluster and accusatoy tone.
 
J

John Fields

Jan 1, 1970
0
think you're trying to bullshit your way into an arena where you'd
best not venture if you want to stay out of trouble.

John Fields
Professional Circuit Designer
=================================================
You should add a line that says "and Programming Expert" so we know
there is some credibility behind all the bluster and accusatoy tone.
 
J

Jasen Betts

Jan 1, 1970
0
No. Benchmarking code isn't quite the same as setting ignition
point dwell on a '55 Chevy.

so it's only an aproximation
The SET and CLEAR trick is OK, but you
need to use that signal to gate an external counter and then, when
you get the result, subtract out the execution times of the SET and
CLEAR instructions to get the real length of the cycle.

an osciloscope scope will tell you how long the pulse is,m if the clock ia
stable that's enough.

No, it doesn't. All he wants to know is how much of an HC11's RAM
is being used by his process and, since he assigned storage, all he
has to do is count up them variables.

if that's all he does he'll get the wrong answer.
you also need to add up all the stack space that could be in use
simultaneously, and a number of other factors.
For example, Motorola "S" records contain much more than just object
code, so why would you want to use them to determine the length of
the program when you can use your assembler's output listing and
save yourself a lot of grief?

Yeah that'd be easier.
To tell the truth I forgot about the output listing...
It's been a couple of months snce I laste programmed a microcontroller.

Bye.
Jasen
 
J

Jasen Betts

Jan 1, 1970
0
On 2005-09-18, John Fields <[email protected]
wrote
On Sat, 17 Sep 2005 21:46:17 +1200, Jasen Bett
[email protected]> wrote


set one of the output pins when you enter it and clear it when yo exit
attach an analogue voltmeter to the pin, the voltage you se represent
the fraction of time spent in that section of code. if you want t
measure duration attach an oscilloscope

No. Benchmarking code isn't quite the same as setting ignitio
point dwell on a '55 Chevy
so it's only an aproximatio
The SET and CLEAR trick is OK, but yo
need to use that signal to gate an external counter and then, whe
you get the result, subtract out the execution times of the SET an
CLEAR instructions to get the real length of the cycle
an osciloscope scope will tell you how long the pulse is,m if th
clock i
stable that's enough.
How can I also know what's the dimension taken on 68HC11 RAM by th
software since I know how many KB it takes on my pc ?

that depends what the program does

No, it doesn't. All he wants to know is how much of an HC11's RA
is being used by his process and, since he assigned storage, all h
has to do is count up them variables
if that's all he does he'll get the wrong answer
you also need to add up all the stack space that could be in us
simultaneously, and a number of other factors
For example, Motorola "S" records contain much more than just objec
code, so why would you want to use them to determine the length o
the program when you can use your assembler's output listing an
save yourself a lot of grief
Yeah that'd be easier
To tell the truth I forgot about the output listing...
It's been a couple of months snce I laste programmed
microcontroller

Bye
Jase
 

Similar threads

G
Replies
1
Views
1K
James Beck
J
J
Replies
7
Views
1K
bruce varley
B
B
Replies
2
Views
953
Rich Grise
R
Top