|
|
View previous topic :: View next topic |
Author |
Message |
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
Compiler selection |
Posted: Wed Jan 05, 2022 4:23 am |
|
|
Hello everyone
Is CCS C compiler? or MikroC PRO for PIC COMPILER? Which one do you think I should buy? What are your thoughts on these two compilers? Also, what should I consider when choosing a compiler? _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Wed Jan 05, 2022 7:09 am |
|
|
I know you need to buy the CCS compiler.
I've had PCM since v2.534 and tried the others a few times. Didn't like some aspects of them, stuff that CCS does in one easy to understand line, they need more code, more typing and I'm a terrible typist (missing finger don't help..)
What to consider.
1st Which PIC and 'series' or 'family' ?
If possible, decide on a 'Swiss Army Knife' PIC like the 18F46K22, which can operate, full speed at 3 and 5 volt, has LOTS of memory space, 2 HW UARTs, and several peripherals. While more PIC than needed for small projects, you'll be able to finish projects faster as you'll have you own library of good, solid, working functions. Just because a new PIC comes out doesn't mean it's better.
2nd Cost. While a smaller PIC is cheaper, everyone always needs 'just 2 more pins' or another timer or ...... Most don't consider R&D time as real money but consider this. You decide on the new PIC, then discover a bug after a day, that days 2-3 days to fix. Say it was 15 hrs of time. At $50/hr, that's $750 . If you'd bought the bigger, old PIC (the one that always works), you'd have saved $750 - the extra cost per PIC. Maybe a $1 ? So a run of 200 units cost you $200 more BUT saved $750 in time, you MADE $550 AND got the product out the door, to the client faster.
I'm sure others will reply, most on this forum have been here for years and years and years..... |
|
|
MikeW
Joined: 15 Sep 2003 Posts: 184 Location: Warrington UK
|
|
Posted: Wed Jan 05, 2022 11:10 am |
|
|
@MCUprogrammer
I am saddened that since you joined the site in September 2020.
You ask such a basic question |
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Thu Jan 06, 2022 12:08 am |
|
|
@MikeW
Is it simple? I think you are thinking wrong. If you can't make the right decision for the subject that you see as simple, sometimes you spend days. Yes, I became a newly graduated software developer in 2020. Of course, a good software developer depends on the person, but it takes a lot of time. In these 1 or 2 years, we don't sit around and write code every day from morning to night. Or we don't get training on how to write a good code. Since I used CCS C at school, I continued from here. This may be a wrong choice. I'm really curious about this. What to consider when choosing a compiler. Yes I compared these two compilers. Because I think these are the most used ones. But I don't think it will take much time to answer this simple question for you. You may do me a favor by sharing your thoughts on this matter. When you have just graduated, I do not think that such situations are in the foreground. In general, we move on to the coding part as soon as possible. We have no reaction to compiler errors or syntax errors. As a person matures, he matures. He is learning. Here comes the desire to do better this time. And he decides that everything started with the right choice. Of course, these are my thoughts. One can always learn something new. I assume you are knowledgeable about this. Because you entered in 2003. And you only have 183 posts. Of course, it shows how you share this information. by temtronic joined in 2010 and the number of posts is 8263. And I really think he is such a great guy. Almost every post has an answer. This is commendable behavior. When I achieve something in this regard, I will pass on my knowledge to my friends here. Because this site is very successful and effective. There is a proverb. Information multiplies as it is shared. Thanks for the explanation... _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Thu Jan 06, 2022 3:01 am |
|
|
Used with a bit of care, you can write code in CCS, that is as efficient
as assembler. Sign that it's core efficiency is great. Combine that with the
inbuilt support code for just about every PIC peripheral, and you can
generate working code quicker than with any other compiler I have met
(have used six and counting).
Has it's 'oddities'.
First at core it was historically a single pass compiler. It generates it's
'best' code, when used this way. So though it does now support multiple
compilation units, it is better to still use it and compile all the code each
time. It is though very quick at that, so this isn't generally a problem. For
example, current project takes less than four seconds to compile, with a
project with 27000 lines of code, using 184000 bytes of ROM. Most small
projects take less than a second.
Second on the smaller chips (particularly the older ones that don't offer
instructions to read the program memory), the 'work arounds' for the
Harvard architecture can be a little strange in use. This though only
applies to these chips. On newer ones the code becomes very standard.
This then highlights one of CCS's 'important points'. It is only very slightly
'ANSI compliant'. It keeps pretty much 100% to the K&R definitions and
usage. The best reference book for it is the K&R second edition. This was
the original 'ANSI C' edition, and all the examples in this, (with the correct
chip setups), will compile and run on CCS. There is once oddity with ?:
that has only been fixed on the latest compilers though.
Now as an example, I needed a basic tiny PIC to read an analog signal,
control an output pin, and send a scaled value on TTL serial. The code
was running in less than ten minutes from a 'standing start'. PIC12F1840
(smallest chip I had with a UART). No other compiler I have met, would
allow this to be so easy.
If you keep to K&R code, and learn the CCS extras, it is I think the best
PIC compiler in existence. However if you want 100% ANSI compliance,
with the newer ANSI functions, then 'look elsewhere'. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Jan 06, 2022 6:43 am |
|
|
As Mr. T points out CCS C compiler has grown over the years in keeping wiith how PICs have. Considering the 100s of new PICs every year, that is a tremendous accomplishment. CCS C is designed for PICs,so it won't have the 'fancy' stuff 'ANSI C' has BUT the generated code is 'tight',as Mr. T says.
Being able to 'cut code' and have a project RUN in minutes is why I chose CCS a long,long time ago. Back then, we all used assembler and while there aren't a lot of instructions(30+- compared to 100+ for Z80),coding in a high level language made life a lot easier ! I learned C from this forum and the 100s of examples CCS supplies,and while my code is not 'ANSI C' format,.One day i should read the K&R 'bible' but at 68, I'm kinda set in my ways. |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 478 Location: Montenegro
|
|
Posted: Thu Jan 06, 2022 6:52 am |
|
|
When I saw the original question, I couldn't believe it. But then i said to myself that OP probably meant to ask simply which one is better.
I started with MikroC, bought their debugger and made a few hobby projects with it. Simple things. It kinda worked, but it wasn't a pleasant experience. New to C with a whole set of problems that brings and tools you aren't sure are working.
Then I found CCS. Nice IDE, works with MPLAB, cheap programmers/debuggers, great forum. Here I'm sure all the tools work so the only problems I have to deal with are my programming skills (or better yet, lack of them). For my money, CCS is a way better product. |
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Thu Jan 06, 2022 8:20 am |
|
|
Thank you everyone. Yes, we continue on our CCS C path. I love spending my time on this job. I enjoy coding, creating products and sitting down and developing algorithms. Yes, these things are very difficult. But our way is longer. To be a good programmer, I spend a lot of time figuring things out and thinking about it a lot. In fact, I take care to write programs using features such as structure, pointer in my programs. So it puts a lot of emphasis on optimizing the code. I take care to write clean and understandable code snippets. _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
scottc
Joined: 16 Aug 2010 Posts: 95
|
|
Posted: Thu Jan 06, 2022 10:39 am |
|
|
I had the opportunity to try out MikroC just a few weeks ago. On the surface it looks pretty good, the IDE is nice but I found the help file to be lacking.
The other thing I hated was that the program "Phoned Home" needed an internet connection.
For things like developing software to me this is a walk away & uninstall due to potential leak risk.
To echo what others have said, I think CCS compiler is very very good and support is also good. For someone starting out or even a seasoned pro which by no means I am not, CCS gets a thumbs up from me. |
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Thu Jan 06, 2022 11:44 pm |
|
|
mr @scottc many thanks for sharing your thought and experience. _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|