beginner and 8051

May 31, 2006 21 Replies

If you are wanting to learn about embedded programming and small micros, work first in assembly, writing small programs. It will give you a much clearer idea of what's going on inside the chip, and when you later progress to bigger programs and C, you will understand what the compiler is doing, and be able to write much better C.

When moving code between two devices with the same core, the main difference is the peripherals. Make sure your program is well structured, with direct access to the peripherals only in clearly limited sections of the code. That way you have a minimum amount to change when you move devices.

If you _really_ want to make the move easy make the peripheral interface code into function calls or macros and put them into a different file, then rewrite just that file when you go to use a different processor. If you have a consistent interface to your peripheral driver code you should be able to develop code for two different processors simultaneously, switching back and forth at will.

Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required