Is this TPI connected correctly? Does USBasp work with it?

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

My board design for an ATtiny10 with TPI connection, to be programmed with an USBasp and avrdude, if it is wrong, please tell me what i have to correct, it is quite hard to find any information about a correct TPI connection with 6-pin devices

 

 

Does this work with USBasp and avrdude? I am worried because MOSI and MISO from the programmer are connected to the same pin of the ATtiny10 (PB0)? Do i need this 1k resistor, how much resistors do i need and where do i need them?

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

Your TPI connector looks completely wrong...but I have never used TPI. Look in the Atmel ICE or other Atmel tools docs for the proper connection.

 

edit

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Sun. Jul 30, 2017 - 11:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most Chinese USBASP firmware does not support TPI.
Some fischl firmware does do TPI but uses different pins to Atmel Programmers.
.
Life is easier if you avoid TPI or use an Atmel programmer.
.
David.

Last Edited: Mon. Jul 31, 2017 - 06:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This application note (http://www.atmel.com/images/doc8...) tells me:

 

The TPI can be accessed via three pins: RESET: TPI enable input TPICLK: TPI clock input TPIDATA: TPI data input/output 

So there have to be two connection lines to TPIDATA because the USBasp programmer has a MOSI as well as a MISO connector?

 

david.prentice wrote:
uses different pins to Atmel Programmers.

 

That's the problem, I would like to know  which pins i have to use but it looks like no one has this done before :(

 

js wrote:
Your TPI connector looks completely wrong...

 

It is not about the correct position of the connectors, i will use seperate connection wires for each one. I would like to know if this would work in general, I think Vcc, GND and TPICLK are connected correctly, but I don't know if TPIDATA is correct.

Last Edited: Mon. Jul 31, 2017 - 07:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know if TPIDATA is correct.

Then look at the datasheet, there is no mystery, and the ICE help shows you the pinout.

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

But if the firmware in your USBAsp does not support TPI then none of this matters anyway.

 

Where did you get the USBAsp. Did the supplier suggest it had been modified with additional TPI support?

 

EDIT: just tried googling around a bit. Quite difficult to find anything but Atmel-ICE that promises TPI support these days but this was the cheapest device I could find that does:

 

https://www.olimex.com/Products/...

Last Edited: Mon. Jul 31, 2017 - 08:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Then look at the datasheet, there is no mystery, and the ICE help shows you the pinout.

 

That's the same picture as in the application note. Because i don't own an ICE or any other Atmel programmer I don't think I can adapt this schematic to my USBasp programmer because this one has two seperate programming connections (MISO and MOSI)?

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

ARP wrote:
r because this one has two seperate programming connections (MISO and MOSI)?
But if the developer of that programmer has added to TPI support to the firmware then when it is run in that mode they'll just use 2 signal wires as TPIDATA and TPICLK. At the end of the day, within the programmer, they are probably just "bit-banging the programming signals so nothing ties the lines to a specific functionality.

 

But this is all dependent on whether that firmware has had TPI support added. What cannot be changed is the 2x3 layout of the pin header so if they have added TPI support they must be doing it in the same way that Atmel show for their own programmers.

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

I have installed Fischl firmware into a USBASP and programmed with TPI.

 

You need another programmer to change the firmware.   And you need to read the Fischl source code to see which pins to use.

 

If you possess an Arduino,   you can turn that into a programmer.  Either for programming your USBASP or as a TPI programmer running on the Arduino.   Read https://www.avrfreaks.net/comment/2229551#comment-2229551

 

David.

Last Edited: Mon. Jul 31, 2017 - 08:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it possible that my USBasp already has the latest Fischl firmware installed? How can I check that? If I take a look in the device manager:

 

 

I don't know if that's just the USB driver or the actual firmware version? I bought it 6 months ago from china, the latest firmware is 6 years old, maybe the latest version is alreay flashed on the ATmega8?

 

I found this in the firmware source:

 

#define TPI_CLK_PORT PORTB
#define TPI_CLK_DDR DDRB
#define TPI_CLK_BIT 5
#define TPI_DATAOUT_PORT PORTB
#define TPI_DATAOUT_DDR DDRB
#define TPI_DATAOUT_BIT 3
#ifdef TPI_WITH_OPTO
#	define TPI_DATAIN_PIN PINB
#	define TPI_DATAIN_DDR DDRB
#	define TPI_DATAIN_BIT 4
#else
#	define TPI_DATAIN_PIN PINB
#	define TPI_DATAIN_BIT 3

So TPICLK is PB5, MOSI PB3 and MISO is PB3 or PB4 (probably depends on 3 or 4 wire SPI)?

Last Edited: Mon. Jul 31, 2017 - 09:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you bought it from China,   you probably get an "SCK Warning".    Chinese firmware sets SCK speed automatically.

 

Did you look at the ScratchMonkey site?  

I had never heard of ScratchMonkey until I read El Tangas's post.

 

Since El Tangas is an experienced member,   he can probably help you with any problems.   However the website looks well written.    Just follow the comprehensive instructions.

 

Why do you want to use a Tiny10?    Life is easier with a Uno or Nano.

 

David.

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

david.prentice wrote:
Why do you want to use a Tiny10?

 

I want to learn the Atmel assembly language and I also like tiny microcontrollers and I don't like Arduino :(

 

Guys, please tell me whether my circuitry for the TPI connector is correct or not (if i use USBasp)...

 

Did you look at the ScratchMonkey site?  

You mean this? http://microtherion.github.io/Sc...

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

Seriously.   If you want to learn Assembly Language,  buy a proper AVR.   The XMINI-328P or XMINI-328PB would be a good choice if you want to use debugWIRE.

A regular Uno clone is fine if you only debug with the Simulator.

 

You do not need to ever run any Arduino software.  But the bootloader makes life so much easier than external programmers and wires.

 

It looks as if ScratchMonkey requires a modified avrdude.exe for TPI to be used with STK500v2 protocol.  It requires Einstein to build avrdude on Windows.

Whereas USBASP with the correct firmware should work with the regular avrdude.

 

David.

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

To be honest, if you want to learn assembler then for 95% of it you don't actually need ANY model of AVR. You can learn  the operation of the vast majority of the opcodes in the simulator alone without ever touching any electronics.

 

But if you are going to use an AVR is the "brain dead" tiny 10 really the right pace to start anyway? It only has half the number of registers of a "real" AVR and it has the smallest subset of instructions going. Like all Tiny it does not have things like MUL but it is more restricted than that even.

 

Something like a 328 is a much better starting place.

 

Guess what , an Arduino is very likely based on a 328. Apart from the bootloader in it (for easy programming) nothing says you have to use anything more "Arduino" about it than that, it's just a good mid range AVR on a well designed board (and they even give you an LED to flash!!)

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

clawson wrote:
without ever touching any electronics.

But that's boring, isn't it? I want to see LEDs flashing because i change some value in a Port Register with assembly :D

 

david.prentice wrote:
Seriously.   If you want to learn Assembly Language,  buy a proper AVR.   The XMINI-328P or XMINI-328PB would be a good choice if you want to use debugWIRE. A regular Uno clone is fine if you only debug with the Simulator.

 

I already have 3 ATtiny10s here and i want to use them. Guys, please just tell me whether this TPI circuit is correct or not :(

Why would Atmel design tiny microcontrollers and no one recommends to use them?

Last Edited: Mon. Jul 31, 2017 - 03:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But you cannot know that until you find out which pins your programmer is driving as TPIDATA and TPICLK (if it even has TPI support and is doing that). Assuming it follows "the standard", that is:

 

Then TPIDATA comes out (and goes in) to the programmer on pin 1 and TPICLK is on pin 3. This:

 

shows (bidirectional) TPIDATA on pin PB0 (5) of the AVR and TPICLK on pin PB1 (1). That is not how you have it wired in the schematic in #1

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

ARP wrote:
But that's boring, isn't it?
Not for me - most of what I do in my professional life is simulation without every touching real electronics. (because in the environment where I work the electronics are usually buried deep in about 1.5 tons of steel, plastic and fabric).

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

I have a couple of tiny9, tiny10, tiny20, tiny40.

 

I think that I programmed the tiny9 and tiny10 chips with Fischl firmware and TPI a few years ago.

It was a lot of faffing about.  i.e. mounting chips on DIP adapters, breadboards, changing USBASP firmware, ...

 

Yes,  your circuit "looks" about right.   1k seems a bit strong for R1.   Your 3x2 header is very stupid.

It is your job to read the data sheet.   And recommendation for R1 value.

 

The Brain-dead tinys require a full 5V for programming.  They will run at lower voltages.

 

A Uno can flash several LEDs.   Just as easy to write in ASM as in a HLL.   And it accepts a complete range of AVR opcodes and registers.

 

David.

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

david.prentice wrote:
1k seems a bit strong for R1.

 

May I ask you why that is? What is this resistor even doing?

 

Thank you for your help so far

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

Common sense is to pin out the interface in the AVR/Microchip convention.

But you will need to customise the cable from a USBASP.   (Either way it is one or the other, but common sense is to be conventional with the target.)

 

One way to do this is with a 10 to 6 pin adapter.

 

Or just use F-F Dupont jumpers direct from 10 pin to the board. It is less of a hassle just to make the cable and label it.

 

It's part of the challenge. If you can afford a sot-6 socket, which runs about 10 times the cost of an UNO-R3 clone , you can probably afford an AVR programmer.

 

(signature pending)