Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : cpik, open-source C compiler for PIC18F
Author | Message | ||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Until now, we had only SDCC open-source C compiler for PIC18F microcntrollers but as anyone knows, SDCC was primarily made for Intel microprocessors (as 8051). Yes, is a retargettable (the word is not validated by check speller !?) but not "native" PIC18F. cpik C compiler is made by Alain Gibaud for PIC18F microcontrollers and up to version 0.5.2 lacked some major features such as absence of: -switch statement -FP calculation -bit variables The project stalled a long period of time until recently when a new announcement was published on the home page of the compiler: [quote="Alain Gibaud"]Josef Pavlik is a new contributor to the cpik project who has developed a lot of new features for version 0.5.3. Thanks to Josef, this version is a real improvement over the previous one. -in version 0.5.3 (Marie Jeanne Gabrielle) * Bug fixes in code and run-time library, * Run-time library improvements, * New pin.h header for easy manipulation of I/O ports thru symbolic names, * Improved LCD library with pin configuration from C code, * Dead code elimination in the case of loops or test with constant conditions, * Optimisation of static data initialization, using the program sections concept, * Post-compilation branch optimizer that generally reduces the code by 10%, * Implementation of the enum declarator, * Implementation of the switch instruction: this implementation is efficient and provides a near constant-time case selection, * Support for data located in ROM, with different access mechanisms, * And more.. [/quote] Right now, the author is working at the 0.6 version which will come with support for IEEE-754 floating point numbers and Josef Pavlik is working at a way to implement "universal pointer" RAM / ROM. Also, the Pinguino team is testing the compiler in order to replace the SDCC for the 8bit version of Pinguino IDE. Any help (joining as developer, contributing with libraries, reporting bugs, or just using it and providing examples) is highly appreciated. Vasi Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
elproducts Senior Member Joined: 19/06/2011 Location: United StatesPosts: 282 |
Vasi, This is interesting but with Microchip now releasing all their compilers in essentially free mode (lite mode) what is the advantage to another open source compiler that needs work? The only restriction in the Lite version is limited to 1 level of optimization. Other than that they are full compilers with support for all parts. I don't like optimization anyway. It shifts the code around. I'd rather just use a larger memory PIC. www.elproducts.com |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Yes, I said that too in a discussion with another person (today C18 is the best free C compiler for PIC18F) but the point of Pinguino project is to use a totally open-sourced development chain. The only really weak part of 8bit Pinguino project was always the SDCC compiler, forcing the developers to make a lot of tricks regarding to USB bootloader. Now, we have cpik which can be a successful project if it will gain a lot of attention. And it have the chance to become better than C18 compiler of Microchip. P.S. Arduino free and open-source movement forced Microchip to release a non-restricted, full optimized C32 compiler!!! We can force an analogy? Not yet but with help from volunteers it can be possible. P.P.S. Of course, the Pinguino 8bit project can be forked and can use C18 instead of SDCC but needs also volunteers. Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Regarding to Hitech C compiler for PIC18F, you must read Geoff's opinion (I share it): http://geoffg.net/C_Compilers.html Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
wizard Newbie Joined: 29/07/2011 Location: United StatesPosts: 38 |
Hi all, Has anyone looked at optimization for MIPS by the various compilers? For PIC32 I use gcc - openwrt version chipkit.org Microchip. Does the compiled code differ much among the compilers? Speed of execution Size Does optimization really do anything useful? Thanks Wiz |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
|
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
We can say now, that we have such a large PIC32, we don't need an optimized C compiler anymore. Until you start to use retroBSD... or other similar, bigger projects. The needs are rising same time with the microcontroller upgrade. When you can't match them, then you move to another platform (but probably we prefer a highly optimized compiler instead of spending more money). Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Let say we have an 8bit Pinguino board (based on 18F4550). I can't have the same full featured JALv2 application (which occupy 100% the flash) written in Arduino language (using Pinguino IDE and SDCC C compiler) because there are huge differences mainly in the size of the code produced by the compilers. Also, from the start, Pinguino board come with much less user application space if I use the Pinguino USB bootloader against JAL USB bootloader. 6Kb difference in a total space of 32Kb. Comparing them, we can say that the optimizations in SDCC compiler are a bad joke (of course, that is unfair for the developers of the PIC support for SDCC but I can say that now they have a very promising alternative ). Now, I can't say again that the optimization does not matter. Not even if I compare with PIC32 because there, I will use applications which occupy the same percent of flash for analysis (as I said before, MMBasic, retroBSD, etc...). Vasi P.S. BTW, the high optimization of JALv2 compiler helped me to fit inside PIC12F675 (1KB flash) one additional feature than using PICAXE8M as Windmill logger. I can't find PICAXE8M in my country and you can't get too easy a PIC12F683 (wasn't available at the project time)... Another thing which helped me, was that I had the full sources of the libraries from the Jallib project (a team which develop JAL libraries for a large variety of peripherals and sensors) and a modification in the source helped me to fit the code. Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
wizard Newbie Joined: 29/07/2011 Location: United StatesPosts: 38 |
Hi Vasi and all, It might be interesting to compile MMBasic with the different compilers and compare the results to get some real numbers. Maybe someone has done it already? When next version comes out I'll have to byte compare my compilation with 'official' one. Wiz |
||||
elproducts Senior Member Joined: 19/06/2011 Location: United StatesPosts: 282 |
http://geoffg.net/C_Compilers.html Geoff does make some very good points. And having an open source compiler can allow a team to optimize it for the hardware such as Pinquino. And Pinquino is clearly targeting a complete open source platform so I understand your point. www.elproducts.com |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Hi elproducts, I thought my set of characters are guilty, that I am on Linux... but then I wrote the two words together and yes, you are using q against g. Pinguino - Pinquino. Well, I think is your preference... Vasi P.S. Unless you are teaching Google Search something If yes, would be interesting to see that product Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
elproducts Senior Member Joined: 19/06/2011 Location: United StatesPosts: 282 |
Sorry. My mistake. www.elproducts.com |
||||
vasi Guru Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
cpik 0.6 ready! Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
Print this page |