In my studies I am just now getting into programing. Starting with the Basic Stamp, and comming up is the 68HC11.
From what I see it seems that every different microcontroller has a very different program language.
My question: Is there a universal program or do I have to learn a different one for every different microcontroller?
If so then, is there one in particular I should pay attention to, such as the 68HC11 or the Basic Stamp?
New to programing
-
- Posts: 458
- Joined: Thu Feb 05, 2004 1:01 am
- Location: Minneapolis, MN
- Contact:
There was an attempt at such a beast, I think it was called UMPS, but I don't think it progressed very far.
However, if you are willing/able to learn 'C', structured basic, Java, then you can get very close to one language for many uC's.
Unforutnately, there are not only differences between 'C' compilers, but also of course different instructions available depending on the capabilities of the uC in question. One reason why you'll find programmers tend to stick to one companys product.
You'll get a better match in syntax variabilities, if you find one of the commercial compiler companies who produce compilers for a variety of uC's. Sadly, this will mean paying for a compiler rather than using one of the free offerings from a hardware manufacturer.
Having said that, once 'C' etc has been learnt for one uC, then porting a program or writing a new program for a different flavour of uC, is not that hard.
Colin
However, if you are willing/able to learn 'C', structured basic, Java, then you can get very close to one language for many uC's.
Unforutnately, there are not only differences between 'C' compilers, but also of course different instructions available depending on the capabilities of the uC in question. One reason why you'll find programmers tend to stick to one companys product.
You'll get a better match in syntax variabilities, if you find one of the commercial compiler companies who produce compilers for a variety of uC's. Sadly, this will mean paying for a compiler rather than using one of the free offerings from a hardware manufacturer.
Having said that, once 'C' etc has been learnt for one uC, then porting a program or writing a new program for a different flavour of uC, is not that hard.
Colin
On a clear disk you can seek forever.
Programming in C
I thank both of you,
I am willing and able to learn C , and thats what I am going to do.
I have been to verona web site and will be there again.
Are there any other helpful web sites or books that you know of for the beginner?
Again , thank you
I am willing and able to learn C , and thats what I am going to do.
I have been to verona web site and will be there again.
Are there any other helpful web sites or books that you know of for the beginner?
Again , thank you
Hi
I agree with all thats been said so far but if you are going to get into microcontrollers in a big way it would be a good idea to have a look at assembly language.
Although the array of assembly languages is mind boggling, they do give you a much better feel for the hardware involved and give much more efficient code.
Once you get to grips with programming and the logic involved with such low level languages it usually isnt that hard to pick up other assembly languages.
But yeah C is much easier
I agree with all thats been said so far but if you are going to get into microcontrollers in a big way it would be a good idea to have a look at assembly language.
Although the array of assembly languages is mind boggling, they do give you a much better feel for the hardware involved and give much more efficient code.
Once you get to grips with programming and the logic involved with such low level languages it usually isnt that hard to pick up other assembly languages.
But yeah C is much easier
"Nothing is true, all is permitted" - Hassan i Sabbah
Yeah, he he, but i like to know what my machine is doing forbwts wrote:Hi
<snip>
But yeah C is much easier
every single instruction cycle. Unfortunately this means i cant
use a high level language unless i investigate every single
function call it makes. I guess that's possible though.
I also thought of maybe making my own higher level language
that would compile into assembler. This way during program debug
the assembler code could be reviewed which might show an extra
instruction or nop or something like that that causes a problem in
the overall software.
LEDs vs Bulbs, LEDs are winning.
Actually, Al, C is pretty decent for that (low level control). While ASM is clearly the best at total control of the uC, with C you can usually get an assembly listing so you know what's going on. Yeah, as an ASM programmer, sometimes you cringe at the code but unless you run out of space or the code sequence has very specific performance reqs, it is livable.
Of course, the advantage of C is that it's pretty well universal and give you a much higher level of productivity. Especially for some one with out years of ASM experience. In my case, I have 30 years of experience writing both C and ASM on numerous processors. Most of it was systems SW (OS, media, ...). I'll take C in a heart beat because I can bang out the code very fast. If necessary, I can drop to ASM for speed or space needs. In fact, when I target ASM code, I often use C as the prototyping tool - get the algorithm right and then rewrite in ASM.
Of course, the advantage of C is that it's pretty well universal and give you a much higher level of productivity. Especially for some one with out years of ASM experience. In my case, I have 30 years of experience writing both C and ASM on numerous processors. Most of it was systems SW (OS, media, ...). I'll take C in a heart beat because I can bang out the code very fast. If necessary, I can drop to ASM for speed or space needs. In fact, when I target ASM code, I often use C as the prototyping tool - get the algorithm right and then rewrite in ASM.
yeah, especially on the PIC where you have to use double inversion logic to do jumps using the skip instructions. I sure wish the 16F series had jump-not-equal, jump-less-than and so on. I hate the idea of bit testing the condition word and then skipping over the jump instruction based on the opposite condition.
Even if it's hideously inefficient, I usually stay with the C code.
Even if it's hideously inefficient, I usually stay with the C code.
Who is online
Users browsing this forum: No registered users and 43 guests