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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/05/09 23:55
Read: times


 
#163130 - Price doesn't directly follow processor size
Responding to: ???'s previous message
One product I updated replaced a chip with 8kB flash + 1kB RAM with an ARM with 256kB flash and 58kB RAM for the same money.

The change was needed because of a requirement to add CAN support. The const savings of being able to write in C instead of assebler was great. The previous chip required the assembler code to contantly jump into the middle of other functions for space savings (the chip manufacturer happened to get a one-year delay on the 8kB variant quickly requiring the application to be squeezed into the 4kB little-brother, and when the 8kB variant got available it wasn't meaningful to do a full rewrite). The extra bonus of the huge memory areas of the ARM part was that after matching the previous products capabilities and after CAN and a large set of additional candy functions had been added, the replacement ARM could still spend > 90% sleeping and with about 70% flash unused. Instead of switching to an ARM with less flash, the spare flash was used for storing two generations of the application while still having the two individual firmwares only consuming about 70% of their respective areas.

Within a specific family, more features or more flash represents a higher cost. When switching to a newer generation from the same manufacturer, or switching between families, there are no simple relationship between price and features or price and RAM size or similar. That is an important factor to think about instead of concentrating to hard on the fact that an assembler-written program can allow a smaller flash to be used. If estimating $100/hour, then a single week of shorter development time scales to 4k produced units at a device price difference of $1 - and if the price difference between two devices are zero then the $4k is a direct cost reduction even before the first unit is produced, besides the further economic gain of having a sellable product one week earlier.

What is so important here is that the 8051 has excellent support for bit operations and should always be at the top of the list if the majority of the application code is involved in bit conditionals or single-bit operations. But as soon as the bit operations does not represent a major part of the application, then the 8051 will be a processor among others, and in that case it will often come up wanting because so many of the 8-bit OP-codes where dedicated to bit operations that mainly memory addressing modes had to be skipped.

What I'm trying to say is that using C in an embedded device isn't just something done because the developers are lazy or unskilled but can often be represent a very major economical decision to reduce the development and maintainance costs. If I look at products I have worked with, the C-coded products may continue to be maintained for 5-10 years or more after they leave my table. The assembler-coded products almost always stays with me until supports is someday dropped. Few people really like to take over other peoples assembler projects even if the code is well-documented and does not contain tricky code to cut clock cycles or instruction count.

Assembler is the optimum route to maximize execution speed or minimize code size, but the percentage of products where it is econimical to hunt the last 10-50% speed and/or size is quickly dwindling and as a developer my main goals must be to prioritize maintainability and bottom line. A product that works well and draws in money is the best ticket to get the next job. And since each new processor generation gets cheaper or more capable, a redesign at half-time of a products life-span may be more economical than trying too hard at using the smallest processor in the first release and then have to keep that processor because the code would require too large rewrites to fit another chip at a later time.

List of 76 messages in thread
TopicAuthorDate
NXP P89LPC936 Auxilary RAM            01/01/70 00:00      
   Compiler Cannot Save the Day At Runtime            01/01/70 00:00      
      I found it.....            01/01/70 00:00      
         Incorrect!            01/01/70 00:00      
            To be fair,...            01/01/70 00:00      
               Its good info to know...            01/01/70 00:00      
   how is it done in C?            01/01/70 00:00      
   Maybe you should try doing it ASM!            01/01/70 00:00      
      You should start a new thread on that!            01/01/70 00:00      
      Not in this case!            01/01/70 00:00      
         A compiler should support ALL MCU features ...            01/01/70 00:00      
            A compiler should translate the language            01/01/70 00:00      
               Still C - just not strict.            01/01/70 00:00      
            I didn't say that!            01/01/70 00:00      
               It is not that clean and clear            01/01/70 00:00      
                  Deviants are deviant            01/01/70 00:00      
                     Keil and SDCC need no macros ...            01/01/70 00:00      
                        Are you sure?            01/01/70 00:00      
                     That's probably correct, but ...            01/01/70 00:00      
                        A C compiler can map the hardware quite well            01/01/70 00:00      
                           compiler vendors are looking at the new processors            01/01/70 00:00      
                              I once mentioned that ...            01/01/70 00:00      
                           It's not what I'd choose, but it is a matter of perefernce            01/01/70 00:00      
                              As flash gets bigger, the code steps do too.            01/01/70 00:00      
                              Still not needed for other architectures            01/01/70 00:00      
                                 We will have to agree to disagree ... I guess            01/01/70 00:00      
                                    Which single-clocker is cheaper than an ARM?            01/01/70 00:00      
                                       RE: Which single-clocker is cheaper than an ARM?            01/01/70 00:00      
                                       differs considerably from the classic microcontroller?            01/01/70 00:00      
                                       Horses for courses            01/01/70 00:00      
                                          Always start each project by scanning the market            01/01/70 00:00      
                                             On that we can agree            01/01/70 00:00      
                                          Maybe, but what are they comparing?            01/01/70 00:00      
                                             Did you actually look?            01/01/70 00:00      
                                                Yes, I did.            01/01/70 00:00      
                                       it's a tradeoff            01/01/70 00:00      
                                          Is it 2006 already?            01/01/70 00:00      
                                             Really?            01/01/70 00:00      
                                                that's outright silly            01/01/70 00:00      
                                                   Maybe ... which is why it is not yet the case            01/01/70 00:00      
                                                      the eyes of the beholder            01/01/70 00:00      
                                                         Look at it from another viewpoint for a moment            01/01/70 00:00      
                                          RE: I'm not the one to ask about IC prices            01/01/70 00:00      
                                             doesn't mean I'm totally in the dark            01/01/70 00:00      
                                                Richard Erlacher has left the planet            01/01/70 00:00      
                                                   Maybe Andy's the one who's lost            01/01/70 00:00      
                                                      I cannot believe you even looked at ARM            01/01/70 00:00      
                                                         It's all relative            01/01/70 00:00      
                                                            Price doesn't directly follow processor size            01/01/70 00:00      
                                                            What about performance?            01/01/70 00:00      
                                                         Be specific please.            01/01/70 00:00      
                                                            You can use your own supplier            01/01/70 00:00      
                                                               Your test simulates as 41.04us            01/01/70 00:00      
                                                                  RE: ARM compiles do not like byte-addressing            01/01/70 00:00      
                                                                     A typo on my part            01/01/70 00:00      
                                                                        Case of full unroll            01/01/70 00:00      
                                                                           ... and what does THAT ARM MCU cost?            01/01/70 00:00      
                                                                              WHO CARES            01/01/70 00:00      
                                                                                 Absolutely true!            01/01/70 00:00      
                                                                              $5 or lower            01/01/70 00:00      
                                                                                 My Simulation times were wrong.            01/01/70 00:00      
                                                                                    67% of your loop was your loop            01/01/70 00:00      
                                                                                    re-written the loop in C            01/01/70 00:00      
                                                                                       Try without loop counter            01/01/70 00:00      
                                                                                          You're right!            01/01/70 00:00      
                                                                                             Similar trick with ARM7 would require 66.67MHz            01/01/70 00:00      
                                                                                             60ns with no store instruction.            01/01/70 00:00      
                                                                                                25% speedup            01/01/70 00:00      
                                                                                                   Actually, I found the for loop faster.            01/01/70 00:00      
                                                                                                      Compiler setting?            01/01/70 00:00      
                                                                                                         I made NO optimisation            01/01/70 00:00      
                                                                                                            Avoid variable aliasing if you like high optimization levels            01/01/70 00:00      
                                                                                                               The RealView compiler is very competent            01/01/70 00:00      
                                                                                                                  Yes, caching            01/01/70 00:00      
                                                                                                                  Yes, caching            01/01/70 00:00      
                                                                                                It's much easier with the 8-bit single-clocker            01/01/70 00:00      

Back to Subject List