Many of the PIC18 examples in the MAL/MLA are compiled with C18. This is usually identified by the project name. If it is a MPLAB-X project, the compiler type and version is included in the project. When using XC8 you need the profesional (paid) version to generate code with the highest optimization and smallest size. In MPLAB-X, you can directly look in the dashboard to see the size of your code. Not sure if this applies to XC8, but in XC16 and XC32 you can apply the compile option "Isolate each function in a section" and the linker option "Remove unused sections" to exclude all unused functions, which could reduce the code size if there are many unused functions. Microchip tend to exclude this with #ifdefs for unused options so there might not be so much to gain here. > I can't seem to get my compiling of the provided example projects to the = hex > sizes provided by Microchip ready-compiled in the Solutions above. Main t= arge is > pic18, low pin count board projects. I tried a 2010 vintage MCC too, and = a > modern XC8. My hexes are 30% larger (the size of the hey file itself, not= the > contents). I did not look at the binary size i.e. to what the hex evals, = I just > tried to draw conclusions from the highest address present in the address= sorted > hex file, excluding ID and Config. >=20 > It would be very useful if mchip would provide the exact version number o= f > the compiler, e.g. the compiler output log from mplab, with such project > collections, so people can figure out what compiler exactly to use. Lacki= ng > that, I ask the list on how to crack this nut. Space is very tight on the > device, even with the demos provided, and now they might not even fit whe= n > recompiled by me (but I did not yet check this). Is there a checklist of = items > to look out for when recompiling demos, to be able to achieve the same ou= tput > (at least in size) as the original packager achieved? Again, I am talking= about > loading the provided demo projects in mplab, compiling (build all), and c= hecking > output size hex (number of lines, bytes size of ascii hex file etc). >=20 > tia, >=20 > Peter >=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .