Hello saurabhreigns,
I cannot be sure what the problem is given the information you have provided, so I will make some comments. I am not familiar with the SLK, but I have built more than one programmer from scratch for programming the AT89S52. As I mentioned in the original post, the AVRDude script was simply lacking the necessary delay for a proper chip erase. Once I corrected that, programming the AT89S52 using a USBASP programmer via AVRDude worked very well.
The pin connections you describe are for ISP (in system programming). For this to occur, the target device must have a stable clock with a closed reset switch. Also, make sure nothing is interfering with the SCK, MISO, and MOSI lines. It is ok to share these lines with other hardware for your project, but you need to be aware of their states during programming so they can be properly used. You must also have properly set fuses for your programmer's AVR. There are several possible combinations, but for USBASP, you need to use the following:
For example, for ATmega8:
DEFAULT
LFUSE 0xE1 1110 0001
HFUSE 0xD9 1101 1001
USBASP
LFUSE 0xEF 1110 1111
HFUSE 0xC9 1100 1001
Given that you seem to be having a "no programmer found" error, I am guessing that one possibility is that your USB driver is not loading under Windows. This is a frequent complaint with modern 64-bit windows versions and unsigned USB drivers. I am not saying yours is unsigned, but it is worth looking in to.
For 64-bit operating systems, various unlicensed or unsigned USB drivers may not work by default. One way to get the driver to load is bring up the kernel menu during boot time for Windows by pressing F8 repeatedly just before you see the "Starting Windows" screen. Then from the boot menu, make the selection "
Disable Driver Signature Enforcement".
For clarity, here are the versions of the software that I use to program the AT89S52 under Vista x64:
WinAVR version 20100110
avrdude-mingw32-v5.10svn built with
libusb-win32-device-bin-0.1.12.1
libusb - DriverVer = 03/20/2007,0.1.12.1
An ATMEGA8-based
USBASP programmer. I built this one:
http://www.8051projects.info/resources/usb-8051-avr-programmer.23/
The only difference is that I used a
2k2 resistor instead of the 1k5 R2 that is listed in the schematic listed.
This schematic is also very helpful for bulding this circuit:
http://www.fischl.de/usbasp/
The USBASP firmware I use in my programmer is the one that came with the USB 8051/AVR programmer project. (The first URL)
Newer versions of the firmware may not work for the AT89S52 without modification. Perhaps others can comment on this, but I have had good luck with the
2006-07-18 release.
Here is the modified avrdude.conf section specific to the AT89S52:
#------------------------------------------------------------
# AT89S52
#------------------------------------------------------------
part
id = "8052";
desc = "AT89S52";
signature = 0x1E 0x52 0x06;
chip_erase_delay =
500000;
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";
;
;
#------------------------------------------------------------
You can build it with a similar command to this: Software\AVRDude\avrdude-mingw32-v5.10svn\bin\avrdude -W -C Software\AVRDude\avrdude-mingw32-v5.10svn\bin\avrdude.conf -p AT89S52 -c usbasp -e -U flash:w:"filename.hex":i
I cannot say much positive about progISP as I had mixed results with it when I tried it some years back.
In fact, for the AT89S52, it did not work reliably for me.
ISPProg by Adam Dybkowski works beautifully for the parallel port, but I do not think he maintains the project, but if you build yourself a cable like this one, which I have, it does work: **broken link removed**
The AEC_ISP parallel port pinout works with AVRDude and ISPProg. ...if you should ever want to do something with DOS and the parallel port, I have tried this and it works: and
Some will say that building your own programmer is not worth the trouble and in some cases they are certainly correct, but for me, the learning experience has been valuable.
Regarding the programmer you purchased. If they are unwilling to support it, strip what you can from it for spare parts and throw away the rest. There are many ways to program the 8051, but the AT89S52 is most convenient with the ISP which gives you more options. Just make sure if you spend money for a programmer again that the USB driver that comes with it specifically supports Windows 7 x64.
Otherwise if you are willing to build your own using the resources I provided, you only face the minimal inconvenience of selecting "Disable Driver Signature Enforcement" from the boot menu.
I hope that you can find any of this to be helpful.
- - - Updated - - -
I, then unplugged and replugged into another USB cable - i got success, 2nd time- ERROR
again replugged - SuCCESS. 2nd time - ERROR.
This type of intermittent USB related communications issue is the same type of issue that would present itself if one tried to build a USBasp programmer but neglect to use the the proper pin for the microcontroller interrupt that is necessary for proper USB event handling.
If you have to keep reconnecting the USB device in order to get interrmittent at best functionality then I am guessing the company's design is flawed (not likely, but certainly possible), there is a hardware or software issue with the programmer itself, or there is a communications issue with the atMega8 you are using.
Anyhow, I wanted to comment again because I once interfaced with a different pin than the one shown in the
USBasp schematic which resulted in very similar intermittent USB communcations issues when using the
V-USB firmware.