Pickit4 and ATtiny85 - Page 1
Forum section: electronics / general

author: jerryk
author_rank: Regular Contributor
timestamp: March 26, 2020, 07:19:42 pm
content: I'm brand new to microcontrollers but trying to get started with the Pickit4 and ATtiny85's since I have some of these chips on hand.For wiring I'm using the chart below using the column under "AVR ISP(&Dw)". When I look at the project properties window for the ATtiny85 project there are no power options like there are with other chips. So I assume this chip has to be powered externally. Is this correct?I have tried powering the chip externally but still get the following errors when I try to read the configuration bits.Code:Transmission on endpoint 2 failedTransmission on endpoint 2 failedYou have set the program speed to Normal. The circuit on your board may require you to slow the speed down. Please change the setting in the tool properties to low and try the operation again.Failed to get Device ID. Please make sure the target device is attached and try the operation again.Connection Failed.Transmission on endpoint 2 failed*****************************************************Connecting to MPLAB PICkit 4...Currently loaded versions:Boot version...................1.0.0Now Downloading new Firmware for target device: ATtiny85Updating firmware application...Connecting to MPLAB PICkit 4...Currently loaded versions:Application version............1.8.146Tool pack version .............1.0.61Vdd at 0.03V, should be above 1.8V.The VDD voltage desired is out of range.Connection Failed.Failed to initialize tool.Any ideas/help appreciated.Jerry

author: oPossum
author_rank: Super Contributor
timestamp: March 26, 2020, 09:34:07 pm
content: It is complaining about power, so make sure there is power at the MCU at at the Pickit4. There always has to be Vdd/Vcc connection to the Pickit4 even if it is not supplying power. It has to be able to measure voltage supplied to the MCU and power the buffers.

author: jerryk
author_rank: Regular Contributor
timestamp: March 27, 2020, 08:44:33 pm
content: I must have had some of the connections incorrect after I hooked it to external power.Using this connection scheme, it now works as far as reading the configuration bits.Code:Connections:PICKIT4__________________ ATtiny851........ no connection.........................2........ VTG......................... Pin 8 (VCC)3........ GND......................... Pin 4 (GND)4........ MISO........................ Pin 6 (MISO)5........ SCK.......................... Pin 7 (SCK)6........ RESET*..................... Pin 1 (Reset)7........ MOSI ....................... Pin 5 (MOSI)8........ no connection ..........................I still have my first program to download and get working.Thanks - Jerry

author: jerryk
author_rank: Regular Contributor
timestamp: March 27, 2020, 11:13:18 pm
content: The next issue is the following error when I try to build the main project:Code:CLEAN SUCCESSFUL (total time: 52ms)dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwinReferenced from: /Applications/microchip/mplabx/v5.35/mplab_platform/bin/makeExpected in: /usr/lib/libSystem.B.dylibdyld: Symbol not found: ____chkstk_darwinReferenced from: /Applications/microchip/mplabx/v5.35/mplab_platform/bin/makeExpected in: /usr/lib/libSystem.B.dylibBUILD FAILED (exit value 133, total time: 56ms)Internet search on this error came up dry.The compiler I have selected is XC8 if that is applicable. The code is an led blink code (from internet) as follows:Code:#include <stdio.h>#include <stdlib.h>#include <avr/io.h>#include <util/delay.h>FUSES = {0x62, // LOW{SUT_CKSEL=INTRCOSC_8MHZ_6CK_14CK_64MS, CKOUT=CLEAR, CKDIV8=SET}0xDF, // HIGH{BODLEVEL=DISABLED, EESAVE=CLEAR, WDTON=CLEAR, SPIEN=SET, DWEN=CLEAR, RSTDISBL=CLEAR}0xFF, // EXTENDED{SELFPRGEN=CLEAR}};LOCKBITS = {0xFF, // LOCKBIT{LB=NO_LOCK}};#include <util/delay.h>int main (void){// set PB3 to be outputDDRB = 0b00001000;while (1) {// flash# 1:// set PB3 highPORTB = 0b00001000;_delay_ms(20);// set PB3 lowPORTB = 0b00000000;_delay_ms(20);// flash# 2:// set PB3 highPORTB = 0b00001000;_delay_ms(200);// set PB3 lowPORTB = 0b00000000;_delay_ms(200);}return 1;}Any ideas appreciated.Jerry

author: oPossum
author_rank: Super Contributor
timestamp: March 28, 2020, 12:53:54 pm
content: Add #define F_CPU 1000000 at the top and remove the second include of delay.h

author: jerryk
author_rank: Regular Contributor
timestamp: March 28, 2020, 05:03:38 pm
content: I made the changes and it still gives the same error as my previous post. Seems like it has an issue with the "make" command as a guess on my part.I did the same part and code (as fixed by your suggestion) and it compiles on MPLAB Express which is the cloud version. It does have some optimization warnings but I assume is because I'm using the free version.I'm on a 32 bit mac and may try an earlier build of MPLAB X or XC8. I can't go back too far because of the Pickit4 and AVR chip.Just looking at the second part of the error message by itself:Code:dyld: Symbol not found: ____chkstk_darwinReferenced from: /Applications/microchip/mplabx/v5.35/mplab_platform/bin/makeExpected in: /usr/lib/libSystem.B.dylibCan anyone tell me what the program is trying to do here? I am trying to avoid back dating the versions here if there is a simple problem hiding somewhere.Sure appreciate you taking the time to help - Jerry

author: oPossum
author_rank: Super Contributor
timestamp: March 28, 2020, 09:28:58 pm
content: I am using 5.35 & 2.10 on Windows 10 and it works. I'll install it on my Mac and see what happens.

author: Nerull
author_rank: Frequent Contributor
timestamp: March 28, 2020, 09:37:40 pm
content: make is trying to load a symbol from a dynamic library that is missing, from what I can see it means that it was built against MacOS 10.15 and you're likely using an older version. Microchip should be specifying a minimum MacOS version in their build system, and are apparently not.

author: jerryk
author_rank: Regular Contributor
timestamp: March 28, 2020, 11:26:11 pm
content: Quote from: Nerull on March 28, 2020, 09:37:40 pmI think it is shaping up to be a mac os version issue so far. I'm moving through all the old MPLAB X versions one at a time and it works at ver 4.15 but no avr support. I just tried ver 5.00 and it says avr support in beta and will not let me select the pickit 4 for the ATtiny85 but it will allow the selection of my pickit4 for a pic16lf1824 and will compile code without that error message.Quote from: oPossum on March 28, 2020, 09:28:58 pmThanks for the effort. I sure would like to use a newer version of MPLAB X. My mac os is 10.11.6 on a 32 bit Imac.Jerry

author: oPossum
author_rank: Super Contributor
timestamp: March 29, 2020, 05:38:17 am
content: I get the same error on MacOS 10.12.6

author: oPossum
author_rank: Super Contributor
timestamp: March 29, 2020, 05:57:21 am
content: Using make from and older version of MPLAB may workhttps://www.microchip.com/forums/m1132846.aspx

author: jerryk
author_rank: Regular Contributor
timestamp: March 29, 2020, 07:21:32 am
content: Well that fixed it. Just copied an older version of make to 5.35 and it seems to work just fine now. No errors at all.Thanks!Jerry

author: Dicko
author_rank: Contributor
timestamp: May 07, 2023, 08:28:03 pm
content: I am having an issues connecting the PicKit4 to the Attiny45. I thought that the PicKit would deliver power to the Attiny for programming, but am I wrong, do I need an external power supply like a bench PSU as well as the PicKit4 connected to the PC via USB.

author: brucehoult
author_rank: Super Contributor
timestamp: May 08, 2023, 02:25:02 am
content: I don't know anything about PicKit, sorry, but I've programmed bare ATTiny85s a lot using an Arduino board and this tutorial:https://www.instructables.com/How-to-Program-an-Attiny85-From-an-Arduino-Uno/Note that programming the Uno (or Mega or whatever) with the "Arduino as ISP" sketch is the important part. You can then upload whatever code you want to the ATTiny, not only Arduino bootloader or program -- it's just a hex file. I tend to write my application as bare metal code but use the Arduino bootloader as I'm not using pushing the limits of the 8 KB of program space at all.I might feel differently if I was using the '25 :-)