problem with serial programming M128

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

Hi all,

now i have a strange problem.

Two boards with M128 assembled i wanted to reprogram using a serial programmer - all like i´m doing every day. (I´m no nobee)

I erased the AVR´s and wanted to reprogram it. This failed.
Because the program doesn´t run anymore i think they are erased.
every time i want to access the AVR the avrisp says "not accessable - check power and clock..."

power is OK, connection is OK.
So my first thought was that the fuse bits are wrong.
But I can´t read the bits.

When i check the device ID then it says "000102". that´s wrong, it must be "1E...." after every 10-20 tries it shows the correct ID. Once.

After RESET the ID is (almost?) allways correct.

So i tried immediately after reset to program the fuse bits. The AVRISP says that programming was OK. (So it must have been a good communication- or not? When i disconnect and try to programm it gives an error)

I thought of a bad connection. But with a third board (i dont like to erase until the problem is solved) i have no communication problems. I can read everything.

I tried AVRISP and AVRDUDE. - no change
I changed the cable. no change
I can read the device ID only once immediately after reset.
I tried to supply the AVR with external clock - no change.

What else can I try??

Thanks alot for your ideas.

Klaus
********************************
Look at: www.megausb.de (German)
********************************

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

New boards? Slow down the programming clock.

New boards? Check that the /RESET pull-up isn't too strong for the programmer to pull down. (Wrong value resistor mounted--1k vs. 10k?)

Also if there is a transceiver connected to the UART pins, is there a series resistor to RXD0? Disconnect attached circuitry on one of the problem boards.

I'd think a 'scope session would help, especially since you have a "good" board to compare with. I'd start with /RESET signal, then SCK, then the data lines.

Oh, yes, also check the Vcc levels on the "good" & "bad".

Any gunk around the PEN pin? We let it float on our Mega64 designs.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Hi Lee,

thanks for your fast reaction.

No new boards - this and others of the same version i´ve programmed many times.
Reset/ resistor is about 10k to a supervisory chip.
No transceiver, no other circuit on the programming pins.
Scope: good idea - that´s the next.
I hope the supervisory chip does it´s job.
PEN unconnected.

Klaus
********************************
Look at: www.megausb.de (German)
********************************

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

You might still want to treat as a "new" board for this purpose and slow down the programming clock--if there was a mess-up setting fuse bits it may be using internal oscillator at 1MHz. Wild guess.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

I had similar problem with programing atmega168. I used codevision avr. When i tried to read signature every time I got different one. Once in ten times it was correct one. When i connected chip to another PC everything was ok. i used exactly the same programmer and the same software. I guess that it was the matter of PC clock. Strange thing is that i established connection on faster one. If You use ISP programmer also length of wires may make a difference.
best regards

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

Hi Lee,

Yes i did slow down the clock. No change
And i checked with a scope: Clock is OK, data seem to be OK. 0.1/3.0V@3.3V good rise/falltime.

@aircraft:
I´ll try onother PC.
I tried differnt cables. No change.

*****
Strange things go on....something is fooling me:
I read low fuse to be 0x00.
then i tried to programm 0x83 (seems to be OK)
I read back 0x83 - this seems, but only SEEMS to be OK, because:
the "3" should choose internal RC clock of 4MHz.
I expected, that the external XTAL is quiet, but it is not. I oscillates with it´s given frequency with full swing (CKOPT programmed).
When i disconnect the XTAL, then i can´t use ISP. This seems to me that the "0x83" is not correct.

Maybe it´s only time to go to bed - and tomorrow everything is fine - i hope so.

Many thanks for your ideas.
And any further help appeciated.

Klaus
********************************
Look at: www.megausb.de (German)
********************************

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

Hi all,

Now I´ve got one board got to work again.

I don´t know why.

The last error, why the fuses are read "internal RC oscillator" while the external oscillator swings is maybe because the clockbits need a toogle of the reset to be recognized.
Maybe somebody can confirm this.

Thanks alot to everybody.

Klaus
********************************
Look at: www.megausb.de (German)
********************************

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

Hi all,

maybe this can help. I have same problem and found this on MCS website. I will try the solution on my uC.

http://www.mcselec.com/support-c...

Thanks,
Jimmy

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

Hi Klaus,

This smells very much like ringing on the SCK-line. It can work fine for months/years, and all of a sudden this problem pops up.
The effect of ringing is that the target "sees" more than one SCK-clock when there is just one transition. The remedy is: add a small filter to the SCK-line, at the side of the programmer:

SCK  ---- 220R -------------- SCK pin on target
                   |
                  470 pF
                   |
Gnd  ------------------------  Gnd pin

on target

It reduces rise- and falltimes to appr. 100 ns, and that effectively removes the ringing.
Ringing occurs on MOSI and MISO as well, but will be harmless. So you can leave them as they are.

Nard

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

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