Want a getting start guide

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
i got an assignment of building an application running on a microcontroller. i
used to do Linux and Windows programming for years but has no experience of
doing this kind of jobs. there will be no operating system for use, only a
C/C++ compiler along with a runtime libary. i believe i need to communicate
with some peripherals, need talking with a timer, and i also think i need to
handle interrupts. but i by far have not get a big picture to start.

is there any help i can got from the net? where to find information? the
tutorial on the 'http://www.learn-c.com /' seems good at first glance, but i
quickly found it does use operating system which i consider as not suit to me.

thanks in advance.


--
steven woody (id: narke)


Re: Want a getting start guide
On Sun, 16 Oct 2005 00:15:24 +0800, in comp.arch.embedded Steven Woody

Quoted text here. Click to load it
see
or
http://www.google.es/search?q=beginners+embedded&hl=en&hs=GvT&lr=lang_en&client=firefox-a&rls=org.mozilla:en-GB:official&start10%&sa=N
or atmel.com and search for butterfly



martin

Re: Want a getting start guide

Quoted text here. Click to load it

Try your library for something like this book:-

  "Microcomputer Design and Construction" by Alan Clements. It is a good
basic guide book which will explain the hardware details reasonably easily.
There are lots more including most of the Leventhal series of books on
assembly language for most of the microprocessor families.

As to web based resources, Jack Ganssle's web-site
<http://www.ganssle.com/ has lots of good articles but may be considered
to cover the design/development quality and integrity angles. You may also
find
<http://mic.unn.ac.uk/miclearning/modules/micros/ch10/micro10notes.html#10.1
useful too.

--
********************************************************************
We've slightly trimmed the long signature. Click to see the full one.
Re: Want a getting start guide

Quoted text here. Click to load it

there is a good pdf guide at the start of:
http://www.dontronics.com/auto.html

plus some other ideas.

Don...


--
Don McKenzie
E-Mail Contact Page:       http://www.e-dotcom.com/ecp.php?un=Dontronics

We've slightly trimmed the long signature. Click to see the full one.
Re: Want a getting start guide
Not a resource recommendation, but a few words of advice from someone
who has been in your shoes:

In my opinion, one of the biggest obstacle blocks that people used to
developing software for a PC have when attempting to design for an
embedded controller is comprehending and dealing with the low level
tasks that the operating system took care of for you that you must
implement yourself on an embedded controller.

For example, in an embedded application, there is generally no standard
input (keyboad) or standard output (video display) device at your
disposal.  Instead, it is often necessary to write 'drivers' to deal
with the raw IO and frequently these drivers involve handling of
interrupts, which are software routines that get called (semi)
automatically in response to hardware events, such as a change in
status of an input pin.  This means that functions like printf() and
scanf() may be complex to implement as opposed to being basic functions
you build from.

Another area that tends to be quite different from PC programming is
the hands on use of the linker.  In all of the PC applications I have
worked on, the linker was simply a program that ran when the
application was built.  In microcontroller applications, it is usually
necessary to create a custom linker command file (similar to your make
file) but this file spells out exactly what sections of the system are
ROM and RAM and what is allowed to go into each section.


One area of similiarity between the two is that standard library
functions, are frequently provided by the runtime library, such as
memcpy(), malloc(), and the math functions.  You will need to become
familiar with the compiler manual to see what functions are provided as
it may not be as many as you are used to.


I would sugest that you start slow, and if the tool set you are using
has a simple demo program that you can get to run: start there, even if
it is something as simple as declaring a couple of variables and adding
them.  Once you are comfortable with that, you can start to experiement
with the functions provided by the run time library and working with
the low level IO by doing something such as making an IO pin toggle and
watching it on a scope.  Also look at the .map file and search it for
your variables and function names.  This will help you get comfortable
with the idea of where things are going in memory and the linker
operation.  Lastly, examine the compiler output by generating and
looking at a listing file.  This will help you to become better
aquainted with how the compiler translates the C code into the assembly
language of the processor you are dealing with (which also is a must
learn).

In the end, you will probably be surprised at how quickly you become
comfortable with the microcontroller application and how much
similarity there is to PC development.


Re: Want a getting start guide
In addition to all of the above, I would suggest one more thing. Get a
reference manual (or a simplified version like a programming manual)
for the microcontroller and study it thoroughfully. It will be VERY
hard to understand at first, especially that you have no experience
working with embedded systems but trust me it will be well worth it.
The main goal is to understand the organization of the internal
archtecture, which you will definitely need for even the simpliest
tasks. For example, if you need to use timers, you will need to know
how is the timer subsystem organized. Which registers you should write
to and which flags would get set/interrupts fired when a timer event
occurs and what is the standard procedure to handle them. Get used to
the fact that even though you are going to be programming in C/C++, you
will still need to reference many registers directly. Most of the time
they are mapped to memory addresses but can be referenced by name if
you have proper definition file (which usually comes along with the
microcontroller/software).
I would recommend to start with the basics, if the time permits. Get
your development board, plug in a keypad if available, flash some LEDs,
play around with the timers, try to communicate over SCI/SPI. That
should give you a pretty good feel of what you are dealing with.

Best of luck
- Mike


Re: Want a getting start guide

Quoted text here. Click to load it

It would be nice if something like Lance Leventhal books on programming
various processors were available for the more recent processors. I don't
suppose the good doctor continued the series beyond the four most popular
devices (I did look via Google but he seems more into Server blades these
days).

Quoted text here. Click to load it

The rest is moderately good advice.


--
********************************************************************
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline