Programmer for AT89S2051, Part 2 :)

Go To Last Post
26 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

today I received my USBASP programmer from Aliexpress. I created a small programming board and I tried to read the signature from my AT89S2051

using the USBASP programmer,  but withnout any success :(. I installed libusbK driver using ZADIG software and the programming software is PROGISP 1.72.

Can someone help me ? PROGISP giving me an error "Chip enable program error". Scheme of my programming board is below + photos of my programmer etc.

 

Jerry

 

 

 

 

 

 

 

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

Try removing the 10uF on the RST line.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

the situation is identical ... identical error .. I am sad :(

 

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

You must keep the 10uF on the Reset line.  But I don't see a 10k pulldown on the Reset line.

Nor do I see any 100nF capacitors on the VCC line.

 

What happens when you read the Signature ?

 

I really don't want to trace your wiring by eye.

But you can check everything against your schematic.

 

I am intrigued.   Your protoboard + ZIF + buttons + jack + 5x2 header + AT89S2051 cost MUCH more than buying a Uno clone.

 

The Uno clone would be much better for your students.   As well as avoiding the USBASP or hand-soldering time.

 

David.

 

 

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

it is suspicious, I think that I am heavy frustrated :(

AVRDude shows me an error too.

 

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

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

ok, I modified the scheme, but situation is identical. :(

 

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

 

Go on.   Reset is active-high on an 8051.  Which means that you need a 10k + 10uF RC on the Reset pin (with 10k pulling to GND)

 

You seem to have chosen AT89S2051 for some reason.   Why not read the AT89S2051 datasheet?

 

I would be pretty confident that Progisp1.72 will work correctly.   But first off,  you must connect all the signals correctly.

 

 

Note that the USBASP should provide the correct RST signal levels when controlled by Progisp1.72

i.e. you connect RST pin to pin#5 on the USBASP.

 

I don't possess an AT89S2051 or AT89S4051.   So I can't try this for myself.

 

David.

 

Edit.  Are you sure that you have 10pF capacitors for the XTAL ?

10nF or 100nF ceramic capacitors all look very similar.

I would be happier with 22pF than 10pF.

You should see a clock signal on XTAL2 pin if you use a scope with X10 probe.

 

Last Edited: Sat. Mar 5, 2022 - 06:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JerryMouse wrote:

ok, I modified the scheme, but situation is identical. :(

I do not see a Vcc-Gnd decoupling cap shown ? 

 

That shows 5V hard wired to RST, It's probably better to just connect to USBASP, or if that seems to wiggle RST wrong, then use a push button, or SPDT switch.

 

As well as #7, the docs also say

 

Execute this sequence to enter ISP when the device is already operational.
1. Bring SCK (P1.7) to GND.
2. Tri-state MISO (P1.6).
3. Bring RST to “H”.

 

ie is it important the rising edge of RST sees CLK low.

You can check XTAL is oscillating with a multimeter and a fast diode (1N4148 / BAW62 etc)  - a shorted crystal gives just under 50% Vcc and a working crystal gives just under Vcc.

 

What does a scope say about USB ASP signals on RST/SCK/MOSI

Last Edited: Sat. Mar 5, 2022 - 08:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

never mind, I supposed that this my "trial" will probably fail ...

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

Discharging a 10uF cap via a chip's pin probably destroys the pin.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

10k + 10uF is the "standard" reset circuit for 8051.

 

I think you will find that 8051 external programmers are quite capable.   After all,  this only happens a few 100 times in a typical 8051 life.

Likewise,  the Reset button on a typical 8051 is only going to be a few 100 times.

 

If you want to play safe,  you can use a 47R or 100R to "short" the Reset pin to VCC.

 

A similar argument can be made for the 100nF on a typical AVR.

Both for external programmer and for Reset button.

 

David.

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

1.  do you possess an oscilloscope ?

2.  do you possess an Arduino ?

3.  do you possess any 100nF capacitors ?

4.  do you possess a DMM ?   (or some method to test wiring connections)

5.  can you verify whether the XTAL capacitors are 10pF ?

 

 

I tried running Progisp1.72 on Win10-64.

I had to uninstall the existing USBASP driver because it did not recognise [PRGISP] box.

Then run Progisp1.72 and plug in the USBASP.   This must install a suitable driver because I now see [PRGISP] and [USBASP] highlightled.

 

I can successfully read and program both AT89S52 and ATmega8515.   i.e. both 8051 and AVR

 

I would be 100% confident that your AT89S2051 should work since your screenshot in #1 shows [PRGISP] and [USBASP]

i.e. press the [RD] button or Command->Read_Signature.

 

In other words.   Check your wiring.

 

David.

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

ok, I finally found the reason why the programmer is not working. the programmer I bought at Aliexpress is deffective. :( I am sad, I sent a new order for a new programmer :)

Aliexpress returned me money 5 USD.

 

Last Edited: Sun. Mar 6, 2022 - 09:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on.   You can buy Chinese USBASP dongles from anywhere.   I bet that Czech hobbyist shops stock them.   German and UK online shops certainly do.

And I am sure that you can borrow one from a neighbour.

 

But the first step is to answer my questions in #12.

It does not cost much to type a few Y or N.

 

David.

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

1/ there is nobody around me to borrow me anything. I am alone.

2/ I paid for all parts 21.7 USD

3/ I have NO osciloscope

4/ I have NO arduino

5/ I have one 100nF capacitor

6/ what is DMM ?

7/ the 10pF capacitor I bought at Aliexpress, I have no capacity tester/meter - it is too expensive

8/ I installed libusbK driver with use of zadig-2.7.exe

9/ the programmer I bought is deffective, aliexpress returned me money

10/ I will wait for the new programmer and I will see

 

jerry

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

1.  I am sure that there must be several AvrFreaks that live in Czech Republic.

There are certainly some that live in Slovakia.   And lots that live in Germany.

 

Ok, not all AvrFreaks are familiar with 8051.

 

2.   21.7 USD is a lot of money !!

3.   a scope is a luxury.  you can manage without one.

4.   Uno clone or Nano clone is a good investment.  you can buy locally.

5.   you will need several 100nF for any electronics experiment.   buy on Ebay

6.   DMM is Digital MultiMeter.   e.g. measure voltage, resistance, ...

7.   wire-ended ceramic capacitors have a number printed on them.    SMD capacitors require guesswork (or measuring)

8.   that should be ok

9.   Chinese USBASP are generally 100% good.

10.  PM me with your address.   I will mail a free Arduino Nano clone to you.

 

David.

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

ok, my email is jerry.mouse.email@seznam.cz :)

and here are the capacitors and my DMM

 

 

 

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

The 10pF ceramics look ok.

Your DMM looks ok.

 

Seriously.   Print your schematic on paper.   Then check every connection on the schematic with your DMM.   Use a pencil to tick off each end of each connection as you test.

 

Yes,  it will take you 10 minutes to complete your checklist.

 

I could probably trace your soldered wires from your photos.   But it would make my head hurt.

So it is better for you to do this yourself.

 

David.

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

I am waiting for the new programmer I did order at aliexpress shop

 

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

 

this is only way for me ...

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

JerryMouse wrote:

and here are the capacitors and my DMM

Did you check the XTAL osc with a DMM + fast Diode (1N4148 / BAW62 etc)  ?

That will confirm the 2051 is oscillating, which confirms the caps are not massive (or too  small). and confirms  it is powered ok.

 

JerryMouse wrote:
3/ I have NO osciloscope

 

There is Sw that allows using a PC sound card as a oscilloscope / generator,  which gives coverage up to ~20kHz, and that's a good thing to show your students too.

 

One example (includes a good frequency counter)

https://www.daqarta.com/dqdown.htm

When I last checked, the free mode (after 30 day trial) still did the basic scope/counter/generator, but lost the fancy scripting and more advanced options.

 

This sounds useful too

https://www.nutsvolts.com/magazi...

 

and this says free for education use

https://www.zeitnitz.eu/Scope_en

 

Fire those up on all the PCs you have easy access to, as sound-resource varies quite a lot :)

 

 

Do you have a piezo transducer and CMOS inverters ? - you can use that for activity clicks and the avrdude allows quite low SPI clocks, that you should hear cricket-chirp as it looks for a signature.

Last Edited: Tue. Mar 8, 2022 - 06:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
The 10pF ceramics look ok.

 

david.prentice wrote:
I would be happier with 22pF than 10pF.

 

Ehhmm....

 

The regular value for that 33 PF.

 

Above the 20 Mhz were 22 PF.

 

It will be nice to used AVRdude.

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

Last Edited: Tue. Mar 8, 2022 - 12:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Yes,   I would be happier with 22pF + 22pF for an 18MHz XTAL.   The AT89S2051 datasheet actually says

I would be even happier if the OP soldered his one and only 100nF capacitor directly on the 8051 VCC pin.

He possesses a hundred 10pF capacitors.   So it would be simple to increase the XTAL load capacitors.

 

Incidentally,  the AT89S51 datasheet recommends "higher value" capacitors i.e. 20pF - 40pF

 

I really don't believe that any AT89S2051 oscillator could work reliably with 0pF - 10pF.

And my AT89LP4052 board uses 22pF with an 11MHz XTAL very successfully.

 

David.

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

Jeckson wrote:

 

It will be nice to used AVRdude.

That's not mandatory, in the other thread was this suggestion to simply use the -C command line

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. 

 

 

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

Probably the OP download the zip,extract and running the AVRdude for program.Did AVRdude has new one ? Nop.

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!)

 

(PS cross posting this answer as you cross posted too ;-)