I have a dilemma with using my Arduino Uno for prototyping a new project at work. Currently I am using Arduino to prototype PWM control for a pump and boiler. But currently the product's PCB has a chip that is Atmel 8051 compatible and talks via serial with a controlling module. I have an Atmel AT89STK-11 development kit, which seems to be archiac, and Atmel Studio 6 won't even work with the bugger. So I dont know if going through the effort prototyping with the Arduino is going to help me. The Atmel 8051 is based on C and I am wondering if writing all the code in Arduino IDE and then massaging it over to straight C is going to be easy or should I just use the Compiler that came with the Atmel 8051. I know the libraries and pin outs will be different and thats kind of a worry for me.
writing all the code in Arduino IDE and then massaging it over to straight C is going to be easy
If you stuck with plain C and didn't use any Arduinoisms and AVR-specific code (PORTx for example) it should port without too much work, but I like fungus' idea.
8051 have some significant advantages over avr. this is reflected by the almost universal usage of 8051 in most chinese mid mcu based products. also nearly all intelligent peripheral ics like rf transceivers, player codecs, etc have at least one 8051 core sometimes multiple. although its not on my personal list of favorites (2nd worst instruction set in the world) admittedly there are benefits.
avr tiny2313 and mega8515 are drop in pin compatible replacements for the original 8051 and both are easily programmed via arduino or naked gcc. there are other 8051 pin compatible avr but not so easily adapted software-wise as these.
Thanks for the advice. Your correct that the 8051 is used all over in china. And there really no instructions out there for it. If I can get the mega8515 can I use the Arduino IDE to program the chip then drop it into a board??
johnpaulperron:
If I can get the mega8515 can I use the Arduino IDE to program the chip then drop it into a board??
yes, if your 8051 was 40 pin. 2313 and 8515 use "classic" instruction set, memory map, and architecture similar to the venerable mega8 which was the original arduino chip. setup for arduino "ng" and minor changes like signature and fuses to the config files and it compiles ok. of course more recent members like mega328 or 1284 have a few more features but turn them upside down and they all look alike.
pete, i dont want to mention any names but first letter is 'P', middle inital 'I', last letter "C'. lol!
Hmm. Intel sub-licensed the original technology to "many" second sources, and all the relevant patents have expired, leaving the IP unencumbered by licensing restrictions?
ATmega8515 should be pin-compatible with classic 8051 chips as well, shouldn't it?
You're lucky you have a C compiler for your 8051; those are pretty rare. The 8051 is not very C-friendly.
Unless you replace the chip. Arduino prototyping is probably only useful for experimenting with and debugging high-level algorithms. In addition to being a different architecture, I think that the 8051 peripherals (timers/etc) are substantially different from AVR peripherals.
There are professional C tools on the market - ie. IAR for 8051, Keil uVision 8051, etc. So your company may invest in
The 8051 clones are popular as there are 2 or single clock/instr. variants (and fast - up to 150MHz clock), and the core is simple and small - therefore easy to embed into a SoC.
Also you may use "banking" with most modern C compilers so you can run up to 4-16MB large application with an external RAM and FLASH memory - depends on the C compiler - see above IAR (up to 256 banks of RAM and FLASH) or uVision (up to 64 banks)..
I toyed with DS89C450 (33MHz, single cycle 8051), programmed in C, tried "trig float math", against the same on arduino (16MHz). Still the atmega has been much faster.
Dallas: 1317usec per loop @32MHz
Atmega: 845usec per loop @16MHz
PS: Keil C51 with above Dallas(Maxim): with 4x32kB large arrays in an external ram (4 xbanks 32kB each), a random access to a long or single float array element (32bit) happened in 4.5usecs @32MHz clock..