On 03/07/2011 08:42, V G wrote: > No. It's not worth it. You can learn C pretty much anywhere, but best > learned alone, by yourself. Well, a good teacher or mentor or being pointed to good material always=20 helps > I believe the programming language, as in the syntax itself is pretty > simple. The annoying part is learning how to use different frameworks and > libraries, but that won't be a problem for PIC C programming, if that's w= hat > you're looking into. 100% agree on that. Also which legacy things should NOT be used. Re: non-core syntax for PIC 16F/18F: A C program for PIC16F/18F (the "higher" PICs IMO are "microchip" CPUs=20 and not "PIC" in traditional sense and more like programming anything in C) You have basically 5 parts: 1) The chip specific ".h", without this nothing works. 2) A compiler specific way of setting the "fuses" aka Configuration=20 word(s) (may be two) aka personality flags. 3) A function called by Interrupt. It should have all code for all=20 interrupts and test to see what is the interrupt source. Avoid doing=20 Function calls (some 16F compilers won't let you anyway). Use "atomic"=20 instructions to use a "flag" to communicate need to run larger function=20 in the "main()" 4) The initialisation part of system in "main()" program followed by 5) A While True block, The rest of the main program is in a Do Forever=20 loop, even it empty (in which case only Interrupt function is used. Really all PIC10F/12F16F/18F programs in any language have this=20 structure. Some languages or compilers allow multiple Interrupt=20 routines. Having only one is a good idea. It then has if or case for the=20 sections for different interrupts. A function call from in Interrupt=20 might be allowed by your C compiler or Language esp on new high end 16F=20 and all 18F. But the Function needs to be fully re-entrant, or=20 interrupts disabled. It needs done with great care of design if allowed. For readability don't try multiple assignments in one statement, even=20 though C allows this. Early C programmers could not type and had=20 compilers that optimised better if all was in one statement. Nowadays we=20 have decent editors and compilers. It doesn't make the program bigger=20 giving intelligent names to things and doing stuff in several lines. Avoid Macros. C is just a high level assembler. If you can do assembler or basic or=20 pascal you can do C in a day or two *EXCLUDING* the Libraries. Most of=20 the C libraries are best avoided on a PIC16F / PIC18F anyway. Like=20 scanf, printf etc. Insure you are using suitable Integer types and only use 16, 32, 64 bit=20 integers or floating point if you mean to. Don't rely on Strings or null termination. Biggest source of bugs on=20 PCs. Mostly on a PIC an array of bytes is more use and keep track of all=20 your array bounds (always starting from 0 for 1st element) --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .