Faster programming tools using SNAP

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

Hi there,

I've been working on some products using the new tinyavr chips, and am finally ready to start some small quantity production. Microchip says the PICkit 4 is a production programmer, but mostly I've found it to be garbage. The Snap is a much more reliable programmer. The more expensive programmers are not in my budget. For older PICs, I've always used the pickit 2 (clones, no less), which was always very reliable and "fast".

 

Fast in this case isn't actually the programming time - the newer programmers are MUCH faster in the actual programming. It refers to the time these take right from clicking the program button to getting done. The pickit 2 would start right away, however, the new ones take forever to start communicating with the tool. It takes about 12-15 seconds to do just this:

***************************************************** 

...

Currently loaded versions:

Application version............0.14.230

Target voltage detected

*****************************************************

Then the rest of the "actual" programming takes just a couple of seconds (3-5). 

 

Is there any way/software(such as PK2CMD for pickit 2; IPECMD takes the same amount of time as the GUI IPE/IDE) to get rid of the initial overhead and get right to sending the UPDI commands? It's easy enough for it to know if it fails without having to go through 15 seconds of connecting. This time adds up significantly.

 

Thanks!

-Sam

Last Edited: Wed. Dec 25, 2019 - 07:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

This is my atprogram command line.
It is faster because the firmware check is skipped by the first -f option.

 

atprogram -f -t snap -i UPDI -d attiny1617 program -fl -fs --verify -f FIRMWARE.elf

 

Last Edited: Wed. Dec 25, 2019 - 07:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I often write about 10 to 50 devices, so I use a batch process like this.

I can write continuously by simply replacing the target and pressing the "Y" key.

 

path = "C:\Program Files (x86)\Atmel\Studio\7.0\atbackend";C:\windows\system32"
@echo off

:yes
@echo on
atprogram -f -t snap -i UPDI -d attiny1617 chiperase
atprogram -f -t snap -i UPDI -d attiny1617 program -fl -fs --verify -f FIRMWARE.elf
@echo off
echo;
choice /m "Continue? "
echo;
if errorlevel 2 goto :no
if errorlevel 1 goto :yes

:no
exit /b

 

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

Thanks! I'm using a mac, so atprogram wasn't something I'd looked into, but will be using windows for production programming anyway, so I'll try this out now.

-Sam

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

I don't know because I haven't used it, but MPLAB also has a command line tool and may have the option to skip the firmware check.

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

kabasan wrote:

This is my atprogram command line.
It is faster because the firmware check is skipped by the first -f option.

 

atprogram -f -t snap -i UPDI -d attiny1617 program -fl -fs --verify -f FIRMWARE.elf

 

FYI: You can also speed up repetitive atprogram sessions by starting atbackend separately and then connecting to it by specifying ip and port in atprogram...

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

Thanks, I'll try that too. I'm also considering using pyupdi instead - it does the job in 3 seconds!

-Sam

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

samay wrote:
... IPECMD takes the same amount of time as the GUI IPE/IDE)
MPLAB X SDK may enable you to create an alternative to IPECMD.

MPLAB X SDK For MPLAB X IDE | opensource4pic

 

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

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

Might inquire of Ron on how fast this is :

Programming ATmega4809 with UPDI from R-Pi | AVR Freaks

 

UPDI is one-wire UART with a protocol; so, BSD, Linux, macOS, Windows 10 IoT Core, etc.

Most PC will have a spare UART on a header on the motherboard.

 


GitHub - ms-iot/python (UWP Python therefore Windows 10 IoT Core)

UP Squared Board - AAEON UP | Mouser

due to Suggested Prototype Boards - Windows IoT | Microsoft Docs

via Overview of Windows 10 IoT Core - Windows IoT | Microsoft Docs

 

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

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

Quick update: atprogram is working well for now. Also, @kabasan's little bat file is very handy - I'll have to end up building something a little more comprehensive finally, but it's doing the job for now.

I've tried to find out how to do this: 

mraardvark wrote:

FYI: You can also speed up repetitive atprogram sessions by starting atbackend separately and then connecting to it by specifying ip and port in atprogram...

but have had no luck yet. executing atbackend just starts the process with out any output on the console, no options or flags seem to do anything. Can anyone tell me exactly how to do this? I know how to specify the ip/port in atprogram, but how do I start atbackend on a specific port, and how do I choose the port? Thanks!

-Sam

Last Edited: Wed. Jan 1, 2020 - 02:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You might also want to look at community member 'alank' all in one programmer that simply plugs on to your programming header and programs teh part in a couple seconds with no computer attached.  Not sure if it supports your target, but you can contact him about it.  theres a thread in marketplace for it:

 

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

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

atbackend /? Should give you the options... I think the default port is 4711 or 4911...

:: Morten

 

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

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

Thanks! atbackend /h gave me the options. For anyone else looking, atbackend /connection-port=[xxx] will do the trick.

-Sam

Last Edited: Wed. Jan 1, 2020 - 03:24 PM