Go Down

Topic: Further Upload Problems with ATTiny841 Based Board (Read 1 time) previous topic - next topic

STDummy

Hi Guys

Well, its happened yet again!
I have a (well, around 50 actually) ATTiny 841 based boards I had produced around 4 or 5 years ago. Initially I had problems setting the internal clock fuse and various upload problems
(see here
and here)

After some investigation, DrAzzy sorted it all out for me and everything was just fine. Cue a year or so on and I've now got a repeat of the same problems it seems.

Using IDE Rev 1.8.9.
Attempting to set the internal clock to 8mHz internal (IDE settings as attached ClockSet.jpg) I get the following error message:

Error Message =


Code: [Select]
Arduino: 1.8.9 (Windows 10), Board: "ATtiny441/841 (No bootloader), ATtiny841, Disabled, 8 MHz (internal), EEPROM retained, B.O.D. Enabled (1.8v), B.O.D. Disabled, B.O.D. Disabled, Counterclockwise (like old ATTinyCore and Rev. C boards), Master Only"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Users\Bernie\Documents\Arduino\hardware\ATTinyCore\avr/avrdude.conf -v -pattiny841 -cstk500v1 -PCOM4 -b19200 -e -Uefuse:w:0b11111110:m -Uhfuse:w:0b11010110:m -Ulfuse:w:0xE2:m

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\Bernie\Documents\Arduino\hardware\ATTinyCore\avr/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 5.0
         AVR Part                      : ATtiny841
         Chip Erase delay              : 15000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65    12    32    0 yes      8192   16    512  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: stk500_recv(): programmer is not responding
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

Error while burning bootloader.


and trying to upload the sketch (same IDE settings), I get the same error message.

The file usage part of the error message is too big to place in this post so I've attached it as Files.txt in case it casts any light on the problem.

To me, the error message means there is a wiring fault, but I have triple checked every connection and each one (Vcc, MISO, CLK. MOSI, SCK and Reset) has a good connection from the UNO I'm using as ISP to the target board.

Any thoughts as to what else other than physical connections may be the issue here?

Bernie
If you learn by your mistakes then I am the model pupil

STDummy

If you learn by your mistakes then I am the model pupil

BJHenry

The error message that you posted says that the programmer isn't responding. I'd start by troubleshooting your programmer, rather than the ATTiny board.

STDummy

Hi BJHenry

My programmer is a UNO programmed as ISP. All the connections from the UNO to the target board check out ok, so it's a mystery to me as to what's gone wrong. I tried a different UNO, same result.

I've got round the immediate problem by making a one off custom board with an ATTiny85 that I programmed off board, so my customer is happy - but I'm not!

Cheers
If you learn by your mistakes then I am the model pupil

BJHenry

Hi BJHenry

My programmer is a UNO programmed as ISP. All the connections from the UNO to the target board check out ok, so it's a mystery to me as to what's gone wrong. I tried a different UNO, same result.

I've got round the immediate problem by making a one off custom board with an ATTiny85 that I programmed off board, so my customer is happy - but I'm not!

Cheers
To clarify- you have definitely have the 'Arduino as ISP' sketch loaded onto the Uno, and the 10uF capacitor on the reset line of the Uno?
If it is really an issue and you're building things for customers it might be worth blowing $3 on an actual actual programmer like a USBASP.

STDummy

Yes, the Arduino is definitely set as ISP, I did try a USBASP but even though it appeared in my PC's device manager, the Arduino IDE reported it couldn't see it. It was at that point I decided to produce a one off for this project.
I actually stopped making circuits as a business enterprise a couple of years ago, but this was as a favour to a former good customer.
Still, he's happy with the 851 board but I'm determined to find out what's going on with this problem!
Thanks!
If you learn by your mistakes then I am the model pupil

6v6gt

You seem to have a long history of problems with this development and your programmer appears to work if you program a chip out of circuit. On the target board, are you reusing any of the SPI pins for another purpose, that is have you anything else connected to them?

I spent ages troubleshooting a similar problem, also with an attiny, where I used an SPI pin to directly control the select pin of a motor driver chip (L293). Depending on which manufacturer made the L293 , programming over the ICSP header would either work or fail. I added a 1k resistor inline then it worked reliably.

Maybe include a schematic of that target board.

STDummy

The pin outputs are shared with connections made to an ULN2803a, I wonder if that could be a problem.....
I'll attach a schematic as soon as I can
Cheers
If you learn by your mistakes then I am the model pupil

6v6gt

I just looked back in detail at what I did. I made a direct connection between the SCL pin of an ATTINY84 and the EN1 (enable) pin of an L293D motor driver chip. It sounded harmless and indeed worked on a breadboard and did not interfere with the programmer. When I soldered up the PCB using a different clone of the L293, it could not program the ATTINY84 in place. Cutting a track to the L293D and adding a 1K resistor worked for me.

You can check out chapter 4.1.1 to see if you are in violation of the rules here.

Shared Use of SPI programming lines (PDF  AVR042):
http://ww1.microchip.com/downloads/en/appnotes/atmel-2521-avr-hardware-design-considerations_applicationnote_avr042.pdf

STDummy

Here's the schematic of my board, attached. During programming, none of the power/input or outputs are connected to anything, its just the bare board connected vis ICSP to the Arduino UNO programmed as ISP.

Quote
You seem to have a long history of problems with this development and your programmer appears to work if you program a chip out of circuit.
This is why this is such a mystery. Once I can program one board, it seems I can program any number. If I leave it for a period of time, then I run into these problems again. I wonder if it could be down to the revision of IDE I'm using. I'm currently using rev 1.8.9.
If you learn by your mistakes then I am the model pupil

6v6gt

If, as in post #3, you can program something out of circuit, then it is difficult to suspect either the programmer or the IDE.

If you have designed the boards according that schematic, there is nothing connected to J5, and U2 is a (genuine) ULN2803A which shares a common ground with the ATTINY841, then there is already a 2.7K resistor in series with each base and the input protection diodes should not have an impact. The input capacitance is max 25pF. So, it is difficult to suspect the board.

That doesn't leave much to suspect. However, the application note AVR 042 referred to earlier implies that you should have resistors (>=500ohm if you are using a 5volt programmer) in the SPI lines which go to the ULN2803A, so that is (without too much hope) the next thing I'd try after confirming that the programmer actually works if the ATTINY841 is out of circuit.

STDummy

Hi 6v6gt

Unfortunately I'm not able to program the 841 out of circuit as it's a surface mounted  (don't remember the exact form factor, but it's around ΒΌ" square).

As the only thing I know has changed from last time is the programming lead (I had to build a new one as the previous one got damaged), I'm going to go over it again, even though it seems to connect ok. You never know, could be a dry joint. Unlikely, but I'm clutching at straws now.

Even though the immediate need has now been satisfied, I'm going to keep trying! I'll let you know how it goes
If you learn by your mistakes then I am the model pupil

Go Up