![]() |
Has anyone had lack of processing power?
Reading through the Programming thread, I have come across many a post referring to avoiding doubles and square roots and standard Math.h functions since the PIC is an 8-bit processor. I remember this was a big thing before the start of last season too. We even tried to rewrite the Math.h to not use things like sqrts and the like. And yes, I do understand why those things were avoided since they take more power since an 8-bit processor will use software to do 64-bit math instead of hardware.
Here's my question though. Has anyone actually had problems with processing power on the PIC? I mean, have you had dropped packets due to the processing cycle taking too long or something along those lines? 26.2ms is quite a long time for a processor. |
Re: Has anyone had lack of processing power?
Most of the problems with the processor keeping up that I've run across with various teams have been due to inefficient and bloated code. They more often run out of programming space than processor time. The most common exception has been bloated interrupt handlers causing multiple interrupts to be missed. The code problems are to be expected with people learning to program for the first time and attempting to implement complex equations from their math textbook.
The cautions are more directed at the neophytes than experienced programmers. I did some measurements last Fall on the Robovation (formerly EDU) controller and came up with: v45% more program space than the equivalent operation using integer math is what’s roughly required for simple floating-point operations (e.g., a=10.5*2.3 vs i=105*23) v22% more time is required for equivalent float vs. integer operations I no longer remember the details as to what percentage of program space was due to a one time floating point library and what each additional statement demands. It just takes a minute or two to run the test though. |
Re: Has anyone had lack of processing power?
We had some issues keeping track of an encoder we used to close the loop around our steering control. It got to be very resource-intensive to count every edge transition, so we modified the code to only count every fourth encoder transition, which worked fine.
The problem, as Mark noted, is that the program hasn't returned from the interrupt service routine by the time that another interrupt comes along. This causes the processor to miss a count, which over time will lead to a large position error. This will be the main type of problem that you'll see, especially if you try to close any high speed loops. |
Re: Has anyone had lack of processing power?
Quote:
|
Re: Has anyone had lack of processing power?
Quote:
|
Re: Has anyone had lack of processing power?
Quote:
Floating point operations on this processor will take much longer than integer operations. However, this may or may not be significant depending on other factors. Matt |
| All times are GMT -5. The time now is 07:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi