Dear All I have to build an application that uses LM3S8962 Microcontroller from Texas Instruments to control the speed and direction of dc motor. As i am new to microcontroller programming and is much confused as how to start. Could anyone please tell how can i start to write the program. Also please tell will i have to study the technical manual and assembly language instructions of the microcontroller. Can i get their C equivalent commands and functions etc. I will really appreciate your suggestions. The requirement is urgent.
Why do you have to? Is it a school assignment?
"i am new to microcontroller programming"
Do you have any experience in any other kind of programming?
"is much confused as how to start"
What study have you done in preparation for this task?
Here's some books: http://www.keil.com/books
Texas Instruments also have a whole load of stuff on their site...
"how can i start to write the program"
Before you start to write any program, you need to know - in detail - what that program has to do. Design first; code later!
"will i have to study the technical manual"
Yes, of course!
"and assembly language instructions of the microcontroller"
Not necessarily - you can probably do most (if not all) of it in 'C'
"Can i get their C equivalent commands and functions etc"
That is the wrong way to think!
"The requirement is urgent"
Is it?
Dear Sir This is an industrial application project. Actually i have to interface the controller to DC motor and the speed and direction of the motor is to be controlled by using an optical encoder. I will have to read the output of the encoder and accordingly set the Pulse width of PWM controller. This module also needs to be controlled remotely via TCP/IP Interface and then i should be able to do the same fuctions remotely. The problem is that: as there are plenty of literature available on TI site, so i am confused from where to start. so could u just give me the guidelines as how to start the things. i have knowledge of C/C++ but i m confused how to transform assembly language instructions to C language commands.So could you just give me an example .... say i have to registers R0 and R1, and i want to add the contents of these two registers. if the assembly language command to add is ADD R0,R1... what will be the coressponding C command of it.....
Thanks for your earlier response... Jaiprakash Chauhan
No C programmer would ever ask of the corresponding C code to add two numbers. That is like a person with a driving license asking if they should steer the car with the wheel or with the gear shifter.
If you have found any DSP algorithm coded in assembly, it might be meaningful to discus that specific code sequence. What it actually does. But a C programmer don't need to ask how to perform something as trivial as to add two numbers together. And a C programmer would know that a C program would normally not need any access to any registers, since the compiler will supply the mapping from C variables into processor registers.
Back to the drawing board, and try to reformulate exactly where you are stuck and what you _need_ help with.
But what experience do you have in using them?
"i m confused how to transform assembly language instructions to C language commands"
Why would you want to do that?
You say you "have knowledge of C/C++" - but have you ever used them to write programs? If you have, did you start with assembler and work backwards to C/C++ source code??
"This is an industrial application project"
Then invest in some proper training! Or hire a suitably-skilled employee. Or get a consultultant in...
i have knowledge of C/C++ but i m confused how to transform assembly language instructions to C language commands.
As so many PC types before, you see "embedded software" as "any software" IT IS NOT.
In (small) embedded you talk directly to the hardware and if you do not have (at least a basic) understanding of assembly you will be lost. I/O does not 'speak' in abstraction it 'speaks' in absolutes.
Erik
Doesn't seem to be the case here - why would even a PC programmer want to be working backwards from assembler to 'C'??
Doesn't seem to be the case here - why would even a PC programmer want to be working backwards from assembler to 'C'?? Why not when experienceing to culture shock of not having everything delivered on a silver platter. What would be the first question a Christmas tree salesman would ask when employed as a carpenter?
"What would be the first question a Christmas tree salesman would ask when employed as a carpenter?"
I have just received some very good delivery of material. You wan't me to make a christmas tree for you? I make them in any size from 30cm to 3 meters. I use biodegrateable glue, so the needles will stay for about 1-2 weeks - a bit more if you keep the lube moist.
eqauivalent to
"What would be the first question a PC coder would ask when employed as an embedded programmer?"
the answer to both: "who knows, but it will not be very relevant"