![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
HI,.. i am intending to start learnig C or Basic for programming PIC's.. which language do you recommend(except assembly).?? | |
| |
| | #2 |
|
The language that gets the job done is the best language. Learn assembly. It will force you to understand how the PIC works which will make you a better programmer when it comes to using high level languages. Once you master that, C is high level language of choice for the PICs. Why on Earth would you dismiss assembly? | |
| |
| | #3 |
|
I see assembly recommended all the time, but I think it makes more sense to learn a high level language first and be comfortable with it before delving into the detail of assembly. Mike | |
| |
| | #4 | |
| Quote:
i will also join you and i feel you can learn C --however, assy language is manytimes required as support. Particularly when you have to fit the code into small space-- optimization by other languages may not be that efficent as what you could do -- not at amature level but after gaining experience. So, all the best
__________________ Regards, Sarma. | ||
| |
| | #5 | |
| Quote:
This is not to badmouth higher level languages at all... I use C pretty much exclusively on PICs, however I still don't recommend it as a first step. Even if you only spend a short while with assembly, do a handful of basic to intermediate projects (maybe work through a bunch of nigel's tutorials), it should benefit you. Plus, if you ever have to get down to some short-duration precision delay routines (like if you're bit banging some sort of serial protocol) that can usually be done with more certainty in assembly, and many C compilers will allow you to use inline assembly code for this reason, among others, so that's yet another good reason to get a feel for it.
__________________ EEgeek.net | ||
| |
| | #6 |
|
Hi, Evandude's opinion is totally correct to my imagination. Higher level languages can be learnt later in due course.
__________________ Regards, Sarma. | |
| |
| | #7 |
|
I only use assembly. I can't see any advantage in using a high level language for PICs.
__________________ Len | |
| |
| | #8 | |
| Quote:
But when I had to build a device that could transmit serial data at a rather high rate relative to the clock speed of the PIC (couple of dozen instruction cycles between output transitions) I didn't even think of using C, I went straight to assembly where I could control exactly how many clock cycles everything would take without worrying about the compiler making different optimizations and changing things. There's a time and a place for everything.
__________________ EEgeek.net Last edited by evandude; 7th December 2006 at 09:58 PM. | ||
| |
| | #9 | |
| Quote:
Assembly produces efficient code using lots of man hours. High level languages produce varying degrees of efficient code using far less man hours. 95% of industry could care less about code efficiency so long as the program works. 100% of industry wants to spend as few man hours as possible to complete a project because time is money. | ||
| |
| | #10 |
|
I think C: modular programming should be advantage for a large project.
__________________ Microcontroller Programming Forums: http://forum.mcuprogramming.com Answer to your questions! --- Microcontroller Programming Blog: http://mcu-programming.blogspot.com uC - News, Resources and Tutorials | |
| |
| | #11 |
|
thanks guys for your efforts,,,,, i am using Assembly since two years and it is Great language,,,i really like it,,,but some people advised me to learn C for PIC programming.. thanks again | |
| |
| | #12 | |
| Quote:
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | ||
| |
| | #13 | |
| Quote:
Some C compilers are pretty efficient too. C30 for the dsPIC being one of them. | ||
| |
| | #14 |
|
Yes I agree with alot of the comments made here on this subject. Assembly language does force you to learn the hardware aspect of microcontrollers. Such as registers, timers, stacks I/O ports and so forth. I have used assembly for many different types of projects and found it to be very easy to learn. Then, I moved on to c/c++, which I also enjoy to use. But assembly gave me the foundation on how to program logically and understand what exactly is going on behind the scenes in a micro-controller.
| |
| |
| | #15 |
|
Try and learn assembly language, i.e. the language native to the device. Use assembly in small steps so you can understand the nuts and bolts of using the device then move on to higher level languages. This will stand you in good stead when debugging when using a higher level language, and will give you a deeper understanding of what's going on. My preference is for C, basic can be clunky and lead to bad programming practice. Having said that, basic is more like assembly language in terms of code structure so better chance of generating better assembly from basic. In the end there's no substitute for assembly in terms performance and space requirements, and I like to know exactly whats going on down there..!
| |
| |
|
| Tags |
| language, programming |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Which Programming language?? | pike | Micro Controllers | 5 | 8th December 2006 12:40 PM |
| PIC Programming in C Language | onlineajit2000 | Micro Controllers | 21 | 8th July 2006 11:36 AM |
| Learning Assembly Programming Language | Johnson777717 | Micro Controllers | 4 | 22nd March 2004 03:00 PM |
| which programming language ? | hm_fa_da | Micro Controllers | 4 | 24th July 2003 10:55 PM |
| PIC Programming Language | mailmicky24 | Micro Controllers | 1 | 12th March 2003 03:10 AM |