Newbie assistance for Atmel at89c2051 project

Greetings everyone, I have a specific application I want to put a atmel processor to. The processor would be along the lines of a AT89C2051-24, ideally something I can program easily say using their ISP system. I have a proto board design I found on the net for said mcu and it pretty well fits what I need for this. However. Since I have NO experience in programming one of these things. I was curious if there is a simulator that you'd recommend I could use to learn how to use this beast before I launch into building the real thing and realize I can't make it work. I do have windows machines, but I prefer using my Freebsd boxes. Any answer right now will be helpful on this. I'm doing this project for a non-profit organization and I have zero budget save what I'm throwing in which isn't much. A general idea of what I'm going to do with this. Is use it to translate a 3x4 matrix keypad output into a serial ascii equiv. So a computer can check the info in a database and respond with a command to start a motor to open a garage door. The mcu will also determin if the door is open or closed. That's the general idea of what I'm doing with this. Any and all assistance is greatly appreciated.

Davon

--
---
  I came.. I saw.. And I wondered. what am I doing here!
 Click to see the full signature
Reply to
Davon Shire
Loading thread data ...

Davon Shire schrieb:

The 2051 does not support ISP.

If you need a small ISP capable 8051 compatibe controller, look at the Philips LPC9xx series (especially LPC921/922 in your case). They also have the needed software for ISP download.

For tutorials about programming etc, look at

formatting link

--
Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
 Click to see the full signature
Reply to
Tilmann Reh

I know the 2051 doesn't have ISP. But thank you for the suggestion and link. I'll start digging into it. I'm not fixed on any particular mcu or such. I just want to spend a few dollars as I must to get this thing up and working.

I'm stunned and amazed at the quick reply. Keep them coming and thank you all in advance.

Davon

--
---
  I came.. I saw.. And I wondered. what am I doing here!
 Click to see the full signature
Reply to
Davon Shire

Tilmann Reh, Wow this LPC922 looks great so far. I've been looking at the data sheet and it has something I had in the corner of my mind as a good thing but not totally necessary. A RTC. The 8052 site is a bit cluttered but I'm starting to get around about it. Thank you again for the information. Is there a good protoboard design out there for this chip?

Davon

--
---
  I came.. I saw.. And I wondered. what am I doing here!
 Click to see the full signature
Reply to
Davon Shire

If you are in such a hurry, you might want to look at CYGNAL parts.

NEWS FLASH

Their development kit has hardware and software from $99 to $149.

Check out the phriphals you need and select a kit.

hamilton

Reply to
hamilton

hamilton schrieb:

No, forget them - absolutely oversized and far too expensive for this application.

--
Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
 Click to see the full signature
Reply to
Tilmann Reh

Davon Shire schrieb:

It *is* a really great chip. :-) And d*mn fast.

I don't know of one, but you could do the development using the LPC932 (the great brother) and later use the 922 instead (they are almost completely compatible). For the 932, there are some boards available.

Look at

formatting link

--
Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
 Click to see the full signature
Reply to
Tilmann Reh

well for a few cheap dev / proto boards from US$29 - $70 (no lpc9xxx)

8051
formatting link
formatting link
formatting link
formatting link
formatting link
formatting link
formatting link
formatting link
These guys can take a up to a few weeks to ship but are cheaper than most other places. (can put other manufacturers 8051's in these boards as long as they are pin compatable) If you order any of their boards order the extra chips(eeprom , rs422/485, rtc(real time clock) etc) at the same time. And any of the accessories - lcd.

Also can run most of their boards faster(depending on micro) by replacing the crystal with a high speed.

another cheap 8051 dev board for US$39

formatting link

0031
formatting link

formatting link

formatting link
have a couple of 8051 boards

formatting link

may find a few other links on Jan Axelson's page

formatting link

formatting link

Alex

Reply to
Alex Gibson

I ordered a 932 development board for $59.00+ tax/shipping It seems to handle pretty much what I'll need and since it's already assymbled I won't have to worry too much about getting all the parts.

I'm excited, this is the first time I've done anything like this. I'm use to working mostly with servers and fixing TV's and stereos and stuff.

Thanks very much for the points and suggestions. With luck by sometime next week I may be starting to talk to my first MCU. I've been looking at the simulators availible so I can test my code and all before I start talking to the board. Any suggestions?

I've got SDCC running on one of my servers, though I haven't quite figured out how S51 works it is definitely going to take me some time to get comfortable with all this.

Many thanks and happy new year.

Davon

--
---
  I came.. I saw.. And I wondered. what am I doing here!
 Click to see the full signature
Reply to
Davon Shire

DO NOT use the SDCC compiler. the LPC kit should come with a Keil compiler. Although this has a 4K limit on it you will probably be able to compiler far more code than with the SDC compiler.

The Keil is extremely good at optimising ad data overlaying. The SDC isn't

Regards Chris

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org

formatting link
\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Reply to
Chris Hills

Is there anything else wrong with the SDCC compiler? I intend on using SDCC for some Open Source stuff and just want to be careful.

--
Linux Home Automation         Neil Cherry        ncherry@comcast.net
http://home.comcast.net/~ncherry/               (Text only)
 Click to see the full signature
Reply to
Neil Cherry

Just try both the SDCC and the Keil and compare them.

Keil C51 is used in aerospace, medical and other safety critical applications. It is probably the best 8051 compiler on the planet. I would not suggest using the SDCC on anything other than hobby use.

The 4K limit on the Keil in the LPC932 kit is very efficient and as the LPC932 part has only 8K of flash you will probably get more code into the part with the 4K limited Keil compiler than the unrestricted SDCC.

There is a free 2K Keil and for about 60USD the 4K limited one with the LPC932 kit. After that it does get expensive.

Regards Chris

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org

formatting link
\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Reply to
Chris Hills

Whilst I respect your views Cris I think you may be a little unfiar on the SDCC compiler. It is free and unrestricted but in the relatively early stages of development. As it is open source, if you have problems you can contact the developer directly and often get a fix or workaround very quickly.

Ian

Reply to
Ian Bell

Ian Bell wrote in news:3ff31990 snipped-for-privacy@mk-nntp-1.news.uk.worldonline.com:

I believe the point isn't about bugs in the compiler but the quality, tightness, and sophistication of the Keil compiler. The things that C51 and its optimizing linker (yes linker) can do rival that of extremely expert assy. programmers.

I am sure SDCC developers would be happy to fix bugs expediently but I question wheter they have the time or resource to do the same level of research into *very* 8051 specific compiler optimizations that Keil do. After all, SDCC isn't specific to the 8051 so I wouldn't expect (or fault) SDCC for comparing poorly against such a mature compiler such as C51. In the same vein, Diab (now WindRiver) has a PowerPC compiler that cooks gcc for lunch and then eats it.

--
- Mark ->
--
Reply to
Mark A. Odell

oooooook.. I can see that Keil has truly cornered the market for those who know what they are doing and are interested in doing overlays and all that feldorcarb....

Chris you clearly are an expert when it comes to this stuff and though the SDCC is in version 2.33 and does come with a simulator and all, and is free and is functional and is without limitation..

I most likely will end up using the keil development stuff. It's sad that it's got the 4k limit but if someone can write an OS in 300 bytes seems It's likely I'll be able to get what I need done with the Keil stuff.

Please remember EVERYONE! I'm a hobbiest at best when it comes to this. I have Zero... Zip.. Naddah.. Zilch.. development dollars. I needed some info to help point me in a direction that will help me finish this job for my friends at the non-profit center.

I would love if this thing worked out to build a dozen of them and sell them to NASA so they can launch a Mars probe that will actually report back when it's suppose to. Etc. But really this will probably be my only chance to do something brilliant like this and I wanted/needed a cheap way to do it.

If you need more details as to what I'm doing that's easy.

The center needs to keep track of who's coming and going out of the store house for canned goods. Someone donated a waterproof security access keypad that is a 3x4 matrix output interface. This of course doesn't work well with a computer running Freebsd and a database. So I offered to try and make something work.

The MCU will translate the 3x4 Matrix output to serial ascii and dump it to the computer. The computer will take the entry codes and record them , check that the code is valid and send back a signal to start the door opener and signal the code accepted on the pad's led.

Essentially this is a very cheap access control system. had they actually had a serial or dtmf output I would not have needed to go the MCU route.

Anywho. Thank you one and all for your help and opinions. Happy New year one and all.

Davon

--
---
  I came.. I saw.. And I wondered. what am I doing here!
 Click to see the full signature
Reply to
Davon Shire

It's all transparent- the compiler quietly, and behind the scenes, generates a call graph and from that figures out if it can re-use (overlay) RAM for auto variables where it is safe to do so. Useful when you only have 128 bytes to work with.

What you notice is that you don't run out of RAM.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

In article , Ian Bell writes

I don't disagree with some of your statements. The SDCC is in it's early stages of development. therefore it is really only suitable for hobby use.

The part is question is the LPC932 with 8K code space. Given the efficiency of the Keil compiler compared to the SDCC you will probably be able to get a larger program in to the part with the 4K limited Keil than the SDCC. This is because the Keil does some very good optimisation both in the compiler and the linker.

The support for the Keil is equally responsive.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org

formatting link
\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Reply to
Chris Hills

You sound like a 12 year old...

The Keil is a professional tool that works. If those who know what they are doing use it why does that stop other people using it?

And?

I said it is good for hobby use. In the case in this thread the part (LPC932) has an 8K limit. Given the optimisation in the Keil it is likely that you will be able to get a larger program into the part with the 4K limited Keil than the unlimited SDCC (assuming it does support the LPC932)

If it doesn't fit in with the Keil it is not likely to fit with the SDCC.

Why to you need an OS? 99% of 8051 family projects don't use one.

I think the LPC932 kit with the Keil compiler is about 70 USD It's cheaper than making your own board.

Cheap or inexpensive.... NASA won't look at it if you use the SDCC. The might if you use the Keil. I am currently working with a group (allegedly) doing a satellite who are using a Keil compiler and no OS.

If you are looking to do something for aerospace the Keil is the ONLY option for 8051.

1 You don't need an OS or RTOS for this. It is single thread and an interrupt for serial input. 2 I would think this will fit into the Keil 4K quite easily. If it doesn't you wont get it to work with the SDCC in 8K (major point is that you will need the data overlaying so it may not work with the SDCC no matter which 51 you use.) 3 As it is just serial you should have no problem using the serial examples in the Keil compiler. These are very small. 4 You don't NOT need an RTOS.

Have you used an 8051 before?

Which part of the world are you in?

Regards

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org

formatting link
\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Reply to
Chris Hills

Thank you, I've been told I sound like a 10 year old. So I must be improving. :)

Using SDCC or Keil is not a mutually exclusive thing. I don't see it how it stops anyone from using anything. I've been to your webpage Chris. I see you are a Professional with Big Credits, deploma's and credentials. You're even published. Grats on all that. I'm sure your help will be invaluable in getting this thing done. Thank you for offering your wisdom and experience. Truly.

Chris the line about if someone can right a 300 byte OS was a small Geek oriented attempt at humor. My appologies.

Yes that's the kit I bought as I mentioned to Tilmann Reh Above. I'm glad you and I are on the same page.

^^^^^^^^^^ Humor ^^^^^^^^^^^

^^^^^^^ Not Humor ^^^^^^^ Grats on the project Chris Really.

Clearly wisdom I can use. No I really hadn't figured on using a RTOS or any OS at all really. But tell me, could I use the WD to make sure the program is running and jumpstart the code again if it hung or failed?

No I have never worked with a MCU before. As it is this 932 part has like 4 times more power and resources than my first TRS-80 Model 1 computer. So things are really quite exciting.

I'm in Memphis Tenessee.

Thank you for your time and energy Chris.

Davon

(To reply by email please remove the _X from my email address )

Reply to
Davon Shire

Definitely. That is the whole point of them. It they are not prodded every now and again they will reset the system. Of course if you are really good you will check a flag/bit to see if it is a watchdog reset of a cold boot.

OK. Have a look at the C51 Primer on my web site it's on the Quest page.

formatting link
Also the "Last Word on the 8051" if you can find it. If not I have an electronic copy of it.

There is a LOT of help on the Keil web site the forum and the app notes particularly.

BTW it is well worth searching round the Keil CD when you get it with the kit. It holds over 600 MB if information of which only about 20Mb is the compilers.

and if you make an attempt at things people on this NG will usually help.

One last tip use the simulator to debug the program first. the Sim is VERY good and can be script driven. There are some examples I used on a smart card on my web site. All the unit testing was done this way

I know I looked up your domain on whois.

No problem... we are usually friendly.

Regards Chris

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\ /\/\/ snipped-for-privacy@phaedsys.org

formatting link
\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Reply to
Chris Hills

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.