Added the [EE] tag. On 2/19/06, David VanHorn wrote: > > > > > > Doesn't seem like it should be a religious war, though, because the > > answer you gave is so obviously correct that it is very difficult for me > > to understand how anyone could argue with it. Although perhaps that is > > what a religious war is -- different people having different views, and > > each one convinced that his view is obviously correct. :-) > > > :) I'm surprised that the responses have been so sparse. Perhaps everyone's > away from their keyboards. Maybe the reason is that it does not have a tag. > I do all my projects in assembler. I am learning C, but I am reluctant to > use it in any real project, because I see that it adds a couple of layers of > problems to the mix. I don't have to worry about compiler bugs, or what the > compiler will make out of my code. I don't have to worry that changing one > statement will cause some "ripple effect" and make changes elsewhere because > the optimization now works out differently. > > Frankly, I'm surprised at the relatively primitive level of the compilers > I've seen. Optimization seems pretty poorly done. But there are many good compilers for PIC (Hi-Tech PICC), AVR (IAR and AVR-GCC), MPS430 (IAR and MSP-GCC). AVR-GCC and MSP-GCC are free open source compiler. SDCC for PIC may not be so good yet but SDCC for 8051 is said to be not so bad (okay not as good as Keil). > Part of it I'm sure, is how I was brought up, but I think the exposure to > the machine's internals is very important. "Buy a bigger chip" isn't always > an option, and sometimes you really need all the performance you can get, > and a compiler isn't going to do your thinking for you here.. You have to > know what's the fastest way to get something done on THIS machine. > -- In general, I think asm is necessary for smaller MCUs like PIC. However it is quite okay to do projects with pure C even for PICs. Inline assmebly or assembly routines can be used for some critical routines (for example, some C libraries are written in assmebly). For hobbyists, I think it is even more possible to use a big MCU and then use C for projects. But it is just one's choice to use C or asm. Regards, Xiaofan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist