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?
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
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.
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
Yes to the portable bit. You can write very structured C that is 8051 specific.
It will be good 8051 C very fast and efficient.
usually irrelevant.
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 \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
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?
No they all have the same 'core' with variations in additional bits. The other posters misunderstood, they did not realise the AT89S... is just another 8051 MCU.
You keep going with assembler. It will give you an excellent grounding in the nuts and bolts of embedded systems. IMHO it is essential to understand this first before using any HLL.
Just another thought. Pop along to 8052.com and sign up for the message board. There are a whole bunch of 8051 users on there happy to give you a helping hand. Also lots of good tutorial material.
jtag is usefull, because you test using the real silicon, in the real world. In any interaction with peripherals/pins, that can be vitally important :)
Simulators are good with the opcodes/core, but struggle with the peripherals.
You can certainly learn a lot with a simulator.
I'd suggest starting with the SiLabs ToolStick, ~$10, which has a small uC inside, and a USB Debug/Pgm link. Gives the best of both worlds : Cheap, but uses real silicon :)
If you move up in their families, the C8051F41x is the newest. This has 12bit ADC/DAC, and an on chip from-5V regulator, so can drive power mosfets directly.
Atmel's newest AT89LP series members, have on-chip-debug, and Atmel's debug solution is comming.
Whoops -- I saw the 'ats', thought "Atmel" and jumped straight to "AVR", forgetting their fine line of 8051 compatible systems.
Yes, if it's an 8051 core the assembly should port just fine, within the limitations of the peripherals.
--
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
yea -- see the part about assuming AVR when I saw Atmel...
There is a gain to writing portable code -- if it's going to be ported, that is. And if you're writing code for a low production rate the economies of engineering cost vs. per-piece cost will lean heavily in favor of bigger faster processors if it eases the software engineering time.
--
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
Atmel and Phillips have parts with a built in serial boot loader. Connect them to +5 and a MAX232 chip and you are done. The PC software is available from their web sites.
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.