![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
I just recently got into C programming for the PIC's, and I am completely lost as to what compiler I have to pick. I have the PIC 16F877A. I have ran C programs on the PIC, but I am having trouble decoding what the program instruction do - I havnt found any useful tutorial for Hi-Tech C (Im using the PIC lite intergration with MPLAB) Are there any useful tutorials, etc. Or are there better compilers, with a larger support base. | |
| |
| | #2 | |
| Quote:
You can't beat that deal anywhere. Microchip's C18 is about $500 and is for 18F's only. You get to pay again to get another compiler for 16F's. PICC is around $1000 for a full license, I think for only one family (16F or 18F). I could be mistaken about that, but still it's a lot of bucks if you're a hobbiest.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #3 | |
| Quote:
And im assuming that all C compilers syntax's are very similar to each other? | ||
| |
| | #4 | ||
| Quote:
Quote:
The way you access bits and registers is defined in the include files (can be changed if you can't live with it). This is where some of the biggest differences in PIC compiler syntax comes in. BoostC is one of the easiest to live with, IMHO. It is a little different from the others, but not weird or anything - they're all a bit different from each other. It's easy to port code from other compilers. The changes aren't hard to make. If you've never programmed in C before you might be wise to learn it on a PC first, at least till you're a bit comfortable with it. There's bazillions of tutorials and on a PC you have easy pre-configured stdin and stdout (the keyboard and monitor) to learn with, whereas on a PIC you have to write code to do your own input and output. It can be quite a hump to get over when you're brand new to the language. If you don't yet know how to program in C, how do you write I/O code to learn the basics? On the other hand, blinking a LED in C is trivially easy.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 6th January 2009 at 04:09 AM. | |||
| |
| | #5 |
| People always claim that, yet it's not simple to transfer code from one compiler to another - not even on a PC. And on PIC's compilers are wildly different - C seems no better than BASIC or Pascal for moving between compilers.
| |
| |
| | #6 |
|
Hi I also like to join to this thread regarding compilers.I have the same issue like OP. I have CCS C full,BoostC trial,C18 Student versions. I still wondering what to start with.Futz gave me some nice info about compilers. I already completed studying a CCS book by (Nigel Gardener) & got the basics of C. After finding on the net very few working with this compiler (CCS C) & heard there are some bugs on that. My mind is always focusing to change the current compiler.More focusing on 18F series for future designs. Any ideas on what compiler to use? Last edited by Gayan Soyza; 6th January 2009 at 09:39 AM. | |
| |
| | #7 |
|
Gayan, What target hardware do you have available. Mike. | |
| |
| | #8 |
| Hi Mike I have Programmers *Junebug *ICD2 *Modified JDM (for 18F) Target boards Target boards I have made by myself with the ICSP connector & header pins on all I/O pins on PIC 18F1320,18F452 etc.......... At anytime I can quickly build any target board to check the code is working in real life | |
| |
| | #11 |
|
My vote also goes to my favorite - Sourceboost. In fact it comes with Basic, C and C++ support. It has very nice and simple to use IDE and simulation capabilites. Free version is 2kB and 2 ram banks limited but it takes a while to fill that. (Full license cost is very reasonable as mentioned above). Btw, Sourceboost developers have recently announced working on compiler for dsPIC/PIC24/PIC32 series
__________________ "The only thing worse than getting an error message is not getting an error message." - Allen Downey | |
| |
| | #12 |
|
I gave BoostC a try last night, and my LED's have been flashing ![]() What I didnt understand, is why I had to turn my porta into digital mode so I can get them on? | |
| |
| | #13 | ||
| Quote:
Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |||
| |
| | #14 | |
| Quote:
So, Code: bsf PORTA,1 bsf PORTA,2 It's also very confusing. ![]() Mike. | ||
| |
| | #15 |
|
I'm having trouble starting. Can anyone confirm that I should get a good C book, learn the basics and then apply it to the PIC's?
| |
| |
|
| Tags |
| hitech |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Using 'continue' in Hi-Tech C | MrNobody | Micro Controllers | 13 | 1st September 2008 12:14 AM |
| New robotics tech | mous3 | Robotics Chat | 0 | 31st July 2008 03:07 AM |
| Greetings Electro-tech. | xl5 | Chit-Chat | 4 | 29th December 2007 07:06 PM |
| Getting started with Hi-tech C.. | MrNobody | Micro Controllers | 3 | 2nd August 2007 03:28 AM |
| mobile tech | jeevan772006 | Electronic Projects Design/Ideas/Reviews | 0 | 1st September 2005 07:19 AM |