hello hey can any one please provide me a complete program ( in "C") of sending a SMS from a GSM modem to an 8051 microcontrolleer. for example: I want to turn on a light with the help of 8051 using an SMS. If possible also provide me the circuit diagram of interfacing between GSm modem and 8051. PLz help meee
Thank you...
actually im familiar with assembly language programming but our boss needs a C prog
no offence, but I simply don't believe you.
I believe him. I went from being a pure electronics guy to embedded systems using 'binary' as my first 'language' (1802 and then the IMSAI 8080).
I tired of doing the hand-assembly into binary patterns, and got an assembler (for the 8080 & Z80, and still have my Lance Leventhal book on Assembly Language), and then when Intel came out with the CMOS 80C51, I 'decided' (a funny story there) to learn "C."
Generally, us 'old' guys learned it (programming) from the transistor up, as opposed to some of these 'noobs' and "Computer Science" guys who have the luxury of learning this mid-level language in a classroom setting with all of 'our' hard earned lessons learned back in the day. Note: I had co-workers and friends who were in the original ANSI groups trying to develop an official "ANSI C." (Honestly, these guys were indeed geniuses--I was lucky to learn from them).
Andy is 100% right (as usual). Mr "maulik mehta" (OP) has a situation where his boss has choices. As long as the OP didn't claim "C" knowledge, or commit to having a 'C' version so soon, then his boss has the problem, and not him.
At this point, the only real way to help him out is to two things:
1) re-iterate Andy's post and tell Mr. OP to inform his boss of those choices as Andy describes, and 2) direct him to a search site like
www.google.com/codesearch
or possibly go to
http://www.8052.com
and search their 'free' code.
A bit of warning on that, you'll have to be capable of getting through some rudimentary "Blinky" code on the Keil platform, like Per Westermark said, and shoe-horn in what you may have acquired in your search efforts.
Then tell your boss to expect it to fail the Dog-and-Pony show in early Feb.
You'll also need to revisit your Project Plan and identify where you and your boss failed to account for your in-house capabilities and what you committed to doing.
Miller's Law: "Resist All Temptation to Increase Expectation" (Mr. Miller is an old mentor of mine, and one of those 'genius' people).
--Cpt. Vince Foster 2nd Cannon Place Fort Marcy Park, VA
The trouble is: even if he finds free (or even non-free) 'C' code, what is he going to do with it if he doesn't understand 'C'?!
To re-state the choices in a slightly different form, they are:
1. Buy it; 2. Revise the timescale to allow for the 'C' learning curve; 3. Revise the requirements and do it in Assembler.
But the interesting thing is still: - you can learn to read and understand C in just days. - you can spend years perfecting the C skills, and still not produce truly beautiful (and of course also well-working) code.
Someone who know assembler will know about the hardware that C will have to map agains, so such a person will have an easy time seeing all SFR writes when the C code initializes a serial port or a timer. And knowing assembler, it will be quite obvious what an ISR does (even if an __interrupt keyword hides the prologue/epologue the assembler code would have needed).
Since it is easy to learn to read C, it should also be easy to learn how to cut/paste existing blocks into a larger program. Problems will happens first when multiple code blocks needs to be run semi-concurrently with a limited set of processor resources available. Such things takes skill and careful design work - and that careful design work requires true knowledge of the language, and not just reading skills.
But since a large part of all embedded systems do not require hard real-time, and do not need the processor to run at very high utilization levels, most developers manages to get by even if they are lousy embedded deverlopers, or only have limited knowledge of the language they are using or the target processor. Really bad things starts to happen when the boss assumes that just because product A and B did seem to work, he must be the manager of a competent team, and then activates project C, where the complexities are high, or where the hardware is only marginally capable of fulfilling the task (remember that it takes a skilled embedded developer to make a qualified guess about how high the utilization will be of the finished product while still on the planning stages).
So in the end: If this is a critical product, then it is better to buy competence. If the company can live with the learning time (if you know n languages, then the n+1th language is normally very easy to learn, but the first one is almost always a true pain to learn) to get own developers capable of writing applications of acceptable quality and capacity, then it is better to say that you need more time, and then start a very accelerated learning cycle.
In neither case is "give me code" a working solution. Working code is only working if you know exactly what it does, and more importantly: why it does it. That requires that you can read the language, and that you can translate from the source code and back into the datasheets and verify line-by-line exactly what the code does, and how the code matches the datasheet requirements.
I certainly don't think that the OP will be able to learn C, get Blinky running and incorporate his "internet code" in time for an early Feb showing. Hence my "expect it to fail" comment.
Who has ever used code from the internet without knowing how it does what it does? Oh, that's right: students (and the guy that did my TV cable box).
Andy's re-list is apt, while Per's is the safest course of action: "If this is a critical product, then it is better to buy competence."
"...post the most f%@!#d up posts..." So, Per opened a can of sardines on "Master Zeusti"? -- Much enjoyed.
At the risk of having this being taken the wrong way, I feel this has to be said:
Is there a way for you people to make some of these comments sticky on this forum.
I come here occasionally to see what's been occuring and so frequently see almost the same comments being made by the same people.
Only if it's basically similar to the other n languages.
I get the impression that Assembler is the OP's only language; moving to a high-level language - any HLL - is quite a large step. But, thereafter, learning another HLL will be much easier...
As you say, knowing assembler will be some help - but not as much as knowing another HLL.
I don't consider assembler a programming language. To me, it is just a set of mnemonics.
So, in this case C is most probably the first language. And the first language normally takes a lot of time to learn and understand. Especially pointers, arrays, and the importance of evaluation order.
When you do know n languages, where n is starting to get big, then even "strange" languages will have pieces that are similar with the already known languages. The first functional language will feel strange, but the second or third will just be different writings of known concepts.
In this case, the big value with knowing assembler is that it helps with pointers, and it helps with understanding what SFR are and what makes a processor tick. Knowledge of assembler also allows the user to realize why a trivial C source line may expand into a large number of assembler instructions, or into function calls to helper functions. It is so easy to think that a source code line that looks trivial really is trivial for the processor. There should be a law that every programmer has to implement a division routine in assembler - especially since all that code represents a single little forward slash character in the HLL.
Trevor: Yes, sticky threads would be nice. But we are just end users, so we would not be allowed to edit them, or make them sticky.
Keil already have their own way to handle common questions. They have a number of FAQ pages that contains links to one or more forum threads that does cover the specific question. But it requires the users to use the search function, and a lot of Keil visitors have a policy that search engines must not be used.
Which, of course, also defeats the object of "Sticky" threads...
:-(
One thing that would be useful, though, is an easy way to get a link to an individual post - rather than just entire threads...
uk.youtube.com/watch
Note: I had co-workers and friends who were in the original ANSI groups trying to develop an official "ANSI C." (Honestly, these guys were indeed geniuses--I was lucky to learn from them).
I envy you!
No, I envied them! (2x, but one in particular...)
WARNING: Another Off-Topic Rambling:
While I was over at this kid's house using one of his 'other' computers as he was logged onto that pre-ANSI chat thing (BBS, or whatever it was). I wrote a "C" program to parse a source file, extract what I needed and write the results to another file:
C:>parse source.c results.x
I was so proud of it and its direct simplicity: it was only two screens worth of code. I showed the kid, and he told me it was 'nice' and would work just fine. Then he asked my why I just didn't do this... and in one line of code, he wrote the exact same thing:
int main( argc, argv ) int argc, char **argv; { ONE_LINE_OF_CODE; }
Then he went back to discuss some esoteric "C" thing on his blazingly fast behemoth UNIX system.
I sat there and thought about the word 'envy.' On one hand, I hated him for being way smarter than me (I had 'ego troubles' back then too), on the other hand, he was my friend and I was proud of him and proud to be in his presence.
Yes, he was a kid. Living with his mother, and didn't even have a drivers license yet. He was fluent in seven (7) spoken languages, skipped High School altogether and had finished most of his undergrad at the local college before I knew him. (He was 'smuggled' into the country after an amazing trek across the globe. He then attended 2 days of High School, walked over to the college, signed up after he was interviewed by their admissions staff--I'm sure they were stunned). He and his mother were relatively 'poor' and lived in a small house in the 'bad side of town.'
He and I worked at the same place (dealing with IEEE 696 systems--lol) so that is how I met him.
He was the true hacker. He liked cracking codes and had used his UNIX system in questionable ways. AT&T busted him while I knew him, and the deal they struck was that they wouldn't press charges if they could use his computer between 8PM and 8AM every day for some kind of node transfers they needed.
He and I had the same chemistry professor. He told me about how that professor thought he cheated on a lab assignment. The professor was sure of it since the class was given the wrong molarity of a solution and this kid had the only correct answer; whereas the whole class had the common error. This kid explained that he did the lab assignment at home, so the professor showed up at his house to inspect his tall story. When this kid told me this story, I also disbelieved it as for this particular experiment, one would need a full lab.
The kid showed me what he showed the professor: his garage. A full chemistry lab was in there! I'm sure he earned the money via his talents. (A few years later, he was contracted out to the CDC to help do some research on AIDS)
Again, I was over at his house one day to ask him for help on purchasing an X-Y monitor for a circuit I had. Another friend of his dropped by... a burned out middle-aged 'crazy' guy. This guy started arguing about how my circuit would not work with any X-Y monitor. He used copious quantities electronics jargon that made no sense to me (and it didn't make any sense---and my circuit did work ...as is).
I eventually asked this guy what he did for a living, and he explained how he was unemployed (go figure) ...but he used to work for Intel. He had some personal grudge against them: I'll bet they thought he was unstable. I asked exactly what he did for Intel. He said he designed the internal FIFO architecture for their 8080 CPU. I looked at the kid for verification, and the kid nodded that it was true.
I think I was the kid's retarded charity-case friend.
I've worked with other geniuses over the years (real ones who are 'famous' within the aerospace and R&D military world), but this kid was over the top. And no, he had no flaws or holes in his education or personality: from automotive repairs to sports, to mathematics to bio-science, to women, to you-name-it, this kid had it all... including a hot, very rich, and semi-celebrity girlfriend. Aaarrgggh!
I lost track of him before he was legally able to drink alcohol. Last year he sent me a Linkedin invite, but I have yet to respond. If you're out there reading this, I'll get around to it. But, I'm sure he's not... he would have written his own ARM compiler & IDE suite... and the odds of him reading this forum for 'advice' is just plain funny--no offense, as I read this forum: you know, the rambling retarded friend).
Tamir: 'envy' ...you have no idea.
Vince, Thanks for this very inspiring story. If I compare this guy to the semi-mediocrity of my previous employer's workers (that would be an understatement. Somebody there was shocked to learn the I am very capable of making my own program from scratch. These are the people who actually have lives in there incapable hands...) I have to think - some of us are luckier than others! particularity the guy in question, with that hot babe hanging over his arm...