beginner and 8051

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.

Reply to
David Brown
Loading thread data ...

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
Reply to
Tim Wescott

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.