ATTINY102 Programming error while Data pin is connected to load

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

Hello,

I am using AVR ISP MKii Programmer to program ATTINY102 MCU. I have included my circuit diagram below. At first, I saw that when I was trying to program the MCU the programmer showed me this error: "Failed to enter programming mode. Error received from tool: Target connector seems to be reversed".

 

I tried every solution found online but nothing worked then later I desoldered all the resistors from my PCB board and saw that I was able to program the MCU. So I started to solder back resistors, one at a time, and found that "R10" and "R2" were the issues. If any of these two resistors are present on the board then the programming procedure would not continue. These two resistors are connected with the data line "TPIDATA".

 

In the datasheet, it says that the "TPIDATA" pin needs to be at "VDD" potential during programming the MCU. Can that be the issue?

 

Any suggestion on how to solve this issue? I already tried connecting a pull-up resistor in between the "TPIDATA" and "VDD" but it did not solve the problem.

 

 

Thank you.

 

 

 

 

 

Here is my circuit diagram:

 

 

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

Then don't use TPIDATA to control those kinds of loads. Swap them with another pin that has less (lighter) load.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

imtiny wrote:
In the datasheet, it says that the "TPIDATA" pin needs to be at "VDD" potential during programming the MCU. Can that be the issue?
Yes

imtiny wrote:
Any suggestion on how to solve this issue?
S_L and S_M are spare; allocate these to the tiny102 bootloader.

 


TPI Interface | AVRISP mkII

[bottom]

Note:

The TPI interface uses internal pull-ups on the data line. Avoid any pull-downs on the TPI data line.

 

AN42736 AT12498: ATtiny104 Low Footprint Bootloader | Application Note | Microchip Technology

 

"Dare to be naïve." - Buckminster Fuller

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

Thanks, but I am actually using all the pins, some section of the schematic is not included here as they were not relevant to the issue. I guess I'll just use a jumper or small switch and while programming, I'll just disconnect the load. 

 

It's bodge wire/ trace cutting and redesign time  angry

 

Thanks again.

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

imtiny wrote:
It's bodge wire/ trace cutting and redesign time

Before you do the redesign, experiment by wiring the LED & resistor across pins 1&2 of the connectors. (LM+/ LM- ;  RM+/RM-  etc.)

 

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

 

 

The FET gate can draw "high" current with fast gate signal pulses (upsetting the programmer timing, due to slowed transitions). That is one of the few "drawbacks" with FETs..try lowering the programming speed to the minimum.  If that fixes it, then you know adding a few k series ohms at the gate would be a fix.

 

Change your schematic text font to black....medium gray does you no favor.

 

 

Also, did you actually make a connection below...looks like it is not actually connected & an error prob wont be generated, since each net connects to other parts.  This airwire could very well go missing & you'd find out about it when you got your boards.  That is a much bigger issue on a complicated board, where something missing doesn't stand out (and you find out too late).

You find any such missing routes, when you take a highlighter and compare your board layout to the schematic...surprise!  Years ago, we'd sometimes find an unintended airwire was added (& routed), due to some hidden issue with a library part.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Apr 3, 2022 - 09:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, I'll do that as well. A good thing is that I have ordered multiple boards. So even if experimenting with the pin does not give me a solution, I can do all the programming on the experimental board and then will just transfer code to a new board then at the end I'll solder the resistors on the new board.

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

avrcandies wrote:
The FET gate can draw "high" current with fast gate signal pulses (upsetting the programmer timing, due to slowed transitions).
BSS123 capacitance is low; AVRISP mkII has impressive drive current though its series impedance will affect (additional ESD suppression)

AVRISP2 function-likes are less complex and "may" be more TPI effective.

avrcandies wrote:
That is one of the few "drawbacks" with FETs.
Low VCE-sat transistors might be considered for this use case (inherent ESD tolerance, reduced threshold, emitter impedance multiplies by hFE to base)

 


BSS123 - N-Channel Logic Level Enhancement Mode Field Effect Transistor (onsemi)

[bottom of page 2]

[Ciss = 73 pF, Coss = 7 pF, Crss = 3.4 pF typical]

Reset Line | AVRISP mkII

...

Any decoupling capacitor should not be larger than 10μF.

...

AVR-ISP-MK2.sch (Olimex)

[100 ohm series termination]

via AVR-ISP-MK2 - Open Source Hardware Board (Olimex)

AVR-ISP-MK2 Olimex Ltd. | Mouser

 

NSS1C201L: 100 V, 2.0 A NPN Low V<sub>CE(sat)</sub> Bipolar Transistor (onsemi)

DSS8110Y NPN, 100V, 1A, SOT363 (Diodes)

tiny102 leaks 1 micro amp max

200 mV / 1 micro amp = 200 K ohms

A weak TPI data pull-down that tiny102 may pull up enough; emitter resistance aids current limiting though may still need a jumper to open circuit.

Moving LED current into the emitter may be an option, or, a current mirror.

Hopefully a tiny102 program is low on software defectssmiley

Am keen on bootloaders though a bootloader may be a no-go for this case (USB UART can have significant drive current, STK500 has significant drive current and likely also STK600 and MPLAB PICkit 4 [USB CDC ACM for AVR])

DC Characteristics | ATtiny102/ATtiny104 Complete

 

"Dare to be naïve." - Buckminster Fuller

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

BSS123 capacitance is low

Even though it is low, it could still cause high peak switch currents..the faster it switches the higher the peak current, but a higher peak current slows the finite driver switching output...sort of an arm-wrestling match (so they tend to use charge delivered for most discussions, side-stepping this).    

The best thing is to scope the line & see if it looks nice and square.  If not, a 1 k resistor will square up the AVR side, and let the FETs side rise up on its own accord.

It may be that the ISP already has enough hammer to strong-arm the match without a resistor, the scope will tell.

 

Generally, a resistor is connected to the gate terminal of a MOSFET. The purposes of the gate resistor include suppression of inrush current and a reduction in output ringing.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

Thank you all. avrcandies, I should have remembered to add the resistor with the Gate. about the VDD net, I changed the grid size of the eagle a few times, and that's why some of the lines are not snapped in the grid but that Net is properly connected.  gchapman, I never thought the N-MOS capacitance can cause that big of a problem.  I guess I'll do a breadboarding first before the next PCB to test all the theories you guys have shared. But for now, using a jumper is working well for me. I just disconnect the jumper on "TPIDATA" while programming and while testing I just reconnect it to us the GPIO.