Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Richard Erlacher
10/28/11 09:44
Read: 460 times
Denver, Co

#184408 - Using evaluation software and hardware
Responding to: David Prentice's previous message
David Prentice said:
A Simulator will count your cycles for you. And get it correctly.

As far as I know, there are no 8051s that use caches. Each 8051 instruction is documented for its behaviour.

Most bottlenecks are due to frequent calls of short pieces of code. You simply hand-craft these sequences while leaving the other 99.5% of code in HLL. Let's face it, the 8051 is simple to write ASM for.

What I've found to be the most helpful in eliminating such "bottlenecks" is the careful arrangement of those "short pieces of code". Sometimes changing the order can help to eliminate numerous calls. Sometimes it makes more sense, for timing reasons to replicate pieces of code a few times, with the associated code space penalty, using macros, rather than tolerating the penalty in execution time imposed by the calls and returns. I've learned that some compilers arrange things one way, others, well, another. That should not surprise anyone.

I am lazy so I get the Simulator to do the cycle counting. I sometimes use an 8051 timer or a Logic Analyser.

I do it too, but not so much because I'm lazy, though I am, but to ensure I haven't miscounted.

All the same, most efficiency is gained by improvements in the algorithm rather than the low level ASM code. As Per has noted, the actual translation of P1.4 = 0 is going to be the same.

While that's true, much of the time, how the individual routines are arranged seems to make as much difference as how the algorithms are designed. Most code sequences don't amount to "algorithms" so much as simple sequences that handle individual required tasks. Once one decomposes high-level requirements into low-level functions (using the term loosely) such things become apparent.

Of course, you will get the best performance from a perfectly designed ASM program. Very few applications are that time critical. If your clients have few boards, your development time is very significant.

I am sure that you can knock out perfect ASM faster and more reliably than others can use a HLL. This is due to your experience. At your age, I expect that PDIP-40 8051 chips will see you through. A young student would better spend her time learning how to use MCUs and tools that have a realistic future.

I'm not so sure about that, but I am comfortable using ASM. While there have been cases in which I'd have used HLL, because an algorithm is more easily expressed understandably in HLL, properly commented ASM does pretty well, too.

The reason these projects were designed around DIP-40's was that, back in 1980 or so, the PLCC was the only alternative and was not yet so popular. The boards in question were purchased rather than newly designed. It's just the code and some ancillary hardware that's been added over the years. I use newer packaging when I have to provide a home for newer parts, as you can surely imagine.

Incidentally, when you meet your bus or jealous husband, will your clients really be able to maintain your ASM code? Or even find another expert?

So far, I've managed to outlive most of my long-time clientele, either in that they've passed on, or they've retired some time ago and their problems don't find their way back to me any longer, if they do need someone's attention. My work is very thoroughly documented, however, as is the obligation of anyone functioning in my role as a consultant. Anyone who follows rigorous engineering methods should have no difficulty understanding my code, flowcharts, HIPO (Hierarchical Input-Process-Output) charts. After all, an engineer's job is to write specifications, and not just to "make sparks" in the lab.


Over the years that I've been participating in discussions on this forum, I've repeatedly said that "Where you sit determines what you see." That's an old military addage, but applies everywhere. I've been engaged in two major sorts of work over my life, one of which has been at the very front of design and development, namely proof of concept, and the other has been "making what we've already got do the job" rather than ripping it out and replacing it. Of the ten or so businesses that I've worked for over the long-term, it's been mostly the latter, applying upgrades and extensions where it was both possible and practical. That's why I've used MCU's that fit on the old DIP-40 site in which the original 875x lived. I've tried some others, but keep coming back to them because they're familiar and because they provide amazing opportunities to keep the old hardware useful.

Only a couple of those clients from back in the late '70s and early '80's are still in operation, as they're as long-in-the-tooth as I am, and have similar backgrounds, being broadly educated and less accustomed to simply sitting down at the computer and starting to code when a problem appears on the horizon. All of them can read schematics, as that was taught back when we were trained, yet none consider themselves competent users of HLL's or HDL's.

I've bitched and griped about the frequent calls for persons presenting queries related to using what they've already got on hand to change their core concept in favor of a current-generation device. The reason for this has been that, when I'm doing proof-of-concept work, I use stuff I've already got on hand. This is (a) because I know what it does and how to make things happen with it, and (b) because it saves time that would be lost in "plowing up new ground."

Lots of people have, for example, expressed their hatred for the 8255 as a general-purpose parallel interface. Well, if it will do the job, and if it is already on hand, why not? What will it help to use a more modern device, particularly if it's already "on the board I had to buy for the class I'm taking?" Engineering, after all, is finding a way to solve problems using technology that's already available. The most available is what's already on hand. I, of course, admit that, starting from nothing, would find using modern devices a good solution to many problems.

However, because I estimate and perform my proof-of-concept work with hardware that I already believe I understand and have on hand, which includes, in large part, evaluation kits for FPGA's, CPLD's, and MCU's of many stripes. Consequently, I have considerable experience with evaluation boards, and evaluation software. Over the decades, I've learned what one can, reasonably, expect from evaluation hardware and software. I've also learned what one sometimes has to do in order to get the job done when the evaluation stuff doesn't quite do what one expects. That's what's given rise to this subthread.

The O/P has said he is a hobbyist, and, as such, it's unlikely he'd buy a multi-k-$ compiler for his hobby project. Having him go through all the perambulations required to do what I suggested, to the end that he could compile a 'C' program and subsequently program it into his target environment would not provide him with the tools that he would receive if he bought the full-up tool suite, neither would it deprive the vendor of that software of a sale, because he'd never be able to justify such an outlay for his hobby project. Now, this is a bit on the edge of what's appropriate, but there is one upside for the software vendor. If the hobbyist later discovers a commercial application for the project in which he's engaged, it will probably result in a sale of that tool set to which the hobbyist has previously been exposed, and with which he's proven his concept.

As Per has indicated, it probably violates the spirit, if not the precise language, of the licensing agreement for one to take the output from this demo-package and operate on it in such a way as to allow it to do what, normally, it wouldn't. It would, after all, not bypass the size-limit on the code in question, and would not be usable as such without considerable effort for each code module. Never having attempted this myself, I don't know which of the "features" of the package would work normally on a code set that exceeded the size limit, or operated outside the memory region that it normally supports.

Unlike Per, I think a discussion of how one can make demonstration software do what it probably should do, but doesn't, might be useful. There are ways in which the software vendor could and should protect his product without making it useless for evaluation on certain targets. It's not my place to enumerate them, though. The software vendor should consider this. While I'm not advocating trying to re-engineer that software so it becomes a "free" tool set, depriving the lawful owner of rightful profit, I do believe that it should be useable to perform a thorough evaluation, including producing code runnable on the desired target. How they make it impossible to create executable code on small-code-space MCU's has to be dealt with by their staff, and not by me.


List of 53 messages in thread
Linking C programs with Keil evaluation      David Prentice      09/06/11 11:02      
   Eval Tools.      Michael Karas      09/06/11 11:15      
      That makes sense      David Prentice      09/06/11 12:11      
         It's not that much more useable      Richard Erlacher      10/25/11 18:44      
            Work-around for evaluation version limitations?      Per Westermark      10/25/11 23:50      
            Marked -1      Michael Karas      10/26/11 06:26      
               I'm not so sure you're right here ...      Richard Erlacher      10/26/11 07:55      
                  Irrelevant if people have ideas - should they be debated?      Per Westermark      10/26/11 08:19      
                     There's a reason I haven't done it ...      Richard Erlacher      10/26/11 10:36      
                        Would not represent a valid evaluation      Per Westermark      10/27/11 02:00      
                           Wait a minute ... You've got this wrong ...      Richard Erlacher      10/27/11 09:57      
                     One question      Richard Erlacher      10/26/11 12:43      
                        What about the guy who simply wants to evaluate the product?      Andy Neil      10/26/11 14:05      
                           sometimes coding situations and requirements differ      Richard Erlacher      10/26/11 18:57      
                        How would you like it?      Andy Neil      10/26/11 14:13      
                           That's not what I'm asking them to do      Richard Erlacher      10/26/11 19:17      
                              A message from the OP.      David Prentice      10/27/11 03:55      
                                 I don't supply the compiler ...      Richard Erlacher      10/27/11 10:08      
                        Wrong view on evaluation tools      Per Westermark      10/27/11 03:32      
                           as I've said before, where you sit determines what you see      Richard Erlacher      10/27/11 10:47      
                              Still failing to recognize reason for hole in code map      Per Westermark      10/27/11 12:33      
                                 You missed my point again      Richard Erlacher      10/27/11 15:35      
                                    Simulate or use Logic Analyser      David Prentice      10/28/11 05:41      
                                       ramblings      Erik Malund      10/28/11 07:51      
                                       Using evaluation software and hardware      Richard Erlacher      10/28/11 09:44      
                                          The above would be true if....      Erik Malund      10/28/11 10:24      
                                             You don't seriously believe that, do you?      Richard Erlacher      10/28/11 18:54      
                                                A thief is a thief        Per Westermark      10/29/11 07:01      
                                                   Indeed...        Michael Karas      10/29/11 09:47      
                                                   FIrst of all, I don't advocate theivery      Richard Erlacher      10/29/11 14:46      
                                                      and more mumbo jumbo in the reply      Erik Malund      10/29/11 15:47      
                                                      Can _you_ not read debugger output?      Per Westermark      10/29/11 17:39      
                                          8255      Andy Peters      10/28/11 13:26      
                                             Yes, but they're still shipped on some 805x trainer boards      Richard Erlacher      10/28/11 18:42      
                                             Just sayin'      Michael Karas      10/29/11 05:50      
                  Square Wheels for the Car      Michael Karas      10/26/11 10:06      
                     I disagree ... not that that should surprise anyone      Richard Erlacher      10/26/11 10:54      
                        eval and evaluation      Erik Malund      10/26/11 11:25      
                           Yes, if only they were useful ...      Richard Erlacher      10/26/11 12:31      
      Also "LPC900 Studio"      Andy Neil      09/06/11 12:32      
         They all seem crippled      David Prentice      09/06/11 14:22      
            comments      Erik Malund      09/06/11 16:17      
            They all seem crippled      Andy Neil      09/06/11 16:22      
               Yes ... SDCC ... the obvious solution      Richard Erlacher      09/08/11 08:30      
                  what's obvious about it      Erik Malund      09/08/11 09:00      
                     Why not?      Andy Neil      09/08/11 10:48      
                        reasons      Erik Malund      09/08/11 10:59      
                           Unfortunately      Andy Neil      09/08/11 14:13      
                              re Keil      Erik Malund      09/09/11 07:13      
                                 15 years ago?      Maarten Brock      09/09/11 09:28      
                                    OK, maybe not      Erik Malund      09/09/11 09:48      
            reasonable price      Erik Malund      09/07/11 03:41      
            raisonance is 4k with no code offset      Marshall Brown      10/25/11 13:59      

Back to Subject List