Need guidance,where to start C programming

Funny how what Microsoft terms innovation literally means, buying an existing product below cost, re-labeling it, and then piling on tons of unnecessary new "features" which no-one uses but which are written badly enough to reduce overally product reliability, increase attack vulnerability and decrease performance ... simultaneously (well, the shoe fits).

Then, to fix the whole mess, they obtain a 3rd party firewall, integrate it with the OS, provide *NO* means to either turn it off or *NOT* to register/update/upgrade it, and which ultimately prevents the user from actually accomplishing anything ...

YOU WERE ABOUT TO READ A WEB PAGE Are you sure you want to do that?

On the other hand, at this point, I *ONLY* run Microsoft now as a virtual machine, and then only seldom.

Given the availability of FreeBSD 7.x, OpenBSD and NetBSD, Debian Lenny and Ubuntu, along with Firefox/Thunderbird, OpenOffice, there is precious little that Windows offers I can't get elsewhere. Add in Gnu tool chains, and even the embedded stuff mostly works on FOSS!!!!

Reply to
Spam
Loading thread data ...

Hmmm, I guess either my recollection is wrong, or I was told furphies...

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, 
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply to
Mark McDougall

Now

in

First of all thank you so much for your reply...... Now let me tell you 1 thing, I am realy confused. When I was in Univercity,i used Turbo C.After finishing my study,i started to work in a small company providing automation solutions.When i started they already have their set up and few standard interfacing routines ready for their product. So the only thing i know is Keil environment and 8051 programming using C.I never cared or i never needed to understand anything like gcc or SDCC or anyother platform for developing programs for controller.Now few days back i got interview for Embedded System Software Developer(don't know luckyly or unluckyly) and i found myself completely out of this field.I've forgotten almost everything.So decided to get some practice for C programming and find out this site from google. Now you tell me what should i do???My interview is over(ofcourse didn't get the position)but I still have some bright chances for other similar positions in my company but i wanna learn all the basic stuff and practise C programming. I realy appreciate your help and guidance.

Reply to
minita

... snip ...

I suggest you use comp.lang.c newsgroup to learn about portable C, i.e. the C that will run on any C system. comp.arch.embedded deals with rather specialized systems, and many do not use standard C, or an C code whatsoever.

When you do, add some blanks in your messages. Such as after sentences, before and after parentheses, etc.

Blank lines separate paragraphs, like this. Limit your line length to 72 (better 67) characters. Read the following:

Some useful links on quoting:

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
            Try the download section.
Reply to
CBFalconer

You were in an environment others had set up for you. That's like living a closeted life. There is a big world out there.

You'd never been exposed to all the details.

Everyone comes from a different place, so I feel almost like Buddha telling you that you need to "find your own path." But in a sense, you do. There is no one-size-fits-all. Worse, this is a difficult time to be looking for work as there are lots more supurb, excellent people out there also looking for work, too, together with the fact that there may be fewer businesses looking for them. Tighter than normal.

This is a time to re-group. And so, you come at a very good time for self-examination and self-study, if you can afford to spend that time. While folks _aren't_ hiring you is the best time to be working on your skills, breadth and depth, so that when opportunities do happen to arrive on occasion you are better ready to take advantage of them.

My recommendation would really depend on what kind of person you are. You tell me: Are you more a minimalist who pursues learning only when forced to by the job? Or the sort who studies and does things on their own, whether or not your job requires if of you... in other words, you like doing this stuff and would do it for free if people didn't pay you to do it? If the former, I'll let others suggest where more of the business is at and you can focus on learning just those things needed to make a success out of that. If the latter, then start out with just about anything cheap and make the most out of it.

Use groups like this as a resource. But remember that you will get the most distance if you work hard and run up against something specific before asking. Feynman wrote something like, "The dull student asks simple questions requiring complicated answers, while the bright student asks complex questions allowing simple answers." Be a bright student.

Better embedded programmers bring more to the table than programming. For instrumentation, for example, they will be able to read schematics, do some modest design on their own, very versatile with general algebra and the rules of logic and its algebra, in better cases also at least generally aware of most mathematics up to ordinary differential equations, integrating factors, and perhaps Laplace as another approach to solving them, some physics applicable to various sensors and transducers, etc. For graphics oriented embedded work, familiarity with linear algebra, 3D transformations, transcendentals, various methods (advantages and disadvantages) of finding intersections quickly over large numbers of line segments, etc., would be helpful. But always, no matter the area, it's good to bring in some areas that overlap with other key skills related to the area you are looking in.

There isn't really a "general purpose embedded programmer" so much as a bunch of specialties. You can see that in this group if you are around very long, with disagreements here over what constitutes or defines "embedded." There is quite a varying set of opinions. (I have mine, too.) But pretty much all embedded programming will usually involve some assembly programming somewhere at some point, the ability to investigate c compiler output for compiler errors, an understanding -- somewhat, at least -- of the linking process and what sematics might be useful at that stage of the game, and the ability to track down problems when presented with them. In other words, somewhat broader skills than your usual c programmer might require for programming on a general purpose operating system environment; who can often completely ignore concerns over assembly or linker semantics.

An independence of mind may help, too.

Best is to find something _you_ want to do with embedded while you don't have a job doing what others tell you to do. Use your own motivation to move you forward. What would you like to make/do?

Jon

Reply to
Jon Kirwan

version.

it.

a

already

programming

or

know

practise

Thanks again for your reply.

Ok now thing is if my interview is over than why i visited this site again and why i started conversation with you?

I didn't mention it before,i worked as a software developer('C') for 2 1/2 years in the same company.Also i am good in assembly language.i have done more than 50 projects. just to mention a few Humidity indicator, temp. indicator , Fire Indicator(realy big project having 40 i/p and 40 o/p),Stree light controller , Front LED display for the Trains , Interlocking System, Controller for chemical dryer and so on. I have done little bit of R&D,design and new development for 2-3 projects also. If i have done all these than why i am behavinglike a dumb?? whuy i don't have confidence? Because as i mentioned you before when i started that job everything was set up, ofcourse they had different hardware for different projects and i am good with processor interfacing with LCDs, memory , keypad , ADC all that suff but not very good computer side,i mean which software or which platform we should use and what is the difference?

And after 3 years of gap i am in a condition,i doubt about myself whether i have done all these.

Now there are 2 things , i don't have any setup at a home and my workplace is completely different. I am working as a electronics technician who troubleshoots the assembled mobiles if they fail after functional testing.

In my interview they asked me few questions about C as the positions was Embedded system software developer but developement was in C and assembly language.1 question was if we are getting data through serial comm. than prepare function for receiving data each time and make a whole series of data after connecting data packets. i have done it before but coudn't do it in the interview just because lake of practice. Other que. was compare members of array and find similar members.i did it using 2 FOR loops but he asked me to prepare function in different style to speed up the process and i coudn't do it.

So i think what i need is C programming practice.i need 1 platform to work on and will find out some projects or problems from internet and try to develope a design on paper and prepare firmware.i won't have actual hardware but that's fine, atleast i'll have good practice and i am sure in next few months i'll get the position.

Thank you so much for your eye opening reply.i understand the core of reply and will try to do something realy solid. Still any advice or suggestion is appreciated. Thanks a lot!!!!!!!!

Reply to
minita

In message , David Brown writes

If it is a choice between SDCC and Keil Kiel wins with no question It has 80% of the 8051 market.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

Why?

SDCC has improved a great deal over the recent years and is now a reasonably competitive c compiler, unless you can provide some seriously damaging specifics.

Jon

Reply to
Jon Kirwan

An independence of mind may help, too.

Reply to
Steve at fivetrees

If you are just looking for c experience, get some. Since it appears you may have had 8031 experience, perhaps consider using free tools like SDCC with SiLabs development boards and IDE. Just get something.

If you want something downright cheap and want to use C and C++, get these two (hardware and software):

formatting link
formatting link
You can do a lot of playing around with C and C++ and the whole thing is the size of a USB memory device and costs $20 (or $10, if another sale happens.)

Or go nuts with:

formatting link

Just get & do.

Jon

Reply to
Jon Kirwan

It looks to me like you may need to learn more about algorithms as well, though perhaps that last question was looking for pointer access of an array.

Get the book "The C Programming Language" Second Edition (has the big ANSI stamp on the front cover) and go through that, as well as writing your own C code.

Reply to
Ben Bradley

I agree that over the last few years SDCC has improved greatly to "reasonable" However it is nothing like as good as Keil.... Why use SDCC when the eval version of Keil is free and has enough space for a lot of projects.

More to the point unless SDCC can do the register re-use and aggressive data overlaying you can probably do programs with the Keil C51 eval that will not even compiler to fit an 8051 with the full SDCC...

The problem is not the Keil limit on CODE size but running out of DATA ram ... that is where the bottle neck is. I would be very surprised to hear that SDCC has the implemented the data tree analysis to do data overlaying that is provably safe.

BTW who ran either Pulm Hall or Perennial on SDCC and can show that it is indeed a C compiler? I know that Keil runs Plum-Hall and many other tests.

Not only that I know several smart card manufacturers who say if it you compile and test it on the Keil compiler/simulator and do a run off

100,000 smart cards the cards will work as per the simulator/compiler. That is one hell of a vote of confidence for the compiler.

Also the memory system on an 8051 is not the Sam for all.. There are some 30 variants in how the memory is done. Simple compilers just change the header file there is MUCH more to it than that. I recall that there were instructions with SDCC to use the KEil header files from the eval version (which is breach of the eval license and copy right)

For example those parts with the extended 8MG memory map can use either banking or contiguous and the handling is deferent. Others have differing ways of allocating SFR's that are non in the original 8051/2 map

There are many varients of the 8051 that require a LOT more than a change of header files and this is handled inside the KEil compiler.

SO in short you have an untested compiler that has moved from "flakey" to "reasonable" that can not produce compact systems like Keil can of code tailored for many of the 600 8051 family or the worlds best 8051 compiler... No contest really. .

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

In message , Ben Bradley writes

Don't do that. Get the C51 Primer. You should not be using INTs on the

8051
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

That's good to hear from you. It has.

But I'm not interested in hearing your opinion a second time, without supporting facts. Which is why I asked for you to provide specifics.

I see you still aren't doing that.

There are lots of possibilities for that. Keil limits itself to 0x800 bytes, I believe, without registration and to 0x1000 bytes after that. (Correct me if I'm wrong.) But that's not the entire issue, is it?

If one is ever intending to do something larger and already knows they cannot or will not afford the price Keil requires for those needs, it might be a better thing to learn to use SDCC at the outset.

But you see, while this _looks_ like a specific argument, it's not as you've prefaced it with "unless SDCC can do." Which tells me you aren't sure. I'm not sure, either, because I am not well informed on either. But since you were the one saying, "Kiel wins with no question," I think you should be able to do better than say "unless" kinds of conditionals in your later specifics.

What exactly are you aware of?

Keil's static stack analysis is so old, concept-wise, that I can't recall when I first heard about it -- I think 20 years back. Maybe more. It was around the time when I purchased by copy of the 2nd "Dragon book" though -- so 1986ish or so? That method is flummoxed by recursion and re-entrancy and in embedded use must be carefully understood. But it is effective on processors like the 8031 core, granted.

Why would you be surprised if SDCC has some means? Patent? Or?

In any case, the real question is if you know, for sure. Do you?

You pull out strawmen like they were candy. I never mentioned that issue, nor did the OP. The OP apparently wants to get better with c programming. I've done a few simple things on both Keil and SDCC, just recently, and didn't find the use of either of them conflicting with my experience using c since 1978. In other words, I felt comfortable with both. As a matter of doing what the OP was talking about, this really is just non sequitur.

However, once again you don't speak with words saying you know, but instead to merely hint. Which makes me wonder just how much time you've actually spent with SDCC, of late. I can't speak with any authority, because I frankly have no idea at all. But again, you were the one speaking with absolute authority that "Kiel wins with no question."

So I'd like specifics born of specific experiences by you which allow you to make such pronouncements. Even to someone just trying to learn some c.

I'm still waiting.

I can't speak to the legality of anything. I'm pretty ignorant, those ways. But I tend to _also_ ignore companies making broad, sweeping statements about their own rights, as well. They have motive and marketing folks aren't usually the best source for getting your facts.

But in reading your above words more closely, I see that your last sentence seems to imply that the very instructions themselves are a violation. I'm sure you didn't mean to imply that. In any case, the instructions are found in AP198 from SiLabs under section 7.3 found on page 3. I gather that since this comes from SiLabs, along with a whole section on using SDCC, that you feel that SiLabs has breached eval licenses and copyright. If so, let them know.

Well, I'm going to take from the above that you really don't know what SDCC does and doesn't do. Which weakens, not strengthens, your comment. I don't know any better, myself, and it may be that there are some good points to be made here. Unfortunately, it appears that you aren't the one to make them, since it appears you aren't informed about SDCC's details.

I'm frankly interested, so I'm going to spend a few weeks looking into the details. I'm pretty experienced with 8031 instructions, as my very first hardware project was based on an 80C31 and I did everything in assembly code at the time (1982) and I've used 8031's for the odd project since. I haven't ever used either Keil or SDCC for project development -- merely a few test programs recently just to verify that I could flip an LED around a little with either of them -- so I come at this without any initial biasing experiences. And I'm very familiar with the architecture and assembly coding, so I can examine outputs with some chance at understanding them.

In the meantime, you would save me time if you could provide specific details you are already aware of -- allowing me to simply verify those instead of having to discover them on my own. I'd appreciate that, rather than hand-waving towards something you aren't sure about. If you know of any.

Jon

-- An equal right to an opinion isn't a right to an equal opinion.

Reply to
Jon Kirwan

Just try both and you will see the results. I don't have the time.

Not at all

Might but you are more likely to run out of Data space first.

I am aware of what Keil can do and unless SDCC has had a total re-design and rewrite it will not be able to match Keil

Large amounts of inside information Keil gets from the silicon companies

I know what Keil does and no one has ever shown any evidence that SDCC has got better than "flaky" other than some people say it has Improved...

If you know any FACTS then say so...

Quite so. However I know Keil is a C compiler is SDCC? Before you say "yes" what proof do you have?

Fine.

None. Why would I? I have access to better tools

Because I have seen what Keil can do and know how it is tested and that the 8051 is not a single system but about 40 different cores that have spawned 600 off different parts.

Keil has about 80% of the market and is used professionally. It is a very advanced system that will support 99% of the worlds 8051 family. Knowing the complexity involved and comments on what SDCC will not do and no one has said any different how will you show that it is the equal or even approaching the Keil benchmark?

Me too... you sa SDCC is OK but have nothing to back it up with,.

You are not speaking about anything... You can not even given any evidence about SDCC and what if anything it can do or its provenance.

Who did that?

Who is in marketing and which marketing people did they get there facts from?

You are very good at smoke and mirrors with no substance.

I didn't you misunderstand. You seem superficial are you in marketing?

I didn't say that.. Good at twisting things.. Are you sure you are not in marketing?

Yes it does not stop you .

I do know what Keil can do and I do know what an older version of SDCC can do,. SO unless it has had a complete redesign and rewrite it can not match Keil

And as you don't seem to have a clue about either what are you going on about. I do knwo the Keil very well and some ofther 8051 compilers and an older version of SDCC..

I also know about compiler validation and testing from an engineering not marketing standpoint.

Good.

Yet you babble on here with lots of huff and puff but no facts.

Try some of the benchmarks on the keil web site... These are the wetstones, drhystones, sieves etc and some others.

The usual problem I have found is the support for 8051 parts. As I mentioned there is a lot more to it than meets the eye. SDCC may be ok for the "standard" 51 types but it will start to fall over on the extended or expanded ones and things like code banking.

Actually the Keil C51 compiler is in it's third incarnation because of the support for the extended memory types, extended SFR' and additional and extended memory types.

After that due to the very aggressive optimisation especially in the data areas which certainly older versions of SDCC could not match there are many programs with lots of variables that the 2K limit free Keil could compiler and run that the unlimited SDCC could not as it ran out of data space.

So unless there has been a complete redesign and re-write of SDCC inthe last couple of years it is not going to match Keil for performance. Also unless someone has run Plum-Hall or Perennial over it you have no real idea if it is even a C compiler as far as syntax and symantics

BTW is that ISO 9899:1990 or ISO8999:1999 that it claims to support?

BTW having looked at your web site I think we do agree on the Iraq war at least :-)

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

Thanks for that last comment.

...

I think I'll let your post stand, as it is, without further comment. It really doesn't need any.

I will still spend some time doing some analysis. My interest has been piqued. If I find anything useful, I'll write about it.

Jon

Reply to
Jon Kirwan

Just to summarize, though, Chris.

It was you who first remarked negatively at SDCC and then only after challeged admitted that it has improved greatly to what you said was "reasonable." I have never indicated knowledge except that I knew that SDCC had improved a great deal.

But you are in a position where you not only _should_ know what you are talking about, but where I would otherwise want to imagine you care about the weight others grant your own opinion. Apparently not. It's sad to see an "I don't have the time" response. Were I in your shoes, I couldn't hold my head up after that. I'm going to take some time and it matters little to me either way. Come on, Chris, it's your own business to know, for gosh sake. I can only conclude you value your own opinions rather poorly.

I do value mine and in spite of the fact that I've nothing to sell here and no gain either way, the fact that I care about what I say is part of why I think it is worth a little effort to see for myself. And I will report back about it. It's going to be interesting to see, no matter how it pans out.

You just surprise me, sometimes.

Jon

Reply to
Jon Kirwan

... snip about 170 lines, before and after ...

Yet you have the time to emit the above 170 lines of snippage? There appears to be some sort of contradiction here.

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
            Try the download section.
Reply to
CBFalconer

... snip ...

Where does K&R ever mention INTs? The point, for minita, is that K&R (The C Programming Language) covers the basic C language, as specified by the C standard, in much simpler language than that the standard contains. It is a classic, and accurate.

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
            Try the download section.
Reply to
CBFalconer

In message , Jon Kirwan writes

No. I said others have said it has improved to "reasonable" The last one I looked at was not.

Not at all. I do not have time to look at this. I use various compilers and over the years have found that the Keil 2K limited compiler can compiler many programs that "unlimited" compilers can not because they can not do the optimisations in data and do not understand the 8051 other than the basic tools

I do not have time to prove whether every home made and untested compiler is up to the mark. If others want to put forward such a compiler they should have the evidence to show that it is good enough.

Please do. It will be an interesting project for you.

No. I know how good the Keil is. There are also benchmarks for it and the information on the testing it does. Is this available for SDCC?

I have asked if SDCC can do certain things and the answer from you who are advocating it is "I don't know" . What I do know is that it could not do them a while back and it will need a complete redesign and rewrite to do them. AFAIK (and no one has said any different) this has not happened so the compile is not on the same level as the Keil to start with,.

BTW does the SDCC now have a compiled stack?

Sorry but I do not have time to do a comparison between Keil and a compiler that even it's advocates say is "flaky" and has now improved to "reasonable". There are only so many hours in the day.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.