Author Topic: Is learning 8051 worthy nowdays.  (Read 16687 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: 3123
  • 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: 30586
  • 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: 1163
  • 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: 9386
  • 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: 606
  • 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: 9386
  • 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: 6616
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: 1163
  • 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 »
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • 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: 12086
  • 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
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • 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: 15309
  • 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: 15309
  • 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: 15309
  • 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.
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • 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: 6616
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: 18543
  • 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.
 

Offline Spiro

  • Contributor
  • Posts: 34
  • Country: cs
Re: Is learning 8051 worthy nowdays.
« Reply #25 on: May 20, 2012, 01:52:22 pm »
This is nice software for learning 8051:
http://en.wikipedia.org/wiki/MCU_8051_IDE

 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #26 on: May 20, 2012, 02:35:33 pm »
As free_electron already pointed out there is no cheap C compiler

depends on your definition of cheap. 1500$ gets you the keil or iar compiler. Chickenfeed for a company. But, it raises a bigger question : why use c at all ? I have never understood why everyone tries to force a language, that was made to run on a register based machine with lots of ram like the PDP, run on resource restricted machines like 8 and 16 bit microcomtrollers.
C is stack heavy... Pretty hard to make it run on a machine where you get 256 bytes of ram....



Quote
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.
what are you mumbling about ?
Modern 51 based chips use on board memory. No penalty for access. Actually execution has always been optimized with the 51 as long as you run from internal rom. Going through the emif may cost you an additional cycle here and there but that is because of address/ data mux to save pins.

The modern chips have gone from 4.. 8 clocks per cycle to 1 and 2 clocks per cycle. The muxing is gone since everything is on board.

I would NOT use a bare bones 51 like a 87c52 or anything in DIL for a new design. Move with one of the silabs 8051F series cpus.

But, you are right, 51 is slowly ( very slowly ) moved to the museum. Up till a few years ago there was no real contender.. The Cortex M3 core is the first real mass-scale vendorless processor core out there and it has a really good chance of becoming the new standard.

Traditional arm was too top-heavy. And very little standard chips were available since the arm was targeted at asic makers. But also there the compiler isn't exactly chicken feed in cost. You don't want to know what a single seat of ARM's RVDS costs.... Every year !
Iar and keil are cheaper then.

The nice thing about cores like 51 and m3 is that many manufacturers use them. This gives a large pond to fish in and once you know the core you can easily switch chips.
With pic and avr you are stuck to one source...
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18543
  • Country: nl
    • NCT Developments
Re: Is learning 8051 worthy nowdays.
« Reply #27 on: May 20, 2012, 03:26:07 pm »
As free_electron already pointed out there is no cheap C compiler

depends on your definition of cheap. 1500$ gets you the keil or iar compiler. Chickenfeed for a company. But, it raises a
$1500 is not chickenfeed for many small companies! Everybody uses C because it is portable. Some of the projects I've worked on use the same code on microcontrollers, SoCs and PCs. Why write, debug and maintain 3 different pieces of software which do the same?
Quote
Quote
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.
what are you mumbling about ?
You better read some information on how many hoops a 8051 must jump through to get a byte of data from a certain address. Its a real ugly kludge!
Quote
Traditional arm was too top-heavy. And very little standard chips were available since the arm was targeted at asic makers. But also there the compiler isn't exactly chicken feed in cost. You don't want to know what a single seat of ARM's RVDS costs.... Every year !
Nonsense. GCC (which is available for free without support) will do just fine for any ARM controller. Since compiler vendors specifically forbid to publish comparisons between other compilers I guess GCC will work just as fine as any other compiler. Most of the speed and code size differences are in the C libraries that come with the compiler but there are extremely lightweight C libraries available for free as well.
Quote
The nice thing about cores like 51 and m3 is that many manufacturers use them. This gives a large pond to fish in and once you know the core you can easily switch chips.
With pic and avr you are stuck to one source...
More nonsense. Every 8051 clone has manufacturor specific extensions, programming methods and peripherals. A lot of time getting used to a controller goes into learning the peripherals. The CPU core is almost insignificant compared to that because the compiler mostly deals with the CPU.
« Last Edit: May 20, 2012, 03:39:46 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #28 on: May 20, 2012, 06:33:30 pm »
Everybody uses C because it is portable.
yeah, right .... As portable as any other language...
That is a myth. You will always have to tinker with the hal. There is no escaping that. And that is where all the hard stuff is ( for beginners)

Quote
Why write, debug and maintain 3 different pieces of software which do the same
because of the fact that something designed for one architecture will run differently on another.
This is the problem with modern programmers. Every thing is treated as a pile of sourcecode without binding to hardware. The perfect recepy for bloatware...

Quote
You better read some information on how many hoops a 8051 must jump through to get a byte of data from a certain address. Its a real ugly kludge!
Not more than any other cpu out there. Like i said a MODERN 8051 has all memory inside. No more need for xram operations. Besides if you are going to use c : you dont care either way ! The compiler creates the code for you. And on a modern implementation of the 51 core the instructions are still only one clocktick. So it doesnt matter at all for the programmer. The compiler figures out if it needs an xram or iram access.

Actually this partitioned memory is better than a flat system. Code cannot be overwritten by runaway stack or heap. No problems with code injection. Data memory can never be executed. This alone helps you in making more solid applications that are less susceptible to common programming mistakes.


Quote
Nonsense. GCC (which is available for free without support) will do just fine for any ARM
right. Its that little 'without support' clause.. If you are the kind of person that likes spending 90% of his time trying to pound the square peg that the great-crap-compiler is into the round hole of eclipse...or go look for info on forums where everybody starts yelling at you ' you are stupid if you don't know xyz' and where every discussion eventually ends up being about what is the best code editor ( emacs vs vi/vim ) and whether to use gnome or kde for your desktop.... Be my guest.
Meanwhile : i have work to do.. Call support. I understand that this is not always possible if you are a hobbyist , but, why not make your life simple and start with a nice prepaged one click system that will get you up and running effortless. It is pointless first spending a week trying to get the environment running and making youself comfortable with it..
Buy one of the iar or keil devkits for 99$. Comes with a ton of fully documented examples.

I like polished ide's with breakpoint, watches, tracing and all the bells and wistles. Its 2012... The time of debugging by using printf and scanf is so last millenium... I like guis. Command lines are for dinosaurs, but that is my opinion. If you want to do it differently , be my guest. No problem. But do not force everybody to do it that way. The keil environment is really nice.

The reason arduino is so popular is exactly that. Install and have fun. The same goes for tools like iar and keil. Install and go.
This is something the gcc/ eclipse crowd have not caught on to yet.. There everything is hard.
I want to blink an led with a microcontroller but i first have to become a specialist writing linker scripts , make files , struggle through all the command line options and compile my toolchain ? Ehhh.... Not fun !
Quote
More nonsense. Every 8051 clone has manufacturor specific extensions, programming methods and peripherals. A lot of time getting used to a controller goes into learning the peripherals
You are mixing peripherals with core.
The base 51 has a uart , two timers 4 io ports , an emif and an interrupt system. The uart and timers are identical, no matter what chip you take. so are the io ports that are base to the 51 core.
 The other peripheras are vendor dependent and those you have to learn, yes, but that is valid for all other cpu's as well. But, if you take a pic 16 and another pic 16 the io port does not behave necessarily the same. In an 8051 the io ports all behave the same irregardless of vendor. Portb will always be portb. In a pic ? Some have pins modified to be open collector only , while in others they all of a sudden are push pull by default.
« Last Edit: May 20, 2012, 06:36:41 pm by free_electron »
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline jerry507

  • Regular Contributor
  • *
  • Posts: 246
Re: Is learning 8051 worthy nowdays.
« Reply #29 on: May 21, 2012, 05:09:23 am »
Quote
Meanwhile : i have work to do.. Call support. I understand that this is not always possible if you are a hobbyist , but, why not make your life simple and start with a nice prepaged one click system that will get you up and running effortless. It is pointless first spending a week trying to get the environment running and making youself comfortable with it..
Buy one of the iar or keil devkits for 99$. Comes with a ton of fully documented examples.

Several posts ago you complain about everyone wanting to do C and now you're raving about Keil. Sure, it's my favorite compiler too but my company won't shell out for it. We use the free crap. The tough problems aren't how to use the environment, it's how to use the chip. And Keil won't help you figure out why you're drawing 1mA instead of the datasheets quoted 300uA value. Call the vendor for that. Whooptie doo.

I don't see the huge utility in having some built in uarts and timers. Those peripherals are so easy to configure on ANY micro that they don't need standardization. Btw, you listed 9 bit uarts and HW div/mult. Many micros integrated one or both many many years ago. The 18 series from Microchip has HW mult and some other series have div as well. I can't remember the last time I saw a micro without 9 bit uart. Welcome to 2012.
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #30 on: May 21, 2012, 06:13:14 am »
You are pulling things out of context. C is meant for register based machines with lots of stack and heap. 8051 and many other microcontrollers are not such machines.
If you do want to go that route anyway : get a real development tool made for the machine architecture and not some generic compiler with a bit of a backend for the cpu. Gcc was never intended for small machines. Use sdcc if you must.

You are also pulling the other comments out of context.. The 8051 core has a uart , 4 io ports and some other stuff as standard. If you look at other microcontrollers from the same era : none have hardware div/ mult. At the time this set it well apart from the competition.
Anyway , the context here is : if you know this base 51 core you can use any chip from any vendor that employs this core. All you need to learn are the new bits , and those are a matter of configuring registers.

As for the 9 bit uart : this is very handy to make distributed systems. Instant , without software overhead.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline jerry507

  • Regular Contributor
  • *
  • Posts: 246
Re: Is learning 8051 worthy nowdays.
« Reply #31 on: May 22, 2012, 12:33:42 am »
I wasn't trying to pull things out of context, just trying to get MORE context. If the Keil compiler (or similar options) are available for a reasonable sized project, what is the advantage to using ASM keeping in mind the state of modern projects?

I understand where you're coming from with the div/mult now, my point is that these features have replicated down to nearly everything now. Not to tarnish the past of the 8051 (it did become a huge success for a reason after all).

I found it funny that I read today ARM has started an effort to standardize many of the peripherals on their cores in a similar fashion. My point is that SIMPLE peripherals such as IO, uarts and timers are generally not complicated enough to the point where just knowing the registers is really a time saver. On a modern processor you need help with DMA, USB, ethernet and power management, not timers.

From my experience, I've found that having a common interface (naturally well documented as well) would be less important than having common featuresets between ARM processors. I ran into a situation recently where I found that TI Stellaris processors have a systick timer module, but it isn't capable of waking the processor from sleep modes unlike newer Freescale processors. Whether this is a difference between M3 and M4 I don't know, but it made me with I had went with a Kinetis part. That annoyed the hell out of me, it's buried in the weeds.
 

Offline drewtronics

  • Contributor
  • Posts: 12
  • Country: us
Re: Is learning 8051 worthy nowdays.
« Reply #32 on: May 24, 2012, 06:07:50 pm »
Not going to comment on any philosophical arguments....

Cypress has some really cool, really fast 8051 chips that you can use for very fast data grabbing over USB.  The Saleae logic analyzers (the 8 bit ones) use the cypress 8501 ICs. I'd wanted to play around with them but never got the time to really dig into them.
 

Offline targ2002

  • Contributor
  • Posts: 11
  • Country: gb
Re: Is learning 8051 worthy nowdays.
« Reply #33 on: May 24, 2012, 07:54:15 pm »
I learned quite a bit about these while I was uni, but didn't think I would encounter them when I started work.

Now I have to maintain some software for this device
 

Offline ColinB

  • Contributor
  • Posts: 23
Re: Is learning 8051 worthy nowdays.
« Reply #34 on: May 29, 2012, 08:07:57 pm »
Using 8051 for anything serious has really been painful for me.  The stack is effectively limited to about 200 bytes (256 max internal data memory).  It's really ugly when you need over 64 KB of code space, then you have nasty banking of code space.  The 8051 is really bad for C programming because there are 3 or 4 memory spaces, so pointers actually need 3 bytes to store, and special switch-case code generated by the compiler to manipulate pointers -- the expensive proprietary compilers will optimize these things better, and in SDCC (the only free 8051 compiler) you can explicitly declare the memory space to which a pointer belongs, but all these things are expensive and ugly.

I would say that MSP430 and AVR are a hundred times better than 8051 if you want to use free tools.  You can use gcc on them, which means C, C++, and good code optimization and compiler warning features, not to mention it implements modern C and C++ standards (C99, C++11).  For the MCS-51 (8051) you are stuck with SDCC as the free compiler.  It is not C99 compliant, has no C++ support, and is not fun to deal with compared to gcc.  I can't blame SDCC too much for the bloated machine code it produces for the 8051, since 8051 has such a lousy architecture and instruction set for modern programming.

You can play with 8051 and learn it if you want, but you are surely a masochist if you do... I would choose AVR, MSP430, or ARM Cortex-M3/M0 first ... I can't speak for PIC, I have no experience with them, since I have tried to avoid using PIC due to lack of good free tools.
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 7301
  • Country: us
    • SiliconValleyGarage
Re: Is learning 8051 worthy nowdays.
« Reply #35 on: May 29, 2012, 08:20:17 pm »
like i said, 8051 predates widespread c ...
and 'c is not the end-all of programming either. especially not for microcontrollers.

but today, yes go for a mpore modern controller. like a Cortex based machine. Lots of vendors. lots of tools
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3123
  • Country: us
Re: Is learning 8051 worthy nowdays.
« Reply #36 on: May 29, 2012, 11:04:41 pm »
Learning 8051 would not be my first choice of a device to use in the modern world.  But that's a long way from "not worthy of learning."  If nothing else, it provides an interesting perspective for understanding the development of microcontrollers SINCE then.  (And computer languages as well.  A key difference might be that older microcontrollers were designed to be programmed in assembler.)

It's not like there aren't plenty of other archaic architectures floating around.  And MANY, MANY, chips.  The 8bit PICs, all those 8051 companies, and a sizable number of things that are essentially Z80s (zillog and renesas.)  If your education stops with microcontrollers that work well with a C compiler, you're missing a lot.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf