thanks for the advice juan cubillo -----Original Message----- From: "M. Adam Davis" Sent: 2/21/2006 11:19:27 AM To: "Microcontroller discussion list - Public." Cc: Subject: Re: C or asm? On 2/18/06, Juan Cubillo wrote: > What language would you guys consider as better for general (hobby-like) aplications? C. This from the assumption that by "general hobby like applications" you mean low volume projects which you want to start and finish as quickly and easily as possible. > I'm trying to learn assembler by myself, but I'm also learning c++ at school. Should I stay with c at this moment and forget about asm? Do NOT forget about or try to avoid ASM - not on the PIC. Especially if you plan on using a C compiler for which you get little support. It will be to your advantage to duplicate your work for several small projects (blink an LED for instance) in both C and ASM so when you have to debug your C program you feel confidant when you look at the compiled ASM listing. This is not to say at all that C is better than ASM or vice versa, just that the way you framed the problem suggests the better solution is likely to be C. The issue with C on the PIC is that the PIC's architecture is not nearly as optimized for C as most processors developed in the last 10-20 years have been. C compilers, especially good ones, for the PIC are non-trivial. Many , if not most, compilers make comprimises with the C language, and extend it in non-standard ways to make it easier to have a high performance program run on the PIC that was written in C. I suggest starting out with a reliable commercial C compiler if you want to avoid assembly at the beginning. Several companies have a free version with code size or chip limitations. I've used the compilers from http://www.bknd.com/ very successfuly in the past. You should not focus on C and completely neglect assembly. They both have strengths and weaknesses and under different situations you will find one is the better choice. Also keep in mind that great programs often use both. I develop my prototypes in C for rapid development and testing (and to force, er 'help' the customer settle on the specification), then optimize the project according to the specification. This may involve porting the program to a different architecture (difficult, at best, in assembly), optimizing sections of the program to assembly, or re-writing the entire program in assembly by hand for performance or cheaper chip reasons. Good luck, and have fun! -Adam -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --38771.6583183218.3046957578.358533.rlt.6027-- n www.costarricense.cr nse.cr 3050843250.135116.htb.6610-- l c0 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist