Want a getting start guide

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 '

formatting link
' 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)
Reply to
Steven Woody
Loading thread data ...

see Message-ID: or

formatting link
or atmel.com and search for butterfly

martin

Reply to
martin griffith

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 has lots of good articles but may be considered to cover the design/development quality and integrity angles. You may also find useful too.

--
********************************************************************
Paul E. Bennett ....................
 Click to see the full signature
Reply to
Paul E. Bennett

there is a good pdf guide at the start of:

formatting link

plus some other ideas.

Don...

--
Don McKenzie
E-Mail Contact Page:       http://www.e-dotcom.com/ecp.php?un=Dontronics
 Click to see the full signature
Reply to
Don McKenzie

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.

Reply to
Noway2

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

Reply to
dumike

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).

The rest is moderately good advice.

--
********************************************************************
Paul E. Bennett ....................
 Click to see the full signature
Reply to
Paul E. Bennett

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.