Comparing 16F88 compilers
Chosing the right compiler to use in the future can be a lot of work sometimes, especially for those who like to take time in this decisions.
Ive written a small code that flashes 4 LEDs sequencially using a PIC16F88 internal 4MHZ crystal, it jumps from LED to LED with half a second interval.Its simple and short.
With this I can compare both, code size and the final compiled file .hex for the PIC size, and take some conclusions.
This is the basic code in C :
while(1) {
PORTA = 0b00001000;
Delay_ms(500);
PORTA = 0b00000100;
Delay_ms(500);
PORTA = 0b00000010;
Delay_ms(500);
PORTA = 0b00000001;
Delay_ms(500);
}
The following picture shows the connections on a breadboard :
I tested 5 compilers, 3 C compilers, one assembly compiler from the manufacturer and a very sucessfull open source compiler JAL with its own syntax.
| Language | Source | Compiled |
|---|---|---|
| JAL | 783 bytes | 539 bytes |
| MikroC | 629 bytes | 600 bytes |
| Assembly | 1590 bytes | 384 bytes |
| CCS | 400 bytes | 616 bytes |
| XC8 | 857 bytes | 596 bytes |
Source files are complete with right fuses and configurations for that compiler.
Here goes a video of the LED sequence :
Created on 11-04-2013