ATtiny programmer using Arduino ISP by JeonLab
Featured
For relatively small (less number of pins than ATmega328) projects, ATtiny series, ATtiny45 or Attiny85 are good choice in terms of its physical size (8-DIP or 8-SOIC)  and low power consumption.

There are many ways to program it. One of the popular device is USBtinyISP and DASA. Both of them work very well with WinAVR (AVRdude).

I'd like to share how I program ATtiny85 with JeonLab mini 1.3. The idea has been adapted from High-Low Tech Group and provideyourown.com. One missing note from High-Low Tech Group is that you need to add a 110-120 ohm resistor between VCC and Reset pins of JeonLab mini (or Arduino) to prevent Auto reset on serial connection as explained in here and here.
 
Remove these adsRemove these ads by Signing Up
Foxtrot70 says: Feb 29, 2012. 5:02 PM
I have done this very setup but, for a different project, using USBtinyISP to load the 328 chip with Arduino as ISP via Ardino-22, then go thru the selection process for the ATtiny85 board and then the selection of my program to upload via Arduino 1.0, the error msg coms back not able to find link or Serial not declared in this scope. What do I need to do to get it to work?
JeonLab (author) says: Feb 29, 2012. 5:26 PM
I assume that you have already checked the COM port and board setting. Actually I'm still using Arduino 0022 and haven't updated to v1.0 because I know there are a number of changes in new version which I'm not familiar with yet. If you are not familiar with the new version like me, I suggest to use 0022.
Foxtrot70 says: Mar 1, 2012. 1:50 PM
I went back thru and re-installed Arduino-22 and got the following:

avrdude: stk500_getsync ( ) : not in sync: resp=0x00

avrdude: stk500_disable ( ) : protocol error, expect=0x14, resp=0x51

Any suggestions?
JeonLab (author) says: Mar 1, 2012. 1:55 PM
Are you trying to upload a sketch to the ATmega328p, not ATtiny85/45? If so, you need to remove the resistor between the reset pin and Vcc which prevents auto-reset and you can not upload a sketch.
Foxtrot70 says: Mar 1, 2012. 7:30 PM
Its been a very long day but, I think I have figured out the problem. The chips I have are Atmega328p-pu and the Arduino system uses Atmega 328p, they have different signatures.
Since Arduino boasts of how simple it is to use their product by only cutting and pasting in their Sketches to get a program to work with little effort, they need to be more aggressive with an update addition of the binaries to broaden the field of chips to use to get this or any other program to work.

This would explain why the volumes of posts on various forums by "Newbie Users", like myself complaining about not being able to get the Arduino projects to work. I am sure experienced users like yourself would like a break from the barage of questions also. At this point until binary updates are forth coming I need to spend more money and buy specific Atmega 328p chips.

Thanks for your help it is very much appreciated.
JeonLab (author) says: Mar 1, 2012. 7:49 PM
ATmega328p-pu is the one I use. If it has proper Arduino bootloader, it shoud work fine. If you bought the chip WITH a bootloader loaded, there must be something ELSE wrong. Let me help before you buy another one. If I can't, there will be lots of people who can help you with figuring out real problem. Are you using a minimal Arduino made by yourself or any other arduino derivative board?
Foxtrot70 says: Mar 1, 2012. 4:07 PM


Bekow is what I am now getting. How do I enter the -F to ignore the lock_bit ?

avrdude: Expected signature for ATMEGA 328P is 1E 95 0F

Double check chip, or use -F to override this check.


Checked my chip, it is an ATMEGA 328P-PU, the lock_bit is 1E 95 51.

How do I update the IDE to recognize the difference?


JeonLab (author) says: Mar 1, 2012. 5:33 PM
That's weird. Could you describe more specifically which step you had successfully proceeded and saw these errors? I wonder if the ATmega328p chip you are using has the Arduino bootloader. If it is a virgin chip, you need to burn the bootloader first.
diy_bloke says: Mar 10, 2012. 12:27 PM
I also have the feeling it is not the different ATmegachip, as long as it is in an arduino board and has a bootloader after all it is the Attiny one tries to program.

Try have a look here:
http://www.sparkfun.com/products/9231
and check out dogno7's reply
omitting the b1 parameter (if at all possible in the IDE) would be the solution
Foxtrot70 says: Mar 10, 2012. 1:32 PM
I finally got the solution. It was part of the MIT Hi/Lo paper. As I understand the things going on being a newbie I was trying to load thru USBtinyISP to the Arduino and use it as the ISP. As a result it is a double interpretation that is unnessary. The ATtiny does not have enough memory for bootloading and thus the problems. The setup was to connect the 6 pin of the USBtinyISP to the ATtiny85 on the correct pins. Then from the Tools menu select Boards then, select ATtiny85 w/USBtinyISP. Next go to Files, select Sketches then select your sketch. Next from the Tool bar select upload and BAM!! The little guy starts working. Now the final problem I notice with my sketch is; since this is a basic Blink program with 2 LED outputs, and a Pushbutton as an input to select different Blink patterns when, I power down the circuit and when I power up my last Blink pattern is now in Mode 0 or off. I am then forced to press the pushbutton switch to advance to the Blink pattern I had before. What kind of command do I need to insert into my sketch to cause the program to resume the last pattern displayed? Or do I need to place a memory backup capacitor on the Pin8 VCC to maintain the program until power up is selected?
JeonLab (author) says: Mar 10, 2012. 2:57 PM
That's exactly what I explained in the Step 3 and 4. Good to hear you figured it out, finally! Regarding the memorizing the last state before power down, you can use EEPROM (non-volitile memory), but I haven't use it on any ATtiny chips. If the power supply is not a problem, as you said, powering up the chip would be not a bad idea.
diy_bloke says: Mar 10, 2012. 2:17 PM
I am glad you got it working
diy_bloke says: Mar 10, 2012. 2:17 PM
you could try to write tje last state to EEPROM and start your program by checking if there is a state/value written to EEprom
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!