3 ms·
SDCC is the only FOSS compiler for PIC microcontrollers. Microchip's XC8 compiler has a free version that's deliberately crippled (optimizations disabled, garba
by msarnoff 11y ago
SDCC is the only FOSS compiler for PIC microcontrollers. Microchip's XC8 compiler has a free version that's deliberately crippled (optimizations disabled, garbage instructions added to slow your code down) and a license for the full optimizing compiler costs $1000. SDCC does a decent job, though it has its quirks, and may not support the newer architectural features of the latest PICs.
One reason the Arduino project was so successful is that it was built on a microcontroller platform (Atmel AVR) which, unlike PIC, has a fully open-source GCC toolchain.
- jeff_marshall 11y agoIs there any reason to use PIC instead of ARM these days? On the low end, 32 bit arm microcontrollers can be had for ~ 0.50 USD in modest quantities (digikey minimum order quantity in the thousands). It's not like there is a shortage of compilers for the various ARM architecture revisions (though the BSP support may be lacking in the hobby market).
- sjburt 11y agoThere's lots of other factors besides compiler support and cost. There are some PIC devices with extreme low-power states that ARM can't really touch. It's also pretty common for special-purpose devices to include a small general purpose core. For example the TI CC2541 BTLE module includes an 8051.
- jeff_marshall 11y agoGood point re: general purpose cores in devices whose primary purpose is other things. I've been spoiled by the ability to choose parts that don't go quite so retro for the CPU in my own designs. Regarding power, is the difference all that great? some googling shows that there are cortex M3 devices that use 0.3 uA in standby. Do the PICs have some features that make standby mode more useful, or do they have significantly lower power draw in sleep mode? I've never had to deal with low power draw in standby/sleep mode outside of FPGA-based designs, so I'm curious to know whats out there.
- Matthias247 11y agoThe reasons for using PICs typically where cost (in the embedded market every cent is counted) and ultra-long device availability (there were only few PICs ever discontinued, and I guess most got some compatible successors).
- jeff_marshall 11y agoFair enough, but the device in question would have to be made in serious quantity to feel the difference (though that is a rational use-case). Per digikey, the cheapest 8-bit PIC is 0.35 USD in MOQ of 3K. When 15 cents matters to your BOM cost, you know you are making a lot of things :)