EmbeddedRelated.com
Forums

beginner and 8051

Started by Unknown May 31, 2006
noemail12000@yahoo.com wrote:
> Hi All, > I'm a beginner and I'd like to start from 8051 . as I can see-the only > cheap boards with jtag are from silabs, right? there are a few of them > for about 70$ , which one should I buy? > will I be able easily move my code to other 8051 mcu like ats89s? > > thanks. >
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.
David Brown wrote:

> noemail12000@yahoo.com wrote: > >> Hi All, >> I'm a beginner and I'd like to start from 8051 . as I can see-the only >> cheap boards with jtag are from silabs, right? there are a few of them >> for about 70$ , which one should I buy? >> will I be able easily move my code to other 8051 mcu like ats89s? >> >> thanks. >> > > 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