Can't figure out how to program ATtiny817

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

Hello~

 

I'm currently working with the ATtiny817-XMini dev board and I'm planning on ordering a PCB soon with the ATtiny817. The plan was to order today, but we realized a key issue- we're not sure how to program the chips.

 

The more common ATtinys (particularly the 85) have plenty of documentation and resources online, with various programmer boards and even tutorials on how to use an Arduino Uno to program the ATtinys. However, for the 817 (and the corresponding series), there seems to be extremely little, from what pins to connect to AVR programmers that are compatible with it.

 

I'm sorry if I'm overlooking something important, but after triple checking and discussing the matter with a few different individuals, I'm still at a lost on how to program the ATtiny's that will go onto our PCB. The two dev/eval boards use the Atmel Mini Embedded Debugger (as well as an example application from Atmel), but otherwise, I'm at a complete loss.

 

Thank you for any and all help.

Last Edited: Tue. Nov 8, 2016 - 06:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

It's (yet another) new mechanism isn't it? I think they call it UPDI or something. Presumably that's to prevent the whole world using $3 USBAsp's and forcing them to buy $100 Atmel-ICEs ?

 

EDIT, yup, the whole of chapter 33 in the datasheet is dedicated to "Unified Program and Debug Interface"...

 

Last Edited: Tue. Nov 8, 2016 - 06:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for the UPDI reference, and we're looking over it again at the moment. However, there are two issues I'm not sure about: first, I can't find much outside of the datasheet that references UPDI. And second, earlier we thought we would need to get a bootloader onto the chip itself first to use UPDI in the first place, which we're also unsure how to do. Sorry if this answer is pretty obvious, but would we be able to use UPDI without even a bootloader (assuming we figure out how to use the proprietary method in the first place, hardware wise)? 

On another interesting note, on this datasheet it's chapter 34 (just in case there are key differences between the two).

Once again, thank you!

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

The idea of a bootloader is to allow you to program (and update) the device without a special tool that uses something like UPDI. So you'd use an ICE to upload your bootloader onto the ATtiny817 then say you had your device connected to a USB port of a PC via a UART to USB converter IC then you could use the PC to program the application image. 

 

Edit: Funnily enough the ATMEL-ICE page on the Atmel website has no mention of being compatible with UPDI?

Last Edited: Tue. Nov 8, 2016 - 07:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

Last Edited: Tue. Nov 8, 2016 - 06:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Those are really good points, thank you.

 

The two methods I'm looking over right now are...

1) Programming over UPDI myself (say with an Arduino Uno and otherwise quite manually)

As far as I could tell, the UPDI only requires the UART lines and the Reset line. Given the chip itself is already powered appropriately, UPDI could be enabled by a 12V pulse to the Reset line then using UART (of sorts) to communicate the messages. I haven't gotten much farther than this, but it seems technically possible. However, it also seems extremely complicated to do from scratch.

 

2) Using the mEDBG from the XMINI we already have (ie, hacking together an arbitrary programmer of sorts)

Apparently there's a section on disconnecting the Mini Embedded Debugger (section 4.4). Given that we can remove those resistors safely and replace them with wires of sorts, we may be able to connect the mEDBG to an arbitrary ATtiny817. However, this needs to be looked into far more and, given the lines necessary to use UDPI, I don't believe we can reuse the one on the XMini.

Last Edited: Tue. Nov 8, 2016 - 07:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The UPDI is new, and the list of supported interfaces in the Atmel-ICE documentation hasn't been updated yet.

The UPDI is supported by both Atmel-ICE, PowerDebugger and JTAGICE3 if you upgrade them with the latest FW.

UPDI is a single wire interface, so the only wires you need to connect is:

Tool           Target

TDO       -   UPDI

Vtarget  -   VCC

GND      -   GND

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

The 12V activation is only necessary if you have configured the UPDI pin to be something else (fuse setting), like GPIO. The 12V activation will then configure the pin back to UPDI mode for that programming session.

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

... the debuggers' user guides are in the pipe smiley

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

je_ruud wrote:

The UPDI is new, and the list of supported interfaces in the Atmel-ICE documentation hasn't been updated yet.

The UPDI is supported by both Atmel-ICE, PowerDebugger and JTAGICE3 if you upgrade them with the latest FW.

UPDI is a single wire interface, so the only wires you need to connect is:

Tool           Target

TDO       -   UPDI

Vtarget  -   VCC

GND      -   GND

Thank you so much! That solves the issues at hand and makes sense. I'll try posting in this thread again down the line just as a confirmation that there's nothing else that may need to be done that's not obvious at the time in order to use those devices to program the ATtiny817, but this should be it. Once again, thank you (and thank you everyone else as well)!

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

Aww, no dragon support?  q:-(

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

Once we all get the our ATtiny817-XMini dev boards we will be in a better position to answer things.wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Should start a poll -- Do y'all see enough info in Chapter 34 for some bright 'Freak to make a programmer?  After all, the chapter starts out with "proprietary"...

That said, the single wire (or two-wire) is a UART interface 8-E-2 so a protocol analyzer should be able to trap sample session(s) and aid the interpretation of Chapter 34.

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

jawadmn wrote:

The two methods I'm looking over right now are...

1) Programming over UPDI myself (say with an Arduino Uno and otherwise quite manually)

As far as I could tell, the UPDI only requires the UART lines and the Reset line. Given the chip itself is already powered appropriately, UPDI could be enabled by a 12V pulse to the Reset line then using UART (of sorts) to communicate the messages. I haven't gotten much farther than this, but it seems technically possible. However, it also seems extremely complicated to do from scratch.

 

That's not how I read it.

My reading is the UPDI uses only the reset pin, but that link does use a UART-like half-duplex interface.

Parts that do this, usually have some high frequency pre-amble, to signal the part to flip the pin from simple reset to Serial Link mode.

 

If you really want to literally 'program this yourself', you need to write code that can talk UPDI

 

 

jawadmn wrote:

2) Using the mEDBG from the XMINI we already have (ie, hacking together an arbitrary programmer of sorts)

Apparently there's a section on disconnecting the Mini Embedded Debugger (section 4.4). Given that we can remove those resistors safely and replace them with wires of sorts, we may be able to connect the mEDBG to an arbitrary ATtiny817. However, this needs to be looked into far more and, given the lines necessary to use UDPI, I don't believe we can reuse the one on the XMini.

 

That makes more sense, as the full firmware is already in the XMINI, and you have no code to write.

You just need to replace the on-board 817, with an off-board one, using short wires.

 

If you are doing volumes of this, I'd check the programming times of the XMINI and XPRO etc, as I've seen some comments on very slow pgm speeds at the bottom end....

(hopefully UPDI is faster...)

 

 

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

Who-me wrote:
That's not how I read it. My reading is the UPDI uses only the reset pin, but that link does use a UART-like half-duplex interface.

There is also the option for a two-wire, which might simplify the interface to a "standard" UART but would then introduce considerations if the second pin needs to be "shared" with the app.

Optionally, a 2-
wire interface using a GPIO as a separate TX-pin can be enabled, with the PDI pin still used for the RXpart of the communication.
 

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

theusch wrote:

But I see no mention on how the provided interface can be used to program other '817s.  Some e.g. Cortex dev boards allow snapping off the programmer piece, or a header or similar, to be able to use that part of the dev board for other units.

 

Perhaps one can use the UPDI "disconnect point"...

 

Yes, Boards that clearly show how to use on external connections, gain extra points.  The break-off ones are the most obvious.

 

On the image shown, the CDC points will be for the Com port pathway, which is not needed for the EDEBUG, but is useful for printf style messages from user code.

 

The UPDI "disconnect point" looks the obvious way to isolate the local Tiny817, but better solder pads for external connect would not have cost anything, surely ?

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

Who-me wrote:
The UPDI "disconnect point" looks the obvious way to isolate the local Tiny817, but better solder pads for external connect would not have cost anything, surely ?
The UPDI signal to/from the mega32U4 is a 0.25mm via (won't be easy to solder).

http://www.atmel.com/tools/ATTINY817-XMINI.aspx?tab=documents (bottom for "ATtiny817 Xplained Mini User Guide")

http://www.atmel.com/images/Atmel-42726-ATtiny817-Xplained-Mini_User-Guide.zip

  • Files :

Readme.txt

ATtiny817_Xplained_Mini_design_documentation_release_rev4.PDF : Design Documentation with Bom

Test Points\Assembly Testpoint Report for ATtiny817_Xplained_Mini_release_rev4.txt : Assembly Testpoint report, txt

 

Signal UPDI is in the PDF on page 3 (schematic, programmer, B3)

The 0R R203 to be removed (UPDI disconnect) is on page 2 (schematic, target, A1)

The location of the UPDI via is in the testpoint file.

 

An Atmel-ICE PCBA would be easier for jigs, burn-ins, etc

 

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

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

http://www.atmel.com/devices/ATtiny817.aspx

http://www.atmel.com/Images/Atmel-42721-ATtiny-417-814-816-817_Complete.pdf (datasheet, 11/2016, 4.9MB)

theusch wrote:
... Do y'all see enough info in Chapter 34 for some bright 'Freak to make a programmer?
Yes; from a quick skim, the information appears similar to other AVR (physical, media, instruction set).

theusch wrote:
After all, the chapter starts out with "proprietary"...
for the OCD which is standard operating procedure for AVR.

Not much in the datasheet on OCD other than high level architecture and the System Information Block (SIB) (datasheet page 516).

The programming spec needs to be open such that the numerous third parties that create AVR programmers can add tiny817.

Distributors will have to make quick work of programming a reel of these for customers.

Dean could add UPDI to his LUFA (half duplex UART for UPDI instead of half duplex USART for PDI).

 

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

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

gchapman wrote:
The UPDI signal to/from the mega32U4 is a 0.25mm via (won't be easy to solder).

But see the picture from that guide in #5 above--"UPDI disconnect" jumper...

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 just read UDPI as "undefined program and debug interface".

I can understand why op has a problem with that.

 

Sorry, couldn't resist.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

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

Debugger user guides are now (finally) online both on Atmel.com and in Atmel Studio

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

If you are interested in making your own programmer for the new Tiny parts with UPDI, you could take a look at the pyupdi repo which I put out on github recently:

 

https://github.com/mraardvark/py...

 

UPDI is so simple it can be run from a CDC device with a single resistor between RX and TX.  

The code has been tested using an Xplained Nano to program and verify flash.

 

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

Mr Aardvark, you have missed a trick, you could have designed a small USBAsp-alike, have them made up in China then sell them for $3 a time on ebay and make a $1 per unit then relax and download: https://www.yachtcharterfleet.co... ! ;-)

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

Other than the DIY approach, has anyone seen a robust programmer that supports uPDI?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Have they not updated the firmware in the Atmel-ICE to do it then?

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

clawson wrote:

...Atmel-ICE...

 

Probably. The trouble is a) the ICE never feels very robust and b) I'd have to install Studio 7 to drive it.

 

I know I should embrace the dark side but I'm clinging on...

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Brian Fairchild wrote:

clawson wrote:

...Atmel-ICE...

Probably. 

 

Or looking at the website, probably not.

 

The online manual makes no mention of uPDI but is very out of date.

 

 

Brian Fairchild wrote:

...I'd have to install Studio 7 to drive it.

 

Actually, not true. I've just spotted that the ICE is supported by CVAVR.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Search the forum for "powerdebugger"

There was an ad from Microchip today with a discount coupon.

 

Edit: Got it:

https://www.avrfreaks.net/forum/m...

http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=ATPOWERDEBUGGER

 

Power Debugger

25% Off - Use Coupon Code :ULPSAML2       Expires : 19-Jan-2018

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

Last Edited: Wed. Aug 2, 2017 - 06:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A bit sad that this table has not been kept up to date:

http://www.atmel.com/webdoc/atmelstudio/supported.devices.AVR.Tiny.html

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

@ Clawson

Why sad? Didn't Atmel just include support for All tiny's?

Maybe this is a bit comforting:

http://www.microchip.com/paramCh...

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

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

Brian Fairchild wrote:
Other than the DIY approach, has anyone seen a robust programmer that supports uPDI?
Maybe a third party?

The list of third party AVR programmers was recently updated :

AT06015: Production Programming of Microcontrollers

AN2468

06/23/2017

http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en592074

This application note covers both the AVR® and SAM microcontrollers, but not the PIC® microcontrollers.

...

via http://www.microchip.com/wwwproducts/en/attiny1617

 

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

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

Brian Fairchild wrote:
b) I'd have to install Studio 7 to drive it.
There's a C# wrapper around atprogram.exe :

Microchip

AN2466

Using Atmel-ICE for AVR® Programming In Mass Production

07/28/2017

http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en599598

The application note introduces Atmel-ICE setup, driver installation, user guide of the Atmel Studio command line utility (atprogram.exe), and provide a PC programming tool project written in C#. The Visual C# example project can be downloaded along with this application note and run with the ATmega328PB Xplained Mini kit.

...

via http://www.microchip.com/wwwproducts/en/attiny1617

 

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

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

Brian Fairchild wrote:
I've just spotted that the ICE is supported by CVAVR.
tiny417 and tiny817 are in CodeVisionAVR (3.30)

Could not locate UPDI in ChipBlasterAVR though it likely supports it :

 

ChipBlasterAVR

http://hpinfotech.ro/cbavr_features.html

Universal In-System AVR Chip Programming Software

...

Fully compatible with CodeVisionAVR projects, allows executing the programming tasks specified in CodeVisionAVR’s Project|Configure|After Build menu. Ideal for production environments.

...

 


http://hpinfotech.ro/cvavr_revision3.html

 

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

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

An advantage for Atmel Power Debugger over Atmel-ICE is the Power Debugger has pads for a 100mil pitch AVR connector :

Atmel Power Debugger

The 50mil pitch AVR connector mates with cables included with the Power Debugger (same cables as in Atmel-ICE full kit)

 

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

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

Showing a big hammer at the back of tools may give the users some wrong feedback on what to do when the thing doesn't work! Had that feeling a couple of times in the past.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

To use the CodevisionAVR "built-in" programming functions on USB, you need to install Atmel Studio 7.

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

js wrote:
a big hammer 

I have always found it amusing that Atmel choose a Big Hammer as the symbol for their debugging tools!

 

laugh

 

Also that they choose a Bug as the emblem for their development tools!

 

laugh

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

That's called truth in advertising.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

@awneil wrote:

I have always found it amusing that Atmel choose a Big Hammer 

 

It's not just a big hammer, it's Thor's Hammer.  What else would you expect from a Viking! I must admit I know of no Atmel debugging tool that can be called "one of the most fearsome and powerful weapons in existence, capable of leveling mountains."

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

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

Forget that python thing, big expensive hammers, etc. and just clone Xplained Mini module, as i did: https://www.avrfreaks.net/forum/a...

It works for tiny1616 which has SOIC package available. For minimalist version only 16MHz xtal, some caps and wires are needed... devil

@edit: keep wires short, cause longer may cause errors.

Last Edited: Tue. Oct 31, 2017 - 05:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello~

 

I'm currently working with the ATtiny817-XMini dev board and I'm planning on ordering a PCB soon with the ATtiny817. The plan was to order today, but we realized a key issue- we're not sure how to program the chips.

 

There are two questions.

How many adc channels are available at the same time?

 

So how do you code your program?

 

Thank you for any and all help.

jaegon yoo