Automating AVR Programming - Production Programming  - Page 1
Forum section: electronics / general

author: bipolunipol
author_rank: Contributor
timestamp: December 21, 2021, 01:59:22 pm
content: Hello!I am preparing a small production series of devices. They will include the ATTINY414 microcontroller. Now I would like to create a fixture for testing (measuring voltages and currents) and programming devices: after inserting the PCB into fixture, I would like to upload the test program (AVR microcontroller with 1-wire UPDI for programming), measure the currents and voltages, upload the target program and measure the currents and voltages again.And now I am wondering how to automate it so that I do not have to read the measurements from the meters myself and manually start the programmer?Is there any software that can help me automate the AVR programming and testing process?

author: Siwastaja
author_rank: Super Contributor
timestamp: December 21, 2021, 02:13:22 pm
content: Normal scripting tools get you far; .sh in unix, maybe Powershell if you are a Windows guy.I have done this with .sh scripts and once their capabilities run out, custom C programs, but that's only because I like to work with C. Many would choose Python scripting instead.In any case, if you are capable of writing the AVR firmware in C, some production automation code (in C or whatever) should be easy compared to that.Basically, get some SCPI power supplies and multimeters etc. Likeecho "OUTP ON" > /dev/ttyUSB0Then just call avrdude in your script. You can loop it until it returns success, this way simply detecting when the AVR is connected to the fixture.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 21, 2021, 02:41:43 pm
content: - custom mechanical fixture (can be handmade if the batch is small, a fixture with a hinge)- no connectors (use pogo-pins instead)- design the board such that it allows in circuit programming, with the board fully assambled- write your own scripts to program the AVR (use AVR DUDE in command line mode)- write some extra SCPI scripts to automate powering up and measuring (you have to have SCPI enabled instruments)- give an unique ID to each board and each production batch, log and store all the individual test results- do NOT include any manual interventions or human decisions during the test procedure, other than placing the board inside and closing the lid of the mechanical fixtureConnect all to a PC and make the scripts such that when the lid of the test fixture is closed, the test procedure starts automatically, and return to the operator only a binary PASS/FAIL verdict.

author: voltsandjolts
author_rank: Unknown
timestamp: December 21, 2021, 03:14:51 pm
content: custom bed-of-nails program & test pcb, perhaps with 3D printed pcb holder+scpi psu+keysight 34970A or 34972A with scanner card 34901A, io card 34907A+avr dude+python to glue it all together and make a nice pdf test report for each boardscpi psu and 34970A etc can be had on ebay, perhaps all for less than GBP1000

author: bipolunipol
author_rank: Contributor
timestamp: December 21, 2021, 03:54:46 pm
content: Thank you for your help!Regarding the programmer - I have MPLAB Snap In-Circuit Debugger / Programmer (PG164100). Will it be possible to make use of such a programmer and control its work from the level of the mentioned scripts? (AVRDUDE e.g. does not support new TINY414 chips and this programmer.)And regarding pogo-pins - will it be a good solution to use a ready-made TC2030 connector, attached to the designed fixture? After inserting the PCB, this connector will be adjacent to the board.

author: Gribo
author_rank: Frequent Contributor
timestamp: December 21, 2021, 04:45:56 pm
content: Microchip (AVR) Studio has the ATprogram utility. You can use it to program and set the fuses however you want. I recently built a 6-up programmer using 6 Atmel ICEs. You can call them by the Atmel ICE SN.Pay attention that certain Intel boards in Windows 10 have a limit on the number of identical devices connected to a single USB hub (4 work, 6 won't).