[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

File: 61 KB, 500x500, 0217063-500x500.jpg [View same] [iqdb] [saucenao] [google]
769120 No.769120 [Reply] [Original]

Hi, /diy/.
Is there a free c compiler for PIC? CCS C compiler is a great C compiler for pic, but expensive as hell. I want something free.

>> No.769127

>>769120
MCC18 student ed works fine

>> No.769128

>>769120
I use the MCC18/MPlab toolsuite. ( mpasm, mplink, mcc18, mplib). There's a feature you have to pay for called "omniscient code generation". It increases optimization with large projects containing several files. It's not important for most hobby/student projects.

>> No.769130

>>769127
>>769128
will it work for 16f series?

>> No.769132

>>769130
No.

>> No.769153

>>769128
"Omniscient code generation" sounds like precompiled headers.

You can get the same benefit (inlining and dead-code elimination across files) by catting all your source files together and compiling that. It's a memory-intensive hack compared to PCH, but who the hell cares when you're compiling for a PIC?

>> No.769236

>>769120
Try SDCC.

>>769153
AFAIK the omniscient code generator is a whole program optimizer. Precompiled headers just speed up compilation, they should not affect the compiler output.

>> No.769253

tfw you realize that pic is is the first arch unsupported by gcc that you stumble across…

>> No.769276

>>769130
For 16F series you can use MPLAB X IDE with XC8 compiler.
You can get it from microchip.com and it's free.

>> No.769291

>>769120
Time to Arrrr!

>> No.769297

>>769291
Yeah. I arrrred. Mplab is a 1gb program and you have to download a compiler separately. Too much trouble. LOL.

>> No.769353

>>769120
mplab with xc8. free with basic optimization
30-60 days of trial for full optimization
>>769130
mplab with xc8.

also mplab x is multiplaform, if you can live with it (can be a pain in the ass to configure at first) and if you have a supported programmer (basically the pickit 2 is deprecated)

C18 is not supported anymore

>> No.769488

https://dis.4chan.org/read/prog/1368709566 still works, but the compilers nowadays embed the sha1sum of the license server exe. It's stored in plaintext, so it's easy to replace with a hex editor.

>> No.769509

Our university class uses the PIC18F4520 with the MPLABX IDE. Our compiler is C18. It works pretty well. Sometimes it seems like overkill for what we use it for but whatever.

>> No.769529

Anyone knows where I can learn to program pics?

>> No.769532

>>769529
Don't. Pic(k) something better. AVR/MSP430/ARM/something else. Bury the PIC with their shit architecture and their shit tools, and put the 8051 face down next to it.

>> No.769543

>>769532
This

>> No.770114

>>769120
use assembly queer that's what I do

>> No.770160
File: 490 KB, 449x401, Girls.png [View same] [iqdb] [saucenao] [google]
770160

>>769120
>pic
>0.25 instructions per clock

>> No.770185

>>770114
Yeah, assembly for low-end PICs is the way to go.