Jump to content

Measuring processor load?


mess
 Share

Recommended Posts

Hello,

how can I measure the processor load of my code?

I'm working on a seq based on clockbox

so I tried to display the number of clock counters

that need to be processed each tick

but the numbers vary too fast to see any result...

Is there a simulator for the 18F series?

With the µVision IDE at school you can run your program in simulation

to see the runtime of each procedure,

I find such a feature very useful to find bottlenecks in C code...

Link to comment
Share on other sites

Hi,

I'm normaly using my scope to measure the performance. A free IO pin is set to 1 when the function starts, and to 0 when it is finished - it gives a good feeling about the processor load. In addition, the scope can display the minimum and maximum pulsewidth.

However, w/o a scope it gets difficult. You could use the integrated simulator of MPLAB, but it requires that you call the function which should be profiled with a correctly initialized memory. Since it is difficult to combine MIOS with the application in order to simulate it completely, you have to add some debugging code, located at 0x0000 (reset vector), which inits the memory and jumps to USER_Tick (not to Tick()) - this ensures, that also the stack pointers are initialized correctly

This debugging code must be removed when you want to upload the application again.

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi Stryd,

In the meanwhile most of my code is rewritten, so I will PM you a new version this evening.

My main goal at the moment is to implement the CS and some basic features without optimising any code...

(this should be done in a few days)

When the CS is done it's optimisation time :-)

I've done some simple realtime stuff in the past with a 8051 based school project

see this link (it's a pong game with a propellor display):

http://users.skynet.be/sky92755/pongwerkt.mov (20MB),

note that the image doesn't look stable because of my crappy camera

I found it easier to modify the asm output from the Keil compiler than the gcc compiler...

Maybe I should work on my pic18 assembler knowledge a bit, it's a lot more complicated

then 8051 asm

Any help is REALLY welcome, I'm looking forward to completing this project as soon as possible  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...