LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-19-2008, 12:30 AM   #1
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
8051 programmers?


I recently decided to take up micro controller programming so that I can get started with embedded systems (not in the "embedded Linux" sense.) I have a board on order with an 8051-arch µC and some additional components to add on so I can mess around with it.

Does anyone here do serious 8051 programming? Do you use assembly or C? At first glance, assembly seems to be the way to go for controllers with extended SFRs (my controller comes with USB SFRs,) and maybe even all-around since you're so close to the hardware. Yes, I've been to 8052.com, before anyone asks.

This being the "most common µC arch," I was very surprised to see absolutely 0 serious posts about 8051 on LQ. Any reason for this that I'm missing? Maybe because most of the controllers in need of new software require knowledge of circuitry or a concurrent hardware design? Maybe the people who do that sort of thing get paid for it (probably not a lot of controllers in need of open-source firmware)?

In any case, I have a few months on my hands now and I need something new to learn. Right now the plan is to hook up an LCD and maybe a few buttons and relays and see where it takes me. I already see myself being die-hard about assembly and I already have theoretical questions (such as dynamically switching register banks,) but those can wait until I'm actually able to test a program
ta0kira

Last edited by ta0kira; 05-19-2008 at 12:34 AM.
 
Old 05-19-2008, 12:42 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

I'm surprised that you're surprised to see 0 posts about a (fairly simple) chip that shipped as the standard UART on the original IBM PC! The 8051 is a stalwart and all that - but jeez - it predates the Reagan administration, premium cable TV and the CD-ROM!

PS:
This book looks pretty good:
Quote:
Programming and Interfacing the 8051 Microcontroller in C and Assembly, 2nd Ed
Helen Emery, Sencer Yeralan, 2000
ISBN 096332571X

Last edited by paulsm4; 05-19-2008 at 12:58 AM.
 
Old 05-19-2008, 01:38 AM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Agreed, but this chip does strike me as very relevant to date: AT89C5131

One could also say the same things about C (and people do.) I'm sure most micro controller code is generated automatically these days, anyway. That won't stop me, though!
ta0kira

PS Looks like all of the examples are in C...
 
Old 05-19-2008, 02:18 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Does anyone here do serious 8051 programming?
Well, here's the problem: An 8051 isn't a very capable chip (& I know that variants add all sorts of bits and pieces and up the performance quite a bit), so if you were going to do serious programming, wouldn't you be better starting off with something more capable?

The 8051 didn't get where it is today by being better than anything else, it got there by being just enough for the most common stuff in an eight bit generation, by being so widely adopted amongst manufacturers that there was less chance of vendor lock-in and by being cheap.

I can't think of anything that, these days, I would choose to do on an 8051 (assuming that I have a choice) even though there are perfectly good simple applications for which an 8051 is an adequate part.
 
Old 05-19-2008, 04:03 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
I used to program 8051 embedded stuff. Usually assembly onless I inherited C applications.

Dallas has (or had, not sure) the FP5002 which is supposed to be very secure.
There are versions that run 4x as fast at the same clock and even go up to 40 MHz clock.
Several smartcards still use a MCS51 core as far as I know.

If I page through some electronics magazines, MCS51 based uC still seems to be alive and kicking.


@paulsm4: ain't you confusing it with the 8251

Last edited by Wim Sturkenboom; 05-19-2008 at 04:37 AM. Reason: Change comment to paulsm4
 
Old 05-19-2008, 11:35 AM   #6
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by salasi View Post
The 8051 didn't get where it is today by being better than anything else, it got there by being just enough for the most common stuff in an eight bit generation, by being so widely adopted amongst manufacturers that there was less chance of vendor lock-in and by being cheap.
Well, a micro controller certainly isn't intended to perform in the capacity of a microprocessor.
ta0kira
 
Old 05-19-2008, 02:23 PM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, Wim -

You're right. The National Semiconductor 8251 UART and Intel 8051 embedded controller are completely different chips. Sorry about that ;-)

PS:
However, the 8051's predecessor, the Intel 8048, was used on the IBM PC's *other* serial device - the keyboard.

Last edited by paulsm4; 05-19-2008 at 02:27 PM.
 
Old 05-19-2008, 05:48 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Welcome to the world of 'real' embedded systems . 8051's aren't going to run much of any OS, so what ever you put into it, it's all your work/bugs/features.
I've done quite a bit of '51 family work (although its been a long time since I had the pleasure), and as far as the C vs. assembler question, my answer is both. Much of my work was done with C code to build the basic program structure and some of the heavy lifting (like printf(), if I had enough memory), and the rest was often functions written in assembler. I found that was a nice combination of CPU efficiency and programmer efficiency. After a while, I had built up a decent collection of standard functions, and very often could drop in working code to a new project.
If your trainer board doesn't come with a working monitor (no, not the CRT/LCD kind), you will probably serve yourself well to write one of those right away (or you could cheat and download one; I seem to recall looking at a couple of open-source ones).
This isn't the first place I would come looking for 8051 advice, either. I used to stay closely tuned to a couple or three Usenet groups: a couple in the sci.electronics hierarchy, and comp.arch.embedded. I haven't look at those too much lately, but there was always good advice floating around there. The archives on Google groups probably still has most of it.
Do you have a cross development platform chosen? If yes, what will it be?
Good luck in your adventure.
--- rod.

Last edited by theNbomr; 05-19-2008 at 05:51 PM.
 
Old 05-19-2008, 05:49 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Its been a few years but I used both the Intel 8048, 8051 and the more modern ATMEL chips in a few projects. I thought they were a lot of fun to play with and easy enough to use. I always used a DOS based assembler but you can find linux c cross compilers and assemblers. I would not call them obsolete just yet.

I've seen a few posts on electronics projects but would say that hobbyists on JL are few. Maybe this thread will bring them out of the closet.
 
Old 05-19-2008, 11:47 PM   #10
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theNbomr View Post
Do you have a cross development platform chosen? If yes, what will it be?
Right now I'll probably stick with Slackware 12 and asem51. Not sure if Amtel provides a compiler or assembler. I'll probably also use the Amtel flashing software. As far as the board, it comes with several ports (USB, R232, etc.,) sockets for EEPROM and RTC, a 34-pin IDCC, and probably a few other random pins. I'll have to hook up any sort of output myself. I'm just going to hook up the LCD to start with (hopefully the board has a 5V pin somewhere, but I expect to need some passive components to make things work) and work my way up from blinking characters to who knows what.
ta0kira
 
Old 05-20-2008, 12:01 AM   #11
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
For whatever it's worth, the book by Yeralan and Emery I mentioned above:
Quote:
The book comes with, Reads51 software, an integrated development environment, which runs on an IBM PC or compatible host. Reads51 contains a C compiler, relative assembler, linker/locator, editor, chip simulator, assembly language debugger, and host-to-board communications in a user-friendly, menu-driven environment. The complete source code for all of the experiments in book are located in the Reads51 directory, Rigel\Reads51\Pi51ca.Data sheets for all the hardware components used in the book are also available on line.
The authors' web page is here: you might be interested in some of these other goodies:
http://rigelcorp.com/edpack.htm

'Hope that helps .. PSM

Last edited by paulsm4; 05-20-2008 at 12:09 AM.
 
Old 05-20-2008, 11:36 AM   #12
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Thanks for the link. I'll see what my board actually comes with, then I might have to supplement it with some books. It hasn't been "my style" to use books (for programming, anyway,) but this might be a good time to start.

I decided to go with this board because it looks like something I can create a prototype with once I've messed around with it extensively. I actually came across it because I was looking for a USB development kit. Of the development boards available with that µC, it seemed like the cheapest, but also like something that can be built around for serious hardware (i.e. not just a demo or "beginner" board.) I do have to brush up on my EE knowledge since the last time I seriously studied it was mid-90s, long before the WWW was available.
ta0kira
 
Old 05-20-2008, 12:15 PM   #13
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
Nice board, smashing price. I'm tempted, but brain cells are already in overload and my project list is already growing into infinity. It seems a lot of overkill for my meager needs. Several years ago I was all ready to commit to 8051, then someone came along and gave a talk about PIC. Just enough to stall me in the middle of the river so to speak. I didn't proceed either way.

Currently getting excited by satellite telemetry and chasing the Doppler shift. I might get back to embedded controlers for antenna steering - but I'll have to fight the wife for posession of the garden first.

Regards,

Last edited by PAix; 05-20-2008 at 12:16 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting Linux on 8051/PIC devices msriram_linux Programming 4 04-25-2012 06:26 PM
flexlm, Flexible License Manager, tasking 8051 bioe007 Linux - Software 1 07-24-2007 03:47 AM
Question for programmers/occasional programmers Robert Diggs Programming 9 12-23-2006 07:55 PM
Linux Porting on 8051/PIC microcontrollers msriram_linux Linux - Software 1 12-02-2004 10:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration