Electronics > Microcontrollers

Microchip C Compilers - which free compiler do you use?

<< < (2/2)

cyberfish:
Optimization is helpful because it allows us to write easily readable code and leave it to the compiler for low level optimizations.

Eg. without optimizations, you'll have to write multiplications and divisions by powers of 2 as shifts, if you want them to execute in reasonable time (and code space). No need to worry about that if you have optimization, because all modern compilers are smart enough to do that for you.

Other examples include loop unrolling, and function inlining. They all make the code very ugly if you want to optimize in C by hand.

That's why I would not use a non-optimizing compiler. Clean code is easy to read, easy to maintain, and easy to spot bugs in.

bxs:
*For me, 8bit:

- Baseline Architecture (PIC10, PIC12, PIC16) -> ASM

- Mid-Range Architecture (PIC12, PIC16) -> ASM / HI-TECH C

- Enhanced Mid-Range Architecture (PIC12FXXX, PIC16F1XX) -> HI-TECH C

- PIC18 Architecture (PIC18) -> MPLAB C18

*For 16bit and 32bit -> MPLAB C compilers.

For personal use, free versions are fine.

In case of PIC32 you can also look at CHIPKIT:
http://www.microchip.com/chipkit
https://github.com/chipKIT32/chipKIT32-MAX/downloads
http://www.chipkit.org/forum/

RCMR:
I use the Hitech C for PIC16 work and the Microchip C18 for PIC18 work.

Both are perfectly adequate but I do like the libraries in the Hitech compiler -- can save a bit of time when compared to using C18.

As for the AVR vs PIC debate -- fortunately much of the difference in CPU architecture is hidden when you're using C so it becomes somewhat moot.

PICs are cheap and plentiful and there's a wonderful underlying consistency within each family, Atmel's processors can become pretty hard to find at times.

However, it's horses for courses and the bottom line is -- it's all good!

andyg:
Thanks,

Its interesting to see what people are using.

@cyberfish: I'm not really "switching", just wanted to learn a different MCU and I know PIC is pretty popular. Plus I liked the fact you could debug your program with the PicKit. I'll look at the ARM Cortex based MCUs too.

Not sure what do do yet. Just wanted to learn some PIC but not willing to pay $$$ for a compiler yet. But it sounds like the free limited optmisation versions might be okay to use.

cyberfish:
Debugging with PicKit is definitely a very big advantage. Cortex has that, too. JTAG programming + debugging with a $30 dongle (or build your own, which is essentially just a FTDI breakout board).

I think PICs have better/more peripherals compared to AVR, but for free toolchain, AVR is definitely the way to go.

avrgcc is state of the art official compiler, that's free and open source. Doesn't get much better than that. ARM is similar.

If you just want to try another MCU, I think ARM would be a good idea because of the better open source tools (GCC/GDB), and it's also more "different".

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod