Pages: [1]   Go Down
Author Topic: AtMel version of the 8051...  (Read 949 times)
0 Members and 1 Guest are viewing this topic.
South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got to looking at this - AT89S2051 and the AT89S4051 - and from what I can gather from the various pieces of documentation I have seen, with a couple additions to the AVRDude config I should be able to load a program from a .hex file(generated from an 8051 compiler/assembler) using the ArduinoISP. A little different architecture with different abilities, but something more to play with without a major expense for programming. There is even one instance of a programmer that you can program either the AT89S2051 or the ATtiny2313. So I might be well on my way there as I have a small shield that mounts on my Arduino that has a socket for the ATtiny2313, so it might not take much modification to program the 8051...

Something to do this winter...
Logged

More Cowbell
Offline Offline
Edison Member
*
Karma: 11
Posts: 1029
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Personally I don't get the attraction unless you are a company with a huge investment in legacy hardware/code for the 8051.  That's the only reason anyone still uses it.  ATMega does everything better as far as I can see assuming you are unencumbered by what you were doing in the 80s.  If you want a challange, why not ARM yourself?

http://arduino.cc/blog/2012/10/22/arduino-due-is-finally-here/

It looks cooler than sharks with frickin' laser beams attached to their heads.
Logged

Vexatious Sampler

South Africa
Offline Offline
Jr. Member
**
Karma: 1
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Did you get this right? I'm trying to program a AT89S2051 too.

I made an ArduinoISP with a Mini Pro to program the ATTiny45 and the AT89S2051 , but currently can only program the ATTiny smiley-sad

Here is the forum link:
http://forum.arduino.cc/index.php?topic=230144
Logged

More Cowbell
Offline Offline
Edison Member
*
Karma: 11
Posts: 1029
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't know if this will help, but after badmouthing the 8051 I decided to do a small project with one.  And I followed up with a SILabs 8051 compatible and then an AD 8051 compatible too.  Here is the Atmel one:

The programming tool I used is detailed at http://en.wikipedia.org/wiki/MCU_8051_IDE and works well.  I got a few of these chips from a cheap eBay dealer for slightly less than Digikey and got it to work no problem tonight after doing some searches on the Interwebs.  The basic process is write your code, compile it in the 8051 MCU IDE that I linked above, use just about any (e)(e)PROM programmer like my ChipMax 2  (and there are many cheap ones that would work fine) to send up the resulting .HEX file, and use the chip. There is no debugger or ICE for this, you have to move the chip to the programmer and back, but it's quite easy.  Here is the project and my code.  It's simply doing an inverted Night Rider LED animation for the time being.

Code:
; Program initialization
; --------------------
org 0h
sjmp start

delay: MOV R2, #200
outer: MOV R3, #250
inner: NOP
NOP
DJNZ R3, inner
DJNZ R2, outer
RET
 
; Program start
; --------------------
start:
MOV P3, 0 ; enable LEDs 0-5
CLR P1.2 ; enable LED 6
CLR P1.3 ; enable LED 7

loop: SETB P3.4 ; disable LED 4
LCALL delay
CLR P3.4 ; enable LED 4

SETB P3.5 ; disable LED 5
SETB P3.3 ; disable LED 3
LCALL delay
CLR P3.5 ; enable LED 5
CLR P3.3 ; enable LED 3

SETB P3.7 ; disable LED 6
SETB P3.2 ; disable LED 2
LCALL delay
CLR P3.7 ; enable LED 5
CLR P3.2 ; enable LED 4

SETB P1.2 ; disable LED 7
SETB P3.1 ; disable LED 1
LCALL delay
CLR P1.2 ; enable LED 7
CLR P3.1 ; enable LED 1

SETB P1.3 ; disable LED 8
SETB P3.0 ; disable LED 0
LCALL delay
CLR P1.3 ; enable LED 8
CLR P3.0 ; enable LED 0

; circle back

SETB P1.2 ; disable LED 7
SETB P3.1 ; disable LED 1
LCALL delay
CLR P1.2 ; enable LED 7
CLR P3.1 ; enable LED 1

SETB P3.7 ; disable LED 6
SETB P3.2 ; disable LED 2
LCALL delay
CLR P3.7 ; enable LED 6
CLR P3.2 ; enable LED 2

SETB P3.5 ; disable LED 5
SETB P3.3 ; disable LED 3
LCALL delay
CLR P3.5 ; enable LED 5
CLR P3.3 ; enable LED 3

sjmp loop
END

[/quote]

« Last Edit: April 04, 2014, 10:32:20 pm by JoeN » Logged

Vexatious Sampler

Pages: [1]   Go Up
Jump to: