EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

beginner and 8051

Started by Unknown May 31, 2006
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.

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. >
Should you write your application in assembly language you will find that you have to rewrite every line to port to another processor. Should you choose a higher level language like C and are careful to write portable code then yes. I highly recommend Harbison and Steel's "C: A Reference Manual" for pointers on portable code. Unfortunately, well-structured portable C code is a terrible fit for the 8051 instruction set. Your code will be bigger and slower than it would be if you fit your C code to match the processor -- but if you fit your C code to the 8051 then it'll be nasty stuff, and not terribly portable. If you can afford the extra memory and slow operation that comes with good C on an 8051 it's the way to go, however. -- 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
Tim Wescott wrote:
> Should you write your application in assembly language you will find > that you have to rewrite every line to port to another processor.
I'm going to study assembler. I thought that's what " having same 8051 core" is all about. so, do they all have different assembler instructions? and even if I create small app which uses only 1 I/O port and timer - I'll not be able to move it to another mcu without a lot of changes? thanks. Tim Wescott 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. > > > Should you write your application in assembly language you will find > that you have to rewrite every line to port to another processor. > > Should you choose a higher level language like C and are careful to > write portable code then yes. I highly recommend Harbison and Steel's > "C: A Reference Manual" for pointers on portable code. Unfortunately, > well-structured portable C code is a terrible fit for the 8051 > instruction set. Your code will be bigger and slower than it would be > if you fit your C code to match the processor -- but if you fit your C > code to the 8051 then it'll be nasty stuff, and not terribly portable. > > If you can afford the extra memory and slow operation that comes with > good C on an 8051 it's the way to go, however. > > -- > > 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
On 31 May 2006 08:28:44 -0700, "noemail12000@yahoo.com"
<noemail12000@yahoo.com> wrote:

>Tim Wescott wrote: >> Should you write your application in assembly language you will find >> that you have to rewrite every line to port to another processor. > > I'm going to study assembler. >I thought that's what " having same 8051 core" is all about. so, do >they all have different assembler instructions? and even if I create >small app which uses only 1 I/O port and timer - I'll not be able to >move it to another mcu without a lot of changes?
If you stick to the architectural features that are part of the common set then yes, your code should be portable. Recommend that you download a few of the device manuals from the major vendors to see what is the same and what is different among them. -- Rich Webb Norfolk, VA
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. >
an alternative is start with an at89s52 or similar atmel parts is available a almost-0 component programmer ( trough the PC parallel port ) so you can start with a home built proptotype board. there are lot of hardware/software project on 8051 available on the net. with an at98s5x an old static ram an a 74hc373 o 74hc573 a 74hc00 and a max232 you can build a system that is able to receive code trough the serial port write in the ram and execute from there. BTW the controller must be preprogrammed with one of the monitor available on the net
In article <AZGdnXIXlckbM-DZnZ2dnUVZ_umdnZ2d@web-ster.com>, Tim Wescott
<tim@seemywebsite.com> writes
>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. >> >Should you write your application in assembly language you will find >that you have to rewrite every line to port to another processor. > >Should you choose a higher level language like C
yes.
>and are careful to >write portable code then
No. Portable code is rarely needed.
>yes. I highly recommend Harbison and Steel's >"C: A Reference Manual" for pointers on portable code.
Good book.
> Unfortunately, >well-structured portable C code is a terrible fit for the 8051 >instruction set.
Yes to the portable bit. You can write very structured C that is 8051 specific.
> Your code will be bigger and slower than it would be >if you fit your C code to match the processor -- but if you fit your C >code to the 8051 then it'll be nasty stuff,
It will be good 8051 C very fast and efficient.
>and not terribly portable.
usually irrelevant.
>If you can afford the extra memory and slow operation that comes with >good C on an 8051 it's the way to go, however.
It will increase the unit cost of your product for no appreciable gain. If I found someone writing portable code in that situation I would probably fire them. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1149089324.497895.14980@h76g2000cwa.googlegroups.com>,
noemail12000@yahoo.com <noemail12000@yahoo.com> writes
>Tim Wescott wrote: >> Should you write your application in assembly language you will find >> that you have to rewrite every line to port to another processor. > > I'm going to study assembler.
OK.
>I thought that's what " having same 8051 core" is all about.
not exactly.
>so, do >they all have different assembler instructions?
No. Some have additional instructions for extended memory and some odd peripherals but 95% are the same.
>and even if I create >small app which uses only 1 I/O port and timer - I'll not be able to >move it to another mcu without a lot of changes?
Most 8051 code is completely portable. The basic ports and peripherals are the same on al of them as are the first 5 interrupts. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
actually, I was thinking about at89s. the only reason I asked about
silab is their development board with jtag for about 70$.
but, how usefull jtag is? can I get the same result with software
simulator?


mmm 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. > > > > an alternative is start with an at89s52 or similar atmel parts is > available a almost-0 component programmer ( trough the PC parallel port > ) so you can start with a home built proptotype board. > > there are lot of hardware/software project on 8051 available on the net. > > with an at98s5x an old static ram an a 74hc373 o 74hc573 a 74hc00 and a > max232 you can build a system that is able to receive code trough the > serial port write in the ram and execute from there. > > BTW the controller must be preprogrammed with one of the monitor > available on the net
Chris Hills wrote:
> In article <1149089324.497895.14980@h76g2000cwa.googlegroups.com>, > noemail12000@yahoo.com <noemail12000@yahoo.com> writes > >Tim Wescott wrote: > >> Should you write your application in assembly language you will find > >> that you have to rewrite every line to port to another processor. > > > > I'm going to study assembler. > > OK. > > >I thought that's what " having same 8051 core" is all about. > > not exactly. > > >so, do > >they all have different assembler instructions? > > No. Some have additional instructions for extended memory and some odd > peripherals but 95% are the same. > > >and even if I create > >small app which uses only 1 I/O port and timer - I'll not be able to > >move it to another mcu without a lot of changes? > > Most 8051 code is completely portable. The basic ports and peripherals > are the same on al of them as are the first 5 interrupts.
OK. that's what I thought.
> \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ > \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ > /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ > \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1149092718.013127.315400@y43g2000cwc.googlegroups.com>,
noemail12000@yahoo.com <noemail12000@yahoo.com> writes
>actually, I was thinking about at89s. the only reason I asked about >silab is their development board with jtag for about 70$. >but, how usefull jtag is? can I get the same result with software >simulator?
There are various simple serial programers you can make for the Atmel 51's
> > >mmm 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. >> > >> >> an alternative is start with an at89s52 or similar atmel parts is >> available a almost-0 component programmer ( trough the PC parallel port >> ) so you can start with a home built proptotype board. >> >> there are lot of hardware/software project on 8051 available on the net. >> >> with an at98s5x an old static ram an a 74hc373 o 74hc573 a 74hc00 and a >> max232 you can build a system that is able to receive code trough the >> serial port write in the ram and execute from there. >> >> BTW the controller must be preprogrammed with one of the monitor >> available on the net >
-- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

The 2024 Embedded Online Conference