AVR-ISP500 - Some AVR 8-bit MCU's not recognized

Started by 4c3t, November 27, 2020, 02:55:07 am

Previous topic - Next topic

4c3t

Hi.
Brand new user of the AVR-ISP500, and quite new to the realm of AVR's.
I bought this since I've started a project of rebuilding a washing machine, and I did the mistake of buying a couple of MEGA328PB-MCU's, of which one worked for one upload, then refused to work after that.

After some deliberation, some Q&A's from a FB page, I gave up and switched these to a couple that I had sitting on Pro Mini-modules.
They worked and I could program them using Arduino IDE without problems.

I let them lie around for about two weeks, as I was ordering some more stuff for the project, and when I then went on to test a display with some sample code to see if it was working... Well. Suffice it to say that the upload went like usual, but it was unable to verify the data written, so I tried again. Same result...

Next, I opened up AVRDUDESS to check, and I hit the Detect button, and it was unable to find anything, so I asked people on FB, and they thought that the Bootloader might have been corrupted.

I forgot to mention a few things.
One of the MEGA328P from the Pro Mini's was 3.3V, 8 MHz, the other 5V, 16 MHz.
The 8 MHz one was giving me the finger.

As a programmer, I used an Arduino MEGA168 as ISP with the standard Arduino-sketch, except for a modification where I put a relay to switch between 3.3 and 5V, and an input to sense the voltage. Small code with a reset-function, should it accidentally be switched.
Nothing that would interfere with normal operations, I think. Very basic code, nothing that uses delays or anything.

Ok, moving on.

I also have another MCU, transplanted from a MEGA2560 Chinese clone board.
This one works without problems, and I've been able to upload programs numerous times. It has even (prior to transplant) survived a ground loop-back failure (due to bad design on my part) from 230V, so I'm amazed that it worked, considering the density and number of pins and all.

Now. What I don't understand is why my AVR-ISP500 cannot detect this MEGA2560, while it finds the MEGA328-module.

To clarify:
One 328 sits on module
One 328 soldered onto PCB
One 2560 soldered onto PCB

From my retailer website it clearly says:
"AVR-ISP500 is a fast and reliable USB AVR programmer, and works directly with AVR Studio. It is recognized as a STK500 programmer and programs all AVRs. It emulates USB CDC so no drivers are required and works under Windows, Linux and MacOS. If you do not want to use AVRStudio you can use AVR-ISP500 with AVRdude."

This information is perhaps quite old, and might have been mixed up with another model of the programmer, I don't know, and I don't think the retailer does either.

On the other hand, the product page here says something else that puzzles me:
https://www.olimex.com/Products/AVR/Programmers/AVR-ISP500/
"This programmer does not power the target! First make sure to get your target powered! If the problem persists:

- Inspect the hardware connections
- Test with different the ISP baudrate (higher and lower)
- Test with another target
"

It most certainly does just that!
I hooked it up to the 328-module, and it lit up like a Christmas tree with it's on-board LED's, so it sure does.

I should mention also that the circuit I'm having trouble with, the soldered 328P, has not really any connections as the display is connected via cable, and has not been plugged in.
There are individual 6-pin ICSP-sockets to the MCU's also.
No pull-ups, except for Reset on each. All examples that I've seen doesn't have this, unless there are other circuits sharing the pins.

Any thought and Ideas to what to do, and why it's not recognizing the MEGA2560?

LubOlimex

Shows us a picture or pictures of your hardware setup with 2560. Make sure all connectors, power supplies, wires and so on are visible.

Upload the picture/pictures to an image hosting web-site and share the links here.
Technical support and documentation manager at Olimex

4c3t

Ok. So, I think I have resolved my problems.
It would seem that this AVR-ISP500 is perhaps broken, in some extent, as it were able to power my Pro Mini module earlier, but not now.

At first, I didn't think of measuring the voltage since it did light up said module.
Perhaps it was damaged due the load on the circuit board of mine, which surely wouldn't have been more than perhaps 150-200 mA, tops!

Anyway, I was able to burn the bootloader with the external clock on pin 3 of the 10-pin IDC header connected to the faulty MCU (Not the Pro Mini module!) which I had troble eith earlier.

It was able to detect it, with the bit clock set beyond 125 ┬Ás, and then I could set the fuses and it would seem that it's working now on it's own on-board power supply, and I was able to communicate with it through both my USBASP and Arduino as ISP after that.  :o

It was suggested (by users on Facebook) that since the AVR-ISP wasn't giving more than 2,5V, therefor the voltage level wasn't high enough to drive the crystal (8 MHz), and my guess is due to the fuse setting. Haven't checked the voltage/frequency ratio, and
I don't care, as long as I can program it normally and I have no further desire to play around with these bastard settings. It's insane that Atmel can't have different models for different speeds. I mean, how often does one need to switch these settings, really??? I could understand if there were one model that had all these options, and then other models with fixed values. That would eliminate these horrors. Also, a chip with explicitly dedicated ICSP pins would be super awesome too, but that'll never happen I suppose...

So, right now I'm good I think. Working on a galvanic isolation interface so that I can program this PCB of mine without any risk of damaging either the PCB or programmer. ;)

By the way, I was able to communicate with the MEGA2560 via the external clock, as well as the Pro Mini module the same way, so it's probably not delivering the correct voltage enough to drive the crystals.  :-\