Author Topic: Is learning 8051 worthy nowdays.  (Read 16843 times)

0 Members and 1 Guest are viewing this topic.

Offline Muhammad Nasar

  • Contributor
  • Posts: 22
Is learning 8051 worthy nowdays.
« on: February 12, 2012, 05:50:44 pm »
I have started working with 8051 micro-controllers and i am also enjoying it a lot, but some of my class mates say that i should learn PIC or AVR instead, are they right? and  should i stop learning 8051 and pick up PIC or AVR.
 

Offline McMonster

  • Frequent Contributor
  • **
  • Posts: 417
  • Country: pl
    • McMonster's blog
Re: Is learning 8051 worthy nowdays.
« Reply #1 on: February 12, 2012, 07:15:30 pm »
8051s are quite old and mostly considered obesolete, I haven't seen a single hobby project on sites like Hack A Day for ages. AVRs and PICs are newer, more advanced, have more features and are widely available. They're also not complicated and easy to use.

If you don't do much electronics and simply enjoy 8051s then it won't hurt to continue using them, but learning more modern architectures is definitely worth spending some time.
 

Offline SajjadBro

  • Contributor
  • Posts: 18
Re: Is learning 8051 worthy nowdays.
« Reply #2 on: February 12, 2012, 09:04:07 pm »
8051 got a strong architecture with 256 instruction i think. PIC only got 35 instructions. 8051 is still in production i think so i wont say its obsolete. If you are willing to do Assembly the 8051 is much easier else switch to PIC. I have moved to PIC maybe because of PWM and ADC feature, rest i am learning and i will see what comes next, but I like PIC more than 8051.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3145
  • Country: us
Re: Is learning 8051 worthy nowdays.
« Reply #3 on: February 13, 2012, 12:30:00 am »
There are still a LOT of 8051-architecture CPUs around, and it is worthwhile (IMO) to learn about them, if only because of their historical significance.  The Architecture is a little old-fashioned compared to an AVR, but recent chips have single-cycle execution and internal flash memory, making them pretty competitive with most other 8-bit CPUs when it comes to performance and price.  For some reason, they don't seem to show up in many hobby projects any more (a lot of them stopped appearing in hobbyist-friendly packages.)

For sort-of obvious reasons, a lot of chip vendors who consider their actual expertise to be in peripherals rather than CPU design chose to throw an 8051 core onto their otherwise State-of-the-art peripheral chips.  So you see things like single-chip radios with cpu, mp3 decoder with cpu, CCD interface with cpu, advanced A-D converters, audio processors, USB hub controllers with CPU, and so on, all with 8051 cores for their CPU.

Modern 8051 vendors:

Atmel: single-cycle AT89LP series with up to 64k flash, standard 8051-architecture with ISP flash, small pin count DIPs down to 20pins.  CAN, USB, and "Lighting" CPUs.

Cypress: EZ-USB (an other USB microcontrollers) and PSOC-3 (Programmable System on a Chip.  CPU with a significant FPGA array on the same chip) are available with 8051 CPUs.

TI: single chip radios and USB peripherals with 8051.  eg CC1110Fx, TUSB3410

Silicon Labs: advanced analog peripherals, ultrasmall packages (QFN10, 2x2mm), low power.

Analog Devices: advanced analog.  Eg ADuc845 (w dual 24bit A-D converters!)

See also http://8052.com

 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 30887
  • Country: au
    • EEVblog
Re: Is learning 8051 worthy nowdays.
« Reply #4 on: February 13, 2012, 12:49:02 am »
In general, yes, they are right, but also wrong :D
The 8051 architecture is considered very old school, and few people in either hobby or industry, given a clean slate, would chose 8051 as an architecture these days.
The main reason it's still used is familiarly with people who have used it in the past.

So they are right in that it's not the preferred choice these days, and you should learn something like AVR or PIC as well. But they are wrong in not thinking it's worthwhile. Having 8051 experience on your resume might won't hurt, and might just very well score you that embedded job over someone else who just has PIC/AVR experience. 8051 experience can often give you some "street cred"  ;)

Dave.
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
Re: Is learning 8051 worthy nowdays.
« Reply #5 on: February 13, 2012, 02:21:54 am »
Consider learning a 32 (or 16) bit architecture as well.  There are quite a few cheap dev boards that have on board programming interface for PIC32, ARMs etc.

In my personal opinion, gone are the days of specializing in one architecture.  I would focus on getting your embedded C programming skills polished whatever architecture you're using, and learning the general boundaries that 8/16/32 bit processors will limit you to.  That way you should (depending on how badly the manufacturer has documented things  :() be able to pick up almost any modern architecture with a C compiler and write some decent code.
 

Offline Tony R

  • Regular Contributor
  • *
  • Posts: 117
  • Country: 00
Re: Is learning 8051 worthy nowdays.
« Reply #6 on: February 13, 2012, 03:47:53 am »
Personally I do love the 8051. It was the first micro I ever programed in assembly.

One major advantage is it is old, and being old means most of the bugs have been found, fixed and or documented. Now it is not cutting edge, and you may not want to do any heavy DSP work on it, but it is great for simple applications that do not require much ram.

I love the 8 GP registers, plus the multiple GP register pages makes subroutine calls easy so you don't overwrite registers.

Anyways the 8051 is not gone yet. and it is worth reading. Are you going to want to do any new designs with it? Probably not. but lets face it, how many new designs does an engineer get to do?
Tony R.
Computer Engineering Student
Focus: Embedded Assembly Programming, Realtime Systems,  IEEE Student Member
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 9514
  • Country: my
  • reassessing directives...
Re: Is learning 8051 worthy nowdays.
« Reply #7 on: February 13, 2012, 05:22:27 am »
well, i learnt 80286 asm while back. when i moved to pic and avr asm, not much problem. if you learnt something in the past, it will help you in present. my advice is.... learn while you still can ;)
if something can select, how cant it be intelligent? if something is intelligent, how cant it exist?
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 625
  • Country: lt
Re: Is learning 8051 worthy nowdays.
« Reply #8 on: February 13, 2012, 07:20:14 am »
And my advice would be: don't waste the time for 8051 if You will work with ARM anyway...
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 9514
  • Country: my
  • reassessing directives...
Re: Is learning 8051 worthy nowdays.
« Reply #9 on: February 13, 2012, 10:45:09 am »
And my advice would be: don't waste the time for 8051 if You will work with ARM anyway...
yes true, get the latest thing today that u think u'll be working on. tomorrow it will bcome obsolete anyway, but so it will help u with learning future device.
if something can select, how cant it be intelligent? if something is intelligent, how cant it exist?
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6698
Re: Is learning 8051 worthy nowdays.
« Reply #10 on: February 13, 2012, 11:05:56 am »
The 8051 is very much still alive today, not as a discrete chip but as a core integrated into things like laptop EC's (http://www.coreboot.org/Embedded_controller ), LCD monitor controllers (the 6502 and 80186 often show up here too), MP3/MP4 players (ALI M5661 and related), and some keyboards and mice.

On the other hand, I haven't seen any widespread uses of PICs nor AVRs in most consumer equipment. Certainly not in the places that I've seen older, "mature" architectures.
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
Re: Is learning 8051 worthy nowdays.
« Reply #11 on: February 13, 2012, 09:37:28 pm »
I guess there's a bunch of assumptions that we're making.  My assumption by you saying "class mates" that you're studying an undergrad elec eng course of some description (or the like).

I've always recommended asking around, and getting the general feel for what your potential employers are using.  You can't really go wrong by targeting that.
 

Offline ee851

  • Regular Contributor
  • *
  • Posts: 122
  • Country: us
  • carbon-based caveman
Re: Is learning 8051 worthy nowdays.
« Reply #12 on: May 19, 2012, 03:39:41 am »
I wrote an embedded system in C for the 8051.   It was for a programmable lab pump.   So a C compiler was available for this 8-bit micro.   Not just assembler.     And yeah, like Dave said, you most certainly need good realtime programming skills writing for a 8-bit CPU, as compared  to most modern 32-bit CPUs.
« Last Edit: May 19, 2012, 03:43:18 am by ee851 »
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7337
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #13 on: May 19, 2012, 05:38:04 am »
8051 may be one of the oldest architectures (1981) but it is stil alive and kicking.
The total number of installed and in-use 8051 cores in the world still outnumbers arm ... ( we are talking as embededd controller like in dvd players , tv's cars etc. cell and smartphones do not count )
There is not a month that passes by and some new 8051 core based chip is put on the market. the instruction set patents have expired and lots of companies have jumped on them.
Most notorious are the silicon labs 8051's. they ave one that run over 100 mips. and wer are not talking 'risc mips' . 8051 can do multiplication and division in hardware... an avr or pic needs 20 to 50 of instructions to tackle that... ( talking 8 bitters here ! no comparing 32 bit mips based pics or cortex machines to 8 bit 8051 ! )
Last month Zilog ( of all companies ! ) actually released two 8051 based controllers ... and they have a roadmap for many more.

the 8051 may be old but it has a number of things that a lot of processors don't have :
- register banks. this is perfect to make multitasking systems and interrupt driven systems. simply assign one bank to a task and there is no need to muck about with context swaps. this makes the latency on the interupt handlers extremely short...
- 9 bit uart ... the 9th bit determines if it is command or data... you can easily make a 'network' with multiple 8051's , give each their own address and off you go. ( bitbus)
- full fledged interrupt controller with multilevel priority system

the cores have been upgraded of the years froma 4 clock per instruction to 1 clock (for most instructions , 2 clocks for jumps ).
thins like dual dptrs make crunching data extremely fast.

since the patents have expired there are now open implementations of the 8051. you can actually get the entire core as a verilog or vhdl block, drop it in and off you go.
as an experiment i actually mapped one of these blocks in an FPGA and loaded to 8052-ah-basic rom into it ... i used internal ram blocks in the FPGA and , using the pll's, i managed to crank up the clockspeed to slightly above 350Mhz ... that thing was lighting fast ... even running enterpreted code.

the 8051 is a very clever arcitecture and the peripherals are simple and elegant. it is  not dead ( not for a long time ... ) and worth studying.
since it is that old there is tons of example programs out there.
It istrue that it is less popular in the hobbyist crowd because it takes a bit more work learning to use it . it is not 'uniform cpu puree' to be 'mindlessly programmed in c'.
You actually need to understand the hardware a bit.

This is the DISEASE of the 21 century. everything is pre-chewed cud in the form of libraries and 'watered-down' programming like the hard-whino ... the end result is that we now actually have bloatware in embedded systems... simply becasue everything is abstracted and programmers have become lazy and dont understand the hardware anymore.
the typical example is driving an lcd display in 4 bit or 8 bit mode. everyone uses these libraries that allow the most crazy pinmappings. Yes, it is extremely flexible... but also extremely slow and large.. .When designing an embedded system the board needs to be designed with logic as well. jsut take a look atsome of the hobby pic projects. everyone is mucking around with 16Fxxx and has the most absurd connection scemes forsimpe things that they have to solve in software... this is NUTS. simply take a cpu with more pins ! you shrink your code developemnt , reduce the potential number of bugs and it'll run faster ( or do the same with less clockticks so be more energy efficient )

a typical example is i/o configuration. lets call the library
porta.1 = out
porta.2 = out
porta.3 = out
...
porta.7 = out

why dont you just load FF in the direction register forport A ?!?!?!
it can be done with one move operation. now you spend 32 bytes of rom  just calling and returning , pushing and popping and need a dynamic stack. and i havent even gone into the read modify write / and / mor mask logic required ... This is MADNESS !

So ,yes : learn the architecture , and especially : learn good coding techniques and forget the pre-chewd drab ... No to embedded bloatware !
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline ee851

  • Regular Contributor
  • *
  • Posts: 122
  • Country: us
  • carbon-based caveman
Re: Is learning 8051 worthy nowdays.
« Reply #14 on: May 19, 2012, 02:44:02 pm »
DANG! I knew I should not have dropped the zero.
Oh well, look here on the web - both the eight and the zero were dropped by Intel
https://en.wikipedia.org/wiki/Intel_MCS-51
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12108
  • Country: gb
    • Mike's Electric Stuff
Re: Is learning 8051 worthy nowdays.
« Reply #15 on: May 19, 2012, 02:54:30 pm »
Chances are you have at least one 8051 in your pocket right now - A large number of smartcards are based on 8051 - e.g. mobile phone SIMs &  credit-card chips.
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7337
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #16 on: May 19, 2012, 04:17:35 pm »
even better .. Have a keyboard in front of you ? attached to a pc ? 90% chance its got one in it , and there's one on the other side of the cable in the pc as well... the 8042 is an ancestor of the 8051 and was used in the original pc-xt keyboards ... ( a 8048 core ). when at keyboards were made the 8048 was obsolete and they switched to 8051.
In a lot of dvd and blu ray players the display and ir decoding is done by a 8051 clone.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 15359
  • Country: za
Re: Is learning 8051 worthy nowdays.
« Reply #17 on: May 19, 2012, 04:34:08 pm »
My mouse has one as well ( at least a 8051 core with bolted on USB) along with the keyboard. I think even my monitor has one in it to run the processing chip, i know a few old CRT units used them for user controls and configuration.

 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3706
  • Country: sg
    • T4P
Re: Is learning 8051 worthy nowdays.
« Reply #18 on: May 19, 2012, 04:43:35 pm »
My mouse has one as well ( at least a 8051 core with bolted on USB) along with the keyboard. I think even my monitor has one in it to run the processing chip, i know a few old CRT units used them for user controls and configuration.

I wouldn't like to teardown my screen but i won't, maybe when it breaks down  ::) but i will probably see what's wrong and get it on the road again.
Speaking of 8051... i found a few 8051 dangling in my parts box ... and whipping out a random board i still find a 8051 ...
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 15359
  • Country: za
Re: Is learning 8051 worthy nowdays.
« Reply #19 on: May 19, 2012, 04:53:51 pm »
Dave, I think I still have a 8748 around somewhere,  purple ceramic package and quartz window.
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3706
  • Country: sg
    • T4P
Re: Is learning 8051 worthy nowdays.
« Reply #20 on: May 19, 2012, 05:13:09 pm »
Dave, I think I still have a 8748 around somewhere,  purple ceramic package and quartz window.

Preserve that ! For the younger generations to come  8)
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 15359
  • Country: za
Re: Is learning 8051 worthy nowdays.
« Reply #21 on: May 19, 2012, 06:02:21 pm »
I used equipment that had 2708 eproms in it. 5V and -21V rails....... 21V to program it as well.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7337
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #22 on: May 19, 2012, 09:11:16 pm »
yep. it is staggering the amount of 8051 you will find in commercial applications.
if you take test euipment apart they are averywhere too. agilent uses 8051 to do the gpib on a lot of their machines ( 34401 34120 34250 e34xx supplies )  as well a the displays in the multimeters. all the io boards of a 34970 swith contain a 8051 to do the housekeeping..
take any dvd  / blueray player / computer monitor apart and you will find a 8051 core somehwere in one of the chips.
Since intel released the core ( did not renew any patents) the ecosystem has literally exploded...
there are more flavors of 8051 based chips out there than there are flavors of all different pic families combined.

If you rip your car electronics apart you will find the thing everywhere.

Embedded programmers love the 8051 because it is a very flexible machine and it has functionality not found in any other 8 bitter of the same era .. ( hardware div multiply , register banks , multilevel interrupts , harvard architecture , BCD arithmetic .., bitwise manipulations on I/O ports , no need for read/modify/write, no mucking about with 3 or 4 registers like on pic and avr .., full access to the EMIF so you can expand memory and i/o by simply memory mapping peripherals. there is not a single pic or AVR that can do that ... ( at least not that i know off, and wer are talking 8 bit here ... some of the MPS based machines maye.. but we need to compare apples to apples. ) )

Traditionally 8051 code was developed in assembly or using PL/M51. only later came C compilers for that machiine. Intel actually made the first C compiler and later sold it to Keil. the Keil C51 is actually intels compiler.
 
These compilers differ from the 'one-for-all' compilers like GCC that treat the 8051 is a 'virtualized stack machine'. The problem with C is that it was developed for a PDP machine with lots of registers and want to use stack operations.

on limited memory resource cpu's like a 8051 this is very counterproductive. Intel solved this by building a multipass compiler that first created a static memory map from your C code. function arguments are not passed through the stack ... in other words there is no push / pop code for every argument like a traditional C compiler generates. They create a fixed datastructure somewhere in ram and then pass a single pointer to that stucture. there is also other trickery involved.

It is interesting to look at the list output of the intel c compiler... they actually show you for every line of C code what is beeing generated as ASM mnemonics... they preserve the symbolic names for data in this list. ( Pass 4 resolves those and squashes them into static and overlay ) the compiler also does not employ the traditional C concept of a heap.
It's a really odd way of doing things but it creats very dense and fast code.

I still use the PL/M compiler for some of my work. This language was invented by Gary Kildall when he was working at intel and is designed specifically for cpu's like the 8051 8096, 8080 8085 and others.
When Gary left intel to start Digital Research he ported PL/M to the Z80 (which is basically an 8080 with an additional register and 2 new instructions ) and wrote CP/M in it. The rest is , as they say, history.

since this language is specifically designed for these CPU's it creates heavily optimized code. it is tough to beat the PL/M compiler ( last version dates from 1989 .. runs under dos ) in terms of code quality.
i have PL/M projects running on the silabs F100 cpu's as well as on analog devices machines works perfectly fine.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6698
Re: Is learning 8051 worthy nowdays.
« Reply #23 on: May 20, 2012, 09:13:16 am »
Here is something you might find interesting, gate-level schematics of the 8052:
http://www.satre-electronics.com/home/reverse-engineering
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18952
  • Country: nl
    • NCT Developments
Re: Is learning 8051 worthy nowdays.
« Reply #24 on: May 20, 2012, 12:16:57 pm »
I'd stay away from any 8051 device. The reason they still use the core is because it is free so semi companies can scrape a few pennies off the price. So if you are only looking at the component cost then a 8051 based device is likely to be cheaper. What people tend to forget is development cost and time. As free_electron already pointed out there is no cheap C compiler that will create decent 8051 code. That is cost factor one. The other cost factor is processing power. Because the code, data and external data is seperated the 8051 will need to execute a lot of instructions to move data from one memory to another. This results in a risk that you need to spend a lot of your precious time optimizing / rewriting code. That lost time doesn't add any functionality to a product! In a commercial situation you'd need a really high volume to earn back the lost time. As a hobbyist you're just wasting a lot of your own time on swimming around in mud.

Don't get me wrong. When it was invented the 8051 was a great microcontroller but nowadays its a relic from the past. Please look at it in the museum and remember: in a museum you shouldn't touch the items on display!
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf