Can't program ATMEGA328 with MySmartUSB or AVRISP MKII

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

Hi all,

It's been a while since I've done some projects with an AVR, but now I've started one again.

I'm building a 6-channel voltage logger, currently with an ATMEGA168. All works well, but I would need some more codespace to implement SD/MMC support.

I've swapped the AVR with a brand new M328, but my programmer refuses to write the .hex file correctly.
I'm using a MySmartUSB MKII programmer with the latest MyAVR ProgTool (v1.39).
The programmer will find the chip, but when I try to burn the .hex-file, it keeps returning a checksum verification error after programming.

When I read back the code from the chip, I find that some code is written, mostly in the very last part of the memory.

MyAVR.com support replied to my question that my setup should support the M328, "since it is only a memory upgrade compared to the M168".

The M168 still works flawlessly with the MySmartUSB, and an M88 also works in my target board.
In all three cases, power supply is rock solid 5V, checked with my oscilloscope during programming as well.

I've also got the MyMultiProg add-on board, which allows me to program the chips without the need of a target circuit:

But no difference. M88, M168 work flawlessly but M328 fails during verification.

I've borrowed a genuine Atmel AVRISP MKII, which connects to the M168 and M88 without any troubles, but refuses communication with the M328:

Unable to enter programming mode.

Please verify device selection, interface settings, target power and connections to the target device.

I am using AVR Studio 6.0 and the AVRISP firmware is 1.11.

I've tried 4 different M328's, all brand new and purchased through Mouser.com (so I assume they're genuine).

Am I overlooking something here?

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

Studio4 has 328 and 328P. Wonder if there's a difference in prog algo there?

Imagecraft compiler user

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

Studio4's programmer section doesn't have Mega328 on the AVR type pull-down list, but does have Mega328P. The 328 and 328P have different signatures. Fortunately the Studio4's programmer section ignores the different signatures.
Did the programmers at Atmel include a switch to ignore the signature when trying to link to an AVR? Or did they 'improve' on studio4 by leaving Mega328 off the list of chips (but including Mega328P) and then locking up the program if the chip returns a sig for m328 instead of m328p?
Why do M328 and M328P have different sigs when they are nearly-identical ICs?
Is there anyone at Atmel who actually uses the stuff that they pump out?

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

Quote:
some code is written, mostly in the very last part of the memory.

Sounds like you could have a chip 'preloaded' with a boot loader, with Lock Bits in Mode 2. Erase the chip and try again.

Quote:
Why do M328 and M328P have different sigs

The PICO Power version has different features, and a couple more opcodes.

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

Sebastiaan, a brandnew 328 runs at 1MHz. So you need to reduce the ISP-frequency to 250kHz or less. Once you have programmed the fuses for a higher (Xtal) clock, you can resume to full speed ISP.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Studio 6.0 also has the option for 328 and 328P. Both were tested and both don't work. I might want to try Studio 4.0 then, just in case...

About the ISP-speed: if it works with the 88 and 168 then it should also work with the 328, right?
AVR Studio doesn't connect to the chip, but the MySmartUSB programmer does connect to the chip.
When I check the ISP speed with the software that came with the programmer, it supports the four fastest speeds that I can set, but not the four slowest speeds.

About the part that gets written; it's a little different than I thought. I've downloaded some firmware for OpenSprinkler, just to rule out my own compiler.
When I program the chip and read it back, it alternately writes a block and leaves a block unprogrammed:

0000 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0008 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0010 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0018 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0020 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0028 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0030 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0038 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0040 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0048 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0050 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0058 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0060 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0068 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0070 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0078 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0080 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0088 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0090 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0098 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00A0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00A8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00B0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00B8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00C0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00C8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00D0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00D8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00E0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00E8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00F0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
00F8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0100 00 00 30 00 00 00 20 00  ..0.....
0108 00 00 00 06 00 10 20 00  ........
0110 0C 10 00 00 04 04 00 02  ........
0118 00 04 20 00 00 00 20 00  ........
0120 04 00 00 00 00 00 20 04  ........
0128 00 04 20 00 04 00 20 04  ........
0130 08 00 00 04 08 10 20 00  ........
0138 00 00 20 04 08 00 20 00  ........
0140 00 04 00 28 00 04 20 04  ...(....
0148 00 00 20 00 00 04 00 04  ........
0150 00 00 20 04 04 04 20 00  ........
0158 04 00 20 04 0C 00 20 00  ........
0160 00 10 05 30 00 00 20 00  ...0....
0168 60 34 00 00 20 24 00 72  `4...$.r
0170 60 00 60 60 00 20 20 00  `.``....
0178 22 20 00 00 00 00 40 40  ".....@@
0180 00 63 6F 00 73 6E 00 70  .co.sn.p
0188 73 00 76 73 00 63 73 00  s.vs.cs.
0190 76 72 00 63 72 00 70 6E  vr.cr.pn
0198 00 24 46 00 24 44 00 24  .$F.$D.$
01A0 44 00 24 46 00 24 46 3C  D.$F.$F<
01A8 6D 65 74 61 20 68 74 74  meta.htt
01B0 70 2D 65 71 75 69 76 3D  p-equiv=
01B8 22 72 65 66 72 65 73 68  "refresh
01C0 22 20 63 6F 6E 74 65 6E  ".conten
01C8 74 3D 22 31 3B 20 75 72  t="1;.ur
01D0 6C 3D 2F 22 3E 00 24 46  l=/">.$F
01D8 3C 73 63 72 69 70 74 3E  <script>
01E0 61 6C 65 72 74 28 22 4F  alert("O
01E8 70 74 69 6F 6E 73 20 76  ptions.v
01F0 61 6C 75 65 73 20 73 61  alues.sa
01F8 76 65 64 2E 22 29 3B 24  ved.");$
0200 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0208 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0210 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0218 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0220 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0228 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0230 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0238 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0240 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0248 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0250 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0258 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0260 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0268 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0270 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0278 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0280 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0288 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0290 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0298 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02A0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02A8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02B0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02B8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02C0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02C8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02D0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02D8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02E0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02E8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02F0 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
02F8 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0300 00 00 00 00 20 70 60 20  .....p`.
0308 20 00 20 2C 00 24 61 20  ...,.$a.
0310 60 20 20 00 20 62 20 60  `....b.`
0318 21 20 20 44 21 22 20 21  !..D!".!
0320 20 69 60 60 60 20 2C 60  .i```.,`
0328 24 62 60 20 20 28 2A 31  $b`..(*1
0330 20 22 60 60 20 2A 08 00  ."``.*..
0338 20 21 70 61 60 60 30 00  .!pa``0.
0340 00 00 00 20 11 20 22 61  ......"a
0348 60 20 28 20 40 00 02 00  `.(.@...
0350 20 44 2C 60 61 62 21 20  .D,`ab!.
0358 24 02 00 20 00 20 24 00  $.....$.
0360 20 00 20 40 20 20 40 20  ...@..@.
0368 20 40 24 00 24 20 22 60  .@$.$."`
0370 60 20 20 20 32 20 02 00  `...2...
0378 20 40 24 70 21 42 00 20  .@$p!B..
0380 46 24 46 00 3C 73 63 72  F$F...
03A8 3C 73 63 72 69 70 74 20  <script.
03B0 73 72 63 3D 22 70 6E 2E  src="pn.
03B8 6A 73 22 3E 3C 2F 73 63  js">...
03C8 76 61 72 20 6C 72 75 6E  var.lrun
03D0 3D 5B 24 44 2C 24 44 2C  =[$D,$D,
03D8 24 44 2C 24 4C 5D 3C 2F  $D,$L].
03E8 00 5B 30 2C 30 5D 5D 3B  .[0,0]];
03F0 0A 76 61 72 20 65 6E 3D  .var.en=
03F8 24 44 2C 72 64 3D 24 44  $D,rd=$D
0400 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0408 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
0410 FF FF FF FF FF FF FF FF  ÿÿÿÿÿÿÿÿ
etc.

This particular hex-file is around 32K of memory, so almost the complete chip should be programmed.

I've checked the fuse bits, they say to be correct. I can't find a chip-erase function in the MyAVR ProgTool and since that's the only software that seems to connect to my chip, I can't erase the chip.

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

to rule out some things:
- when you connect to the chip , the ISP reports a correct target voltage?
- What programming speed do you use? It should be less than 125KHz (8MHz/32)
- Can you read the signature of the device and is it correct(according to the studio dialog)

-You have not accidentally enabled debug wire?(from the head these chip use DW instead of JTAG, but I can be wrong here)

- what mouser part did you order? (their exact order number) or perhaps check their site again to see if you have not accidentally ordered one with bootloader.
Also you might want to already contact mouser to tell them about the problem you have, it might still be an error from your side, but it might be that more people are facing this and have reported it to them.

groet

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

The AVRISP programmer & AVR Studio 6.0 only reports the error that it can't connect. Voltage can't be read.
The MySmartUSB programmer doesn't show the voltage but my oscilloscope does. :)

Using the MySmartUSB I can read the fuse bits (not sure if it's reliably read though).
* IntRC, 8MHz, CKDIV8 enabled (default 1MHz that Plons was talking about)
* Serial Program download enabled, DebugWire disabled
* Boot Flash section size 256 words.
* BOD disabled.
* Lock bits are all Mode 1.

I've bought the chips in a group buy with several other hobbyists, this should be the link to the purchased article (556-ATMEGA328-PU): http://nl.mouser.com/Search/Prod...

I can't vouch for the ESD-safe handling during re-distribution by the person who organised the group buy; they arrived in an ESD-safe bag, but were punched in a small piece of cardboard instead of ESD safe foam.
Still, 5 failing chips is too much coincidence I think.

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

strange,
the voltage should always be readable as it is done by the ISP and as far as I snow has nothing to do with the actual programming of the chip. even if it is not connected to anything I can still read the voltage (being 0 now)

So my first guess now would be that there is another problem although it seems strange that you can program the other chips.....

I did the following:
I have connected an AVR-ISP-MKII.
started AS6 ( I have 6.0.1996 which I beleive is the latest 6.0 version)
I do not load a project.
Goto Tools menu and open 'device programming'
now you get a new window
I selected tool = ISP MKII (of coarse) device = m328(no p) interface is ISP
press the apply button.
now the window gives a lot more information
next top right there is 'Target Voltaqe" there I press the read button. in my case as I have nothing selected I get a warning that thee voltage is not ok.

could try the above and tell us what happens in your case...
If you have a good voltage then the next step is press the read button on the 'Device signature left of the target voltage box. Then also tell us what happens there....

note that if you use the P version you need to select the other device, but the mouser link gives the non P....

regards

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

Yesterday I've tested the 88, 168 and 328 exactly like you're describing.
* 88 & 168 gave 5.1V and chip signature checked out OK.
* 328 consequently gave the error:

Unable to enter programming mode. 

Please verify device selection, interface settings, target power and connections to the target device.

Indeed I have the 328 non-Picopower variant. To rule that out, I've also tried your described procedure while selecting 328P as AVR model. Same error came up.

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

What *is* the ISP speed ?

What groupbuy ? Peerke's ?

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

But reading the target voltage does not even require the ISP to be connected. all you get then is an error that the voltage is to low, so that at least should work......

You get the error on reading target voltage (I doubt as this does work on my machine) or do you get the error when trying to read the signature?

and like Plons asked:
what is the programming speed (it should be below 125KHz).

There is a thread by clawson that describes what things can be done to revive a dead(supposedly dead) chip, did you try those things already?

What external stuff is connected to the CPU?
large cap on the reset line perhaps?
no bend pins on the m328 that could cause connections to be missing?

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

With the MySmartUSB tool, I can only select the speed from "0" to "7", where the highest number represents the highest speed. The tool can verify which ISP speeds work with the chip, they are said to be 4,5,6 and 7. Speeds 0 through 3 are not selectable.
I've tried all selectable speeds, none of them seems to work.

About Atmel Studio 6.0 and the AVRISP MKII, I'd need to verify when I'm at home because I'm not sure. I didn't change the default settings though.
Will also check the voltage reading again.

@ Plons: The groupbuy was Peerke's indeed.
Browsing Peerke's history, I see that you've bought the same chips in a previous groupbuy, a few months earlier. :wink:
Did you have any issues with them?
I've asked Peerke whether he has had some more complaints, but he hasn't.
So far, I have no reason to suspect him, other than the not-so-professional method of packaging.
Some people received their goods even worse packed than mine, so at least I'd expect more people to have problems and complain, also openly on that specific forum.

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

The TQFP-one's I've got are 328P. And Peerke sent these in their original reel-package. As long as the AVR's are in there, it is very unlikely they are damaged by static electricity.
This was the latest action I participated in: http://www.samenkopen.net/action...
Yours are 328, right ? So not the P-version.
In August 2012 I purchased 328's. Non P. DIP version. Not used yet. Your chips are from the same action ?

Can you look at Sck while programming with the scope ? How long are the ISP leads ? What is the frequency of Sck ? It comes in bursts, btw.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

@ meslomp: In my target circuit there is a 10nF cap to ground and 10k resistor to VCC on the reset pin. Currently I'm testing with the programmer board as shown in the picture a few posts above. Never had issues with that board before. Also, M88 and M168 work perfectly fine, in both boards.

@ Plons:
You've participated in the group buy of August '12 and February '13, while I've participated in the group buy that was running in the middle of that period: November '12.

Mine were the DIP-version, as shown in the Mouser link a few post above.
I assume that the exact same articles from Mouser were sold in both the August and December group buys, so we should have the same product. Do you have an easy way to quickly test your DIP 328's?

I will check the SCK-line later today and that would give us the actual ISP speed.

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

just stupid idea (brain farth...) you are working on implementing fatFs (or sdcard driver as such) you do not accidentally have the SD card connected to the board? As you probably use the SPI pins for controlling the Sd card these pins are also used for programming the board...
I have had in the past a design were I had done the same and ended up with intermitted programming problems as the Sd card would corrupt SPI lines during programming...

forgot:
on another board I had no programming problems, so it seems to be probably chip dependent, as you use different chips this might also be an issue.

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

From the dump of the processor you posted above...does your .hex file really contain some embedded HTML text? (depends what your data logger actually does, of course)

Just looks a bit odd...

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

Quote:
Do you have an easy way to quickly test your DIP 328's?
It's a different batch, so what would it tell us ?
....
Tried it anyway. Arduino HW, Parallel Port Programmer, Bascom: read, write verify, fuses etc etc, all working fine.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

If there is a SDcard on the SPI pins like Marcel suggests ?? ..... what did you do HW-wise to prevent that from interfering with ISP ?

If you really are stuck: you can snail-mail your 328(s) to me, PM the .bin-file and I will have a closer look. And program them. Or jump on your bike and come to Hilversum ;)

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

another thing he could try is to make an oscillator with a mega168 and connect that to the xtal1 pin to see if accidentally the fuses got screwed and he has now selected external oscillator instead of internal RC/xtal(seems to be present on the board he has)

But I did not get a reply on the question if he had checked the Tread made by Cliff (which I can not find back anymore, so probably am massively overlooking)
So there are still some things that can be done before shipping.

not sure where the Op is hiding as Nl is still a BIG big country (when you need to walk from one end to the other it is massive ;) )

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

Marcel, Sebastiaan didn't lock himself out, he "just" has some issues with programming the chips. So I don't see the purpose of injecting an external clock.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

MartinM57 wrote:
From the dump of the processor you posted above...does your .hex file really contain some embedded HTML text? (depends what your data logger actually does, of course)

Just looks a bit odd...


Yes, it would look odd indeed. This is the .hex of a random project I've found on the Internet that has been proven to work on the M328, not my actual own project. Just to rule out any compiler issues on my computer.

@Plons: Thanks for checking your 328's. Indeed it doesn't prove much that yours work and mine didn't, but because Peerke ordered them from the same source as he had ordered mine, it might have said something if yours weren't working as well.

Currently I don't have the SD card connected to the microcontroller, first thing was disconnecting the SD hardware when the chip wouldn't program, since it also uses the ISP pins. So all ISP pins are connected to the programmer only, nothing else.

However, I think the problem is addressed:
The AVRISP in Atmel Studio 6 is set to 1MHz by default after a clean installation, therefore refusing to program the target. I assumed that Atmel would have thought of the fact that not every chip can be read at 1MHz out of the factory and that they would have built in some sort of auto-negotiation mechanism, like in the MySmartUSB programmer (according to the manual). But apparently they didn't.

Since my M88 and M168 were already set to use an external crystal (I've programmed the fuse bits to match my project), they allow entering programming mode at 1MHz in both my target board and the MyMultiProg board.

I've lowered the ISP clock in Atmel Studio to 64kHz and everything works perfectly fine.
It can read the chip signature and it can program the flash correctly. The target board also runs my own simple test-code which simply echoes all incoming RS232 data.

The MySmartUSB MKII programmer however, still refuses to work. ISP speed is set to approximately 66kHz (measured SCK with an oscilloscope).
But still the chip gets written in blocks of 256 bytes with good data, followed by 256 bytes of empty data.
Since the MyAVR support team told me the programmer should work with the M328, I've programmed the chip, waited for the verification error and then read back the .hex from the chip.
I have emailed both files to the MyAVR support team.

I hope they can find out what's going wrong with the MySmartUSB.
If they don't... Well, then I know a nice Atmel branded birthday present! :mrgreen:

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

Quote:
I assumed that Atmel would have thought of the fact that not every chip can be read at 1MHz etc
Assumption is the mother of all FU's.

It took a while for you to find out that you *always* have to check the ISP-speed setting. And that you have to lower it for virgin AVR's. I told you to do so in my first post in this thread.
I hope you learned from this.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Plons wrote:
Assumption is the mother of all FU's.

Yes, indeed!

I had never used Atmel Studio with the AVRISP before and with the MyAVR I never had to worry about ISP speed.
However, now I know. :wink:

Plons wrote:
I hope you learned from this.

Yes I have! :oops:

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

Got feedback from MyAVR, they told me they tested it with an ATMEGA328P instead of ATMEGA328.
Ordered an M328P myself, and it tested out perfectly fine with the MySmartUSB programmer.

So there appears to be a compatibility issue between the M328 non-p and the MySmartUSB MKII programmer.
They couldn't tell me whether they could/would fix this in the programmer's firmware any time soon. I might get an answer on that later.

So I think I'm going to order myself an AVR Dragon.
I've also got a few XMEGA's lying around, which couldn't be programmed with the MySmartUSB anyway.

As far as I can compare online, the Dragon has better features compared to the AVRISP, but the AVRISP might be a little more robust.
Would there be a good reason, other than robustness, to prefer an AVRISP MK2 over a Dragon?

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

Quote:
Would there be a good reason, other than robustness, to prefer an AVRISP MK2 over a Dragon?
Not that I know of.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips