I'm new in embeded world.
in my PC I use both Pascal and C language,
in the embeded control, what the best language ?
Yogyakarta State University
Having done both, I strongly vote for C for professional quality project and for AVR specific compiled Basic for hobby stuff (much faster to develop and has a decent IDE). I've tried both BASCOM and FASTAVR dialects of BASIC. FASTAVR os an amazingly fast compiler (like, 1 second to compile, assemble and link) -= but it's a little crash-prone if you are making dumb newbie mistakes (like I am).
I did Pascal years back - in the UCSD Pascal days - long ago. It's OK for students of computer science, but not for embedded.
I am working right now with an excellent Pascal for AVR, and there are two available that I have tried: E-Pascal from AVRCo, and Embedded Pascal from Rainer Lamers.
Embedded Pascal is a very interesting product which implements some interesting features in support of doing a lot of development and simulation under Delphi, with a compatible code base, and then moving over to AVR, without having to change the code. It's clean, it's clever, and very well thought out. It also produces pretty clean code. And it's inexpensive.
E-Pascal is a more expensive package, but it includes libraries in support of many hardware-specific operations, such as SPI, TWI, switch debounce, LCD driver, PWM drivers, and in the Professional version, also includes TCP/IP. It intruduces some variations on normal Pascal syntax which take some getting used to, but which I like. It also produces clean code, and its libraries have been optimized in assembler.
Having said that, there are also many C compilers out there, and even a port of gcc for the AVR family. If you intend to make embedded work a hobby, you could go with either C or Pascal. If you intend to make it a marketable skill, you still could go either way, but in the US, will find less resistance to C. In Europe, many view C as the home of many seat-of-the-pants hacks, and Pascal still has a strong following.
Contrary to Steve's comment, PAscal works fine for embedded projects, so long as it's not stuck in the dark ages of UCSD.
admin's test signature
Oh No! I made the mistake of debating the merits and demerits of different programming languages! Almost as bad as debating religion or politics.
I respectfully withdraw my comments!!!
Well, these are not your father's Pascals .
And, FWIW, I like C, too, but am more productive, and more at ease, with Pascal.
The real bottom line is what gives the greatest productivity for each developer.
Yours in agnosticism ,
Wow, a Pascal compiler that works under Delphi! I'm downloading it now to give it a shot! I've been using Pascal since the CP/M days and have used every version of TP/BP and now Delphi 5. I've always preferred the Pascal syntax over C, much easier to look at 5 year old code and remember what I was doing. :-)
Oh, it should be readable?
readable code? What's that?
BTW... the best feature in the C language is the "?" operator ;-)
I'd vote for 'C', not for any technical reasons (deep down, all programming languages are equivalent), but simply because there are more people using it.
It's therefore a more marketable skill to learn, and more people will understand your code. You will also be able to consult more people for help.
Me to, I vote for C/C++. Remember that C/C++ is a real programming language, it had standards etc (ANSI etc) and is PLATFORM INDEPENDANT.
Delphi, on the other hand, is only a tool. No standards....
And one must have standards.
The great thing about standards is that there are so many from which to choose.
:) Have a good weekend, all.
C++ is a tangle of standards, a collection of mismatched things to which the committee seems to have been unable to say no.
In the real world, the issue of language standards rarely comes into play, unless you are dealing with PHB's or the military. In over 25 years, I have yet to have an employer or client who was much concerned with standards in selection of tools. On the other hand, all have been concerned with results.
Small firms rarely give a hoot about standards, but in the world of large corporations, they usually care as much, if not more, about standards than they do about results. One of my clients has a "standards list" for everything from programming languages to OS's to word processors to screen savers (!). Employees are barred from installing anything not on the list, and getting a piece of software on the list is a multiyear project.
You don't know how many meetings I've been in and heard a variation of, "Yes, I understand its cheaper, faster, more stable, and has a lot more functionality...but its not an approved product".
C is forbidden in military and life support systems.
Evaluate E-Lab Multitasking Pascal and you will be amazed!
p.s. I did not make it, i just use it!
I am also using E-Pascal, and am very pleased with it.
Who told you that nonsense? In any military system that has a language requirement, EVERYTHING but Ada is forbidden. In life support systems there are no language requirements, and I know for sure of several medical systems with C based firmware.
we do military stuff all the time. in C.
Language-wise, i am convinced that Pascal and C are more or less equavalent.
But, I tend to think Pascal compilers for MCU's are for people too lazy to learn C.
As have been said before, it's better to program in a more or less "universal" language that most people understand.
I doubt many employers are going to be very impressed with your literacy if they have no use for it or if they are not already using it. Pascal is not obscure, but it is certainly not used close to 10% as much as C. To tell the truth i have never met anyone who has seen a Pascal compiler for MCU's.
for people too lazy to learn C
Ooh - hardly fair. Although I agree that C is a much more marketable skill than Pascal, especially in the embedded arena.
I agree that C and Pascal are more or less equivalent in their capabilities.
I learned C many years ago, but never really liked it much. It is clearly in wide use, but also clear is the fact that there are few who use it well.
Most clients and employers in my experience care more for results than for the politics (or religion) of language.
As to Pascal for MCUs, I have two Pascal compilers for the AVR family, and both are very well suited to embedded work.
Pascal limits the damage a dumb programmer can do. We give all the nitwits in our dept. the pascal jobs.
I'd go for C. And for speed, no doubt, ASM is the way to go. No shortcuts here.
Here, Here. AVRCo is excellent.
Some weird compiling problems sometimes, but thats probly just me.
Why are you posting to a 2 1/2 year old thread?
It seems to be a popular tend lately :roll:
/* John Butera */
Well we keep telling people to search, apaprantly some are searching DEEP in the archives :)
Writing code is like having sex.... make one little mistake, and you're supporting it for life.
Hey at least you know I'm digging through them :)
OK let's add another bit of cotton to this thread :D Forgetting about using Pascal, C,Deplhi or any other H/L language for the AVR (Assembler rules here for that :wink: ) I have been thinking of getting some compiler to do some semi simple interfaces on the PC side. Delphi or VB seems to be used most for such tasks, any suggestions (biased or unbiased)? VB may be easier as I used to do lots of Basic stuff in my younger days, on the downside it's a M$ product and Delphi is not as far as I know. Any ideas on cost comparisons, forums (so I can show off my ignorance) and any other usefull stuff? OK go for it..... :D
Ampertronics Pty. Ltd.
* Electronic Design * Custom Products * Contract Assembly
gee, I long ago decided that C is a portable assembly language. Thus, it's ideal for all but the smallest microprocessors.
It can hardly be called a high level language. Now C++ is of course a different animal.
But then, the third programming language I learned was (UCSD) Pascal - on an Apple II with a 6502, ahem, microprocessor.
VB isn't your grandfather's BASIC anymore.... esp if you're using VB.NET (anything newer than VB 6.0)
Personally if you go towards the VB side take a look at C#. It's the same thing with more C-like syntax for those of us who's native language is C.
I like San Diego.... I go there quite often on business.
Off topic - yet quite informative :o
Something else to consider: VB requires that you ship a "run-time environment", essentially a DLL. This also means that VB is interpreted (not that you can easily tell).
Delphi is a completely compiled language: no runtime library is needed to run your program or ship with it. You can compile everything into one executable if you want.
If you prefer C++ over Object Pascal, Borland also sells C++ Builder (IIRC), which is the same Visual RAD environment but with a C++ backend instead of Pascal.
© 2020 Microchip Technology Inc.