Programmer for AT89S2051 etc.

Go To Last Post
79 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are several 8051 development boards or kits from China.

 

But think about what projects your students might want to learn e.g.

UART

PWM

ADC

I2C

SPI

LEDs

16x2 LCD

128x64 Graphics LCD

...

 

They can all be done with a modern 8051.   But you may need extra parts like programmer, RS232 cable, external modules, ...

 

When you start to think about it,   a ready-made Arduino Uno, Nano is cheap and attractive.   i.e. one USB cable connects to student's PC.

Likewise an XMINI or Curiosity board for AVR.

 

Or if you really want 8051,   a Silabs evaluation board.

 

Arduino might be the best choice for student "enthusiasm".   But you will probably "lose" a lot of hardware boards.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:
Yes, the 8051 is very widely used in Asia,
Some USB 8051 by ones at WCH are of note.

Who-me wrote:
 and even in USA Silabs ...
and Infineon acquired Cypress Semiconductor

 


WCH MCS-51(8051) USB MCUs | AVR Freaks

 

GitHub - djmuhlestein/fx2lib: Library routines for creating firmware for the Cypress FX2 (CY7C68013 and variants) with SDCC

EZ-USB™ FX2LP - Infineon Technologies

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I decided to buy this:

https://www.aliexpress.com/item/...

it is cheap and supports AT89S2051

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:

I would like to use AT89S2051 processor. Which programmer I can use ? 

USBISP AVR Programmer ?

Beside offline books,Here's the basic starter webpages for 51/52 families.

https://www.kswichit.com/

 

Brian Fairchild wrote:

According to this page...

 

https://www.pocketmagic.net/chea...

 

...a USBAsp, when driven by Avrdude, will program the AT89S2051.

 

Job done.

 

Just added the scripts ,like :

https://www.avrfreaks.net/commen...

Since S2051 then yes,work with AVRdude if you bought the:

https://www.pocketmagic.net/chea...

It works when I used in the past.Right know I'm building the Parallel programmer that work's for C 51/52,etc families.

 

Who-me wrote:

JerryMouse wrote:

 

I found this:

https://www.rathlev-home.de/mc/m...

 

 

 

That could be worth exploring. 

It has a ISP program that the docs say maps like this  - it needs a USB-Serial 5V adaptor, which you hopefully already have.

 

( SCH has DTR - RST, or that can be manually held hi during PGM I think )

 

So you could connect a AT89S2051/AT89S4051, and see how far you get ?  

That will not be fast, as it just wiggles serial lines ( ie - a bit slow on FS-USB UART bridges, a little faster on HS-USB Bridges.)

 

It should be able to read SIG bytes of AT89S2051/4051  - you could contact the author, with your progress test results ?

 

There is chatter about AT89S support via AVRDUDE, and it seems it was added  (some comments about needed reset polarity choice, but it also seems you can manually hold RST HI during pgm  ?) 

PC control is nice to have, as you can code/download/run faster. 

 

It also work with USB to serial,this way without change the avrdude.conf file cause the scripts already there.

 

Simonetta wrote:
This processor has not been used in new designs for about 25 years.  It belongs in a museum.

 

JerryMouse wrote:
ok, 8051/52 is almost 45 years old technology, but it is still in production. there is a lot of manufacturers producing this "old" technology ..

 

Nop,Still in producing.The AT89S very available at third countries.

C51 cost around 0.45 US$ in C2051SI,meanwhile S2051-PI around 1 US$.So yes,economical for Third countries.

 

Who-me wrote:

If your students want to also build something, as part of their learning, search Aliexpress for Digital clock DIY or similar.

There, you will find many low cost kits, most of them based on 8051 DIP controllers (Atmel AT89, STC STC15 ) 

 

A lot of projects could be used basically 8051 processosr.Such as Modbus slaves,GPS to GSM tracker,SMS sensors notification,Packet radio modem,also Internet Web sensors,etc

The last two already experimented at Czech republic.

 

gchapman wrote:

Who-me wrote:

Yes, the 8051 is very widely used in Asia,

Some USB 8051 by ones at WCH are of note.

 

 

Who-me wrote:

 and even in USA Silabs ...

and Infineon acquired Cypress Semiconductor

yes

 

JerryMouse wrote:

I decided to buy this:

https://www.aliexpress.com/item/...

it is cheap and supports AT89S2051

So,you must added scripts at Avrdude.conf to support the S2051.

 

JerryMouse wrote:

The biggest problem is that this processor has

ISP capability but it is not included in MicrochipStudio.

  AVRdude with MPLABX https://gallery.microchip.com/pa...

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

Last Edited: Mon. Feb 7, 2022 - 12:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
if you really want 8051,   a Silabs evaluation board

+1

 

SiLabs parts have on-chip debug.

 

Also (last time I looked) SiLabs give you a free full Keil licence for use on their chips.

 

And they have active forums.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How can I add  Avrdude.conf  ??? From where I can download it ?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Silabs looks nice but very expensive

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:
How can I add  Avrdude.conf  ??? From where I can download it ?

 

https://www.nongnu.org/avrdude/

 

 

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

  AVRdude with MPLABX https://gallery.microchip.com/pa...  

 

I can not download it ... maybe there is a problem ... :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

test

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

wooooou "download" button :) :) :) :)  and is working :) :) :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:

How can I add  Avrdude.conf  ??? From where I can download it ?

Check when your programmer arrives if it has links to a CONF file.  Hopefully, they deliver what they claim :) 

 

Otherwise, you need to append the standard AVR conf, with AT89 chip infos,  or probably better, create a new conf file you specify on the command line - that way avrdude updates do not erase your AT89 info

 

See my post #44 that links this file

 

https://www.avrfreaks.net/sites/...

 

that file avrdude.AT89 is a new conf file for avrdude, & has  these parts defined

    desc             = "AT89S51";
    desc             = "AT89S52";
    desc             = "AT89S53";
    desc             = "AT89S8252";
    desc             = "AT89S8253";
    desc             = "AT89S4052";  << typo, they really meant AT89S4051 ?
    desc             = "AT89LP4052";    
with the AT89S4051 info, you can create a new AT89S2051 entry 

AT89S4051: Address 00H = 1EH 01H = 43H 02H = FFH  size            = 4096;  << defined now, 4k,  1EH 43H 

AT89S2051: Address 00H = 1EH 01H = 23H 02H = FFH  size            = 2048;  << you need to add, by copy 4051 and edit Sig and Size.

 

called like this  

avrdude -c usbasp -C avrdude.AT89 -p AT89S52 -B4
Last Edited: Mon. Feb 7, 2022 - 08:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, thanks. It will take many monts to deliver the programmer from China to my country. I guess .. .maybe May/June :)

Once, the programmer will be delivered, I try it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:

ok, thanks. It will take many monts to deliver the programmer from China to my country. I guess .. .maybe May/June :)

Once, the programmer will be delivered, I try it.

You can (hopefully) try things right away, once you have avrdue and an AT89 config file, as some of the avrdude programmer options are like this 

Valid programmers are:
  c2n232i          = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts
  dasa             = serial port banging, reset=rts sck=dtr mosi=txd miso=cts
  dasa3            = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts
  ponyser          = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts

Those connects UART data and handshake lines, (I've not tested this on USB-UARTS, but hopefully they have **)  and will be v-e-r-y s-l-o-w, but does allow you to download led flashing routines etc to confirm everything works :)  

 

**Addit: Ah, I find this pdf https://www.hackerschicken.eu/ww...

It says dasa3 option works, with USB-UART, and gives waveforms and times  "The programming and verification take one minute for 114 bytes in a tiny13A" 

Notice in the dasa3 SCH, the pdf shows SCK = RTS (pin 7, connected to pin 6 DSR)  and I think that read-back is important.

If you have a TTL level cable those can invert.

 

When I've tried pin-wiggling on USB-UARTS, it is best to send-then-check with a physical readback, as the long buffering in modern OS and USB take varying times. Hopefully, avrdude is doing that ?

 

The avrdude.conf has this info, so it looks like you might be able to flip any pin with a prefix ~, to match TTL/Clamped232/Reset polarity of AT89, and it seems command line can also (re) define and flip pins ?  ***

 

A scope should make this quick.

programmer
  id    = "ponyser";
  desc  = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts";
  type  = "serbb";
  connection_type = serial;
  reset = ~3;
  sck   = 7;
  mosi  = 4;
  miso  = 8;
;

programmer
  id    = "dasa3";
  desc  = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts";
  type  = "serbb";
  connection_type = serial;
  reset = ~4;
  sck   = 7;
  mosi  = 3;
  miso  = 8;
;

Addit ***: I find this https://learn.adafruit.com/ftdi-...

and that confirms editing ~ prefix settings for a TTL-RS232 ( so all pins flipped to compensate for no RS232 level inverters), for AVR;  For AT89 you would use reset = 4;

Their screenshots confirm roughly 100 seconds per kilobyte write speed (on AVR) - good enough for proof of hardware, and enough for anyone in a real jam, but not something you'd pick as a first choice :)

You can do something educationally useful in 12 bytes 

 

#
programmer
  id    = "ftdifriend";
  desc  = "design ftdi adatper, reset=dtr sck=tx mosi=rts miso=cts";
  type  = serbb;
  reset = ~4;
  sck   = ~3;
  mosi  = ~7;
  miso  = ~8;

 

Last Edited: Mon. Feb 7, 2022 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As long as with S chips.Which mean ISP capability.Then programmer only need MISO,MOSI,Reset,SCK.

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, I will try it but I have nothing right now. No USB-RS232 cable ... nothing.

I sent the order for AVRISP programmer:

 

https://www.aliexpress.com/item/...

 

and also other things but several of the orders were not sent because of the manufacturers/sellers "malfunction".

The programmer I ordered is probably NOT capable to operate together with AVRDude, but I have PROGISP 1.72.

 

On the other hand, the programmer can be re-programmed with USBasp ThomasFischl source code inhere:

https://www.fischl.de/usbasp/#ga...

 

so in the worst case I will reprogramm it. It means that I will probably need one more programmer :) :) :) :)  it is nice ..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had that in the past.And worked with AT89S51 and AT89S52 via AVRdude.

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How's with anothers(S51/S53/else)...?

part
    id               = "8052";
    desc             = "AT89S52";
    signature        = 0x1E 0x52 0x06;
    chip_erase_delay = 20000;
    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                       "x x x x  x x x x    x x x x  x x x x";

    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                       "x x x x  x x x x    x x x x  x x x x";

    timeout      = 200;
    stabdelay      = 100;
    cmdexedelay      = 25;
    synchloops      = 32;
    bytedelay      = 0;
    pollindex      = 3;
    pollvalue      = 0x53;
    predelay      = 1;
    postdelay      = 1;
    pollmethod      = 0;

    memory "flash"
        size            = 8192;
        paged           = no;
        min_write_delay = 4000;
        max_write_delay = 9000;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
        read            = "  0   0   1   0    0   0   0   0",
                          "  x   x   x a12  a11 a10  a9  a8",
                          " a7  a6  a5  a4   a3  a2  a1  a0",
                          "  o   o   o   o    o   o   o   o";

        write           = "  0   1   0   0    0   0   0   0",
                          "  x   x   x a12  a11 a10  a9  a8",
                          " a7  a6  a5  a4   a3  a2  a1  a0",
                          "  i   i   i   i    i   i   i   i";
   mode      = 0x21;
   delay      = 12;
      ;

    memory "signature"
        size            = 3;
        read            = "0  0  1  0   1  0  0  0   x  x  x  0   0  0 a1 a0",
                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
      ;
  ;

 

Yes. All you do for the AT89S51 entry in the avrdude.conf is 

part
    id               = "8051";
    desc             = "AT89S51";
    signature        = 0x1E 0x51 0x06;
...
    memory "flash"
        size            = 4096;
...
        read            = "  0   0   1   0    0   0   0   0",
                          "  x   x   x   x  a11 a10  a9  a8",
                          " a7  a6  a5  a4   a3  a2  a1  a0",
                          "  o   o   o   o    o   o   o   o";

        write           = "  0   1   0   0    0   0   0   0",
                          "  x   x   x   x  a11 a10  a9  a8",
                          " a7  a6  a5  a4   a3  a2  a1  a0",
                          "  i   i   i   i    i   i   i   i";
...

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

Last Edited: Thu. Feb 10, 2022 - 01:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am afraid that I do NOT understand. It is part of AVRDUDE.conf file ??? So, can you send me

complette config file containing infos for ALL microprocessors including AT89S2051 etc.

Not only scraps ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:
I am afraid that I do NOT understand. It is part of AVRDUDE.conf file ???
 Just download the AVRdude then Added that script to AVRdude.Conf. Or WinAVR which already bundled with AVRdude.I never had S2051 only C2051 which programmed with Sistudio DOS parallel port programmer.Cause the price for S2051 similiar to S52/S1 but had more memories and pins.

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

Last Edited: Thu. Feb 10, 2022 - 01:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

by the way I noticed dtaha there is NO support for AT89S2051 in the AVRdude.Conf file

https://github.com/arduino/ardui...

 

have you config data for AT89S2051 ???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:

by the way I noticed dtaha there is NO support for AT89S2051 in the AVRdude.Conf file

https://github.com/arduino/ardui...

Just edit the script for AVRdude.conf for S2051...I never used S2051 only C2051 with SIstudio DOS that I mention earlier.#71

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

JerryMouse wrote:

I am afraid that I do NOT understand. It is part of AVRDUDE.conf file ??? So, can you send me

complette config file containing infos for ALL microprocessors including AT89S2051 etc.

Not only scraps ...

You do not have to edit avrdude.conf, you can better place conf info into a separate file and command line point to that ( -C AT89S_AT89LP_avrdude.conf )

If you edit avrdude.conf, and then later update avrdude, oops, your edits are overwritten - better to have a batch file + conf you simply give to anyone who already has avrdude. 

 

I linked above to a CONF file that has AT89S4051  which is the sibling part to AT89S2051, so needs minimal edits (2 places I think, sigbyte ID and code size ) 

Attached is that file renamed to an obvious-name AT89S_AT89LP_avrdude.conf and edited.  ( Someone else may have already a proven/tested AT89S2051 conf ? )

 

JerryMouse wrote:

by the way I noticed dtaha there is NO support for AT89S2051 in the AVRdude.Conf file

https://github.com/arduino/ardui...

Correct, see above, That is why you are best to use a new, separate conf file for AT89S_AT89LP

Attachment(s): 

Last Edited: Thu. Feb 10, 2022 - 08:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could used MPLAB X-IDE 6 with another AVR chips and AVRdude(Beside Atmel Studio) https://www.avrfreaks.net/forum/come-join-us-mplab-now-supports-avrs 

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to conclude my many weeks/months long effort to find suitable and cheap programmer for AT89S2051.
There is my story:

 

1/ I selected apparently easy way - I ordered USBASP programmer from Aliexpress + 2 pieces of AT89S2051 + crystal 16MHz
+ small PCB 7x5cm with holes + connectors + ZIF socket etc.
After 8 weeks waiting I received the programmer - blue printed circuit board. :) ghastly sexy.

 

2/ I created my own simple DEV board using the components from Aliexpress.

 

3/ I installed driver for USBASP programmer using Zadig software (https://zadig.akeo.ie/) I found on internet.
I downloaded recommended ProgISP 1.72 and I run it. I connected all together i.e. USBASP + DevBoard + AT89S2051 inside it.

 

4/ And ..... BIG disappointment appeared :) Unfortunately, the ProgISP announced an ERROR - no programmer found.
I received identical errors from AvrDude, eXtremeBurner and many other programming software.
I set to re-test everything ... many times ... and .. finally I was totaly frustrated and desperate.
So, I tried to find a help on AvrFreaks but ... almost nothing ... one respondent offered me a personal help ...
I ordered another USBASP programmer from Aliexpress, but this programmer burned out when I pushed it into USB port - probably
deffective piece.

 

5/ ... after 12 weeks of total "system" frustration .... :) and flaming communication with Aliexpress sellers and AvrFreaks and
with the regular brick from AvrFreaks ... I finally saw the ligth at the end of the dark-tunel ...

 

6/ The regular brick sent me his own 10 years old USBASP programmer + firware (firmware_kbv.hex). Hurey !!! The programmer works !!! :)
Using this programmer and firmware which he sent me (firmware_kbv.hex) I re-programmed the USBASP programmer from Aliexpress using
ProgISP 1.72 and ... wiola ! the USBASP programmer from Aliexpress set to work properly. This means that some (maybe ALL) Aliexpress
sellers selling the USBASP programmers with WRONG and functionless firmware ... maybe yes, maybe no... There is NO way how to use the
single programmer from Aliexpress because it is hardware with functionless firmware. Several Aliexpress sellers sent me BaiduDISK package
for Windows, but everything was in Chinese and I do not speak Chinese - biggest problem. It means that someone (3rd person) has to help. Maybe Arduino
can help, but I did not test it.  Of course, there are many commercial programmers which work perfectly, but many times more expensive.
The chiepest is microe.com - only 69USD + postal charge.
I thought, that if the USBASP programmer has USB connector + Bootloader and ISP capability it can be ITSELF programmed using bootloader
via USB and a writer program (avrdude) under windows/linux, but it is NOT true :(. I need a programmer (or arduino) to programm the USBASP
programmer. it is really very complicated. Yes, there is the fisch.de, but it is, indeed, not possible to order the USBASP programmer.

 

7/ So, I decided tu put on public some useful sw + info which I found on internet, maybe this will help to someone:

 

https://uloz.to/file/E1eiFRAK0Ia...
https://ulozto.net/fm#/detail/xF...

or

https://uloz.to/file/KyxAKOIsGOr...
https://ulozto.net/fm#/my-files/...

 

Content of the rar file: Once a man has fully working USBASP programmer, the recipe "how to" is simple: insert USBASP into USB port of a computer (with e.g. windows)
and run Zadig and select menu Options / ListAllDevices and select USBASP + install driver. E.g. libusbK works for me. For AvrDude there is an avrdude
config file with necessary AT89S2051 definitions +  Microchip Assembler 8051 + AvrDude + AvrDudes (recompiled for W10.NET4.8) + ProgISP 1.72 + many others.
The biggest problem is that a man needs "a programmer" to re-programm the functionless USBASP programmer from Aliexpress.
It is really biggest iffy problem ever. On the other hand, once in far future the Alixpress sellers will understand ....  

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most people here would say "use an AVR because they are easy to work with" (this is, after all, an AVR support board!)

Pages