ATtiny40 TPI Programming?

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

Hi all

I've been using the Tiny26 and 261 for a while now (I actually got an email last week saying that the 261 was being discontinued). One product I'm now working on requires 17 I/Os. I was thinking of using the Tiny40 which has 18 (if you include reset, which I don't). This is enough pins, and it has enough ADCs and timers etc for what I want.

But then I noticed that it has some new (to me anyway) programming method. No longer uses SPI but rather TPI. Is there anything I should know when migrating to this? I see that the ISP mkII is compatible and the connector wiring is basically the same.

Cheers - Matt

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

Quote:
got an email last week saying that the 261 was being discontinued
Where did you get it from? I doubt that you will not find a newer pin compatible chip maybe with an A or P extension but otherwise the same.

TPI has been used for the brain dead 6 pin Tinies, didn't know it was going to be used for bigger chips.

"USUAL" Atmel programmers will do TPI.

edit see AVR531: Migrating from ATtiny261/461/861 to ATtiny261A/461A/861A

edit 2 see replacement parts http://www.atmel.com/about/quali...

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

The discontinuation email came from Digikey as I have bought 1000s of them from there. You're right though, I didn't notice the A extension replacement.

Still in this case my new product requires 17 I/Os so the 261 still doesn't help anyway. The Tiny40 seems like a new product - I hadn't heard of it before, and the datasheet is in the new format (plus it's dated Jan 2013).

Cheers - Matt

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

If that is going to be a completely new product design and fits into 2k flash requirements then instead of 4k tn40 you could use something cheaper, like tn20 or some PIC perhaps.

No RSTDISBL, no fun!

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

The Tiny20 doesn't have 17 I/Os so that rules that out. But thanks anyway!

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

After disabling reset, you can only generate an external reset (which is needed for further TPI programming) by applying 12V to the reset pin. Make sure your circuit can handle 12V on the reset line if you want to further program your chip in the system. If you cannot build your system to handle that condition, don't do in-system programming but program your chips before mounting them.

I tend to post off-topic replies when I've noticed some interesting detail.
Feel free to stop me.

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

Tiny1634 has 17 I/O if you use the internal oscillator. Cheap and lots of toyz.

I cannot think of any 24-pin AVR8 models. The next step is 28/32 pin, Tiny/Mega48 families.

BTW, the first '261A datasheet was October 2009 -- some years ago. No surprise that the older/more expensive/more power version is being discontinued.

Quote:

TPI has been used for the brain dead 6 pin Tinies, didn't know it was going to be used for bigger chips.


TPI is on all brain-dead models, right?

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

Quote:
The Tiny20 doesn't have 17 I/Os

IO count requirement is very chip specific.
For example you can sense 4x4 keyboard with one analog IO or 8 digital IOs. You could also use IO as analog input + digital output at the same time. Or digital input + digital output + analog input or ... That is a typical practice, AVRs are designed to be used that way.
It is also true that with 17 IOs you can sense/drive a 16*17=272 pixels LED display directly from AVR so if that is the case then 17 IOs are an absolute must.
In most other cases IO count may vary greatly.

No RSTDISBL, no fun!

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

The I/O count is specific to the product I'm designing for. I've sent the PCB of to get a prototype made up, so for now at least I'm locked into the Tiny40.

Thanks for the suggestion of the Tiny1634. For some reason I didn't look at that when I used the Atmel parametric search table. The Tiny40 is cheaper though, only by $0.20 or so, but multiply that by 1000s and you have enough to pay for a Christmas party!

Anyway thanks for your suggestions guys. My main concern was what the hell is this TPI that I've never seen before. Further reading and I see it's really the similar to ISP, and more importantly the AVRISP mk II can talk to it.

Cheers - Matt

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

Note that the AVRISP mkII can not generate a 12V reset signal. The STK600 can.

I tend to post off-topic replies when I've noticed some interesting detail.
Feel free to stop me.

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

But if you leave the reset pin as reset pin you don't need any 12V.

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

I'm leaving the reset pin as reset. The tiny40 has 18 i/os and I only need 17. So no need for 12V programming.

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

How about the tiny2313 or 4313?

- Brian

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

The AVR ISP mkii support TPI with ATtiny40.

(My AVRISP is from 2012.09.04 SN: 0200136348)

I'm fiddling with this at the moment (or did ...)

-> https://www.avrfreaks.net/index.p...

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

I got my PCBs delivered yesterday and initially it was so far so good. I started up AVR studio 6 (6.0.1996) and discovered that the Tiny40 was not in the supported list. So quick trip to Atmel website and I found there's a new version, 6.1.2440(beta). I downloaded that and it says it supports the Tiny40. After it decided to upgrade the firmware in my ISPmkII I was talking to the Tiny40. I could read the device info, fuses, lockbits etc. So off to program the flash and that was ok too. Made some changes to my code and try to reprogram and it failed. Try again and it's ok. Try a few more times and it seems that everything has to be done twice. I have to click on read fuses twice, read lockbits twice, erase twice, program twice. After following pernils link above, and a few more links, I found others were having similar problems dating back to March 2013 with Atmel agreeing there was a problem in Studio 6. But no solutions yet. Anybody else have any ideas?

Matt

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

Maybe slow the communication speed if possible? Never used TPI so don't know much more. :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I can't seem to find anywhere to set the communication speed. In studio 6 there doesn't seem to be an option in the programming menu like there was in studio 4. Maybe it disappears when using TPI.

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

It's disappears when using TPI.

To get your chip working read this thread

https://www.avrfreaks.net/index.p...

If you are going to use interrupts you have to fix the definition list for the device or you will go insane ... (I have been there)