Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
I'll be working on a PIC 16xFx soon, and I can't find a free C compiler out there (other than the CCS/Hitech demos).
QuoteI'll be working on a PIC 16xFx soon, and I can't find a free C compiler out there (other than the CCS/Hitech demos).Is the "CCS/Hitech demo" that you mentioned Hi-Tech's PICC-Lite? I actually thought that one looked pretty good for a freeware ANSI C compiler - even though it will only target a limited range of PIC12F and PIC16F processors. I had even thought of trying to do a download, and running some canned C code through it to see how it works - though most of my PIC16 code is targeted towards the PIC16F72 - and that apparently doesn't fall into the freeware compiler's capabilities.http://www.htsoft.com/products/PICClite.php
It says it only allows "2 RAM banks, 2K program memory supported." Maybe this is plenty, but I don't know.
Also, I wonder what it means by "2 RAM banks." Do you know?
On sheet 12 of the datasheet for the PIC16F877, you'll see that the General Purpose Registers are split up into 4 "banks", each containing up to 7Fh (128 bytes) of 8-bit instructions. It looks to me from sheet 3 that the max number of instructions the chip will hold in program memory is 368 8-bit bytes. The compiler seems to be limited to using 256 bytes. So from what I can gather, with this compiler, you can use 2/3 of available memory for this device.It will take a better programmer than me to tell you what you can achieve with 256 instruction registers - I'm much more involved with and adept at hardware than firmware, and when I run out of I/O pins (which happens to me way faster than memory) I tend to just add another processor to my bus. This chip also has an instruction set of only 35 1-word instructions. That can work for you, as well as against you. I will say that I've used the "little brothers" of this processor, with even less memory space, for some fairly complex controllers in military systems - so depending on what you are trying to achieve, you may have plenty of space. As a side note - you are probably already aware that programming in assembly instead of a higher-level language like C will save you memory space.
Hey triger...your thing will go out on monday...I just got back... <soap box>Anyways I highly recomend that for pic's you program in assembly...if you want to program in C get an AVR because they are made for programing in C and overall you will save more money in free compilers and community support. AVR is veryopen source friendly.Pic's are made for programing in assembly if you ask me...that's why there are only 35 instructions....</soap box>
I think CCS C is the best out there, but its also the most expensive . . .http://www.ccsinfo.com/content.php?page=compilers
Have you heard anything (good or bad) about the CCS CAN kit?