PID Calculation Time

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

Is there any simulation software that i can see how long does my PID loop takes for calculation, i'm using AT89S53, I know this is quite off th scope of this forum but well, someone might know.

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With that signature, you may not get many postive comments. And while you may beat the hell out of AVRs with some of the highly-clocked 8051 variants, you won't do it with an AT89S53.

Anyway, I'd take a spare I/O point and set it high at the start of the code section, and drop it at the end of the code section, and measure the time with a 'scope.

Try visiting www.8052.com to find tools that might be available for that processor type.

Lee; my Mega48 will drub your AT89Sxx into submission

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

print out 'begin' and 'end' and time how long 1000 loops takes... number of seconds=number of milliseconds

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The scope idea is the best, done that before, works in a pinch.

clock_t clock(void) Get elapsed processor time in clock ticks.

Will also work, call before the begin and end of your code then subtract the two, Never tried it on avrgcc though.