Totally new to this and getting frustrated, I am trying to use the arduino uno as a isp programer for a ATTINY85 chip
When I go to "Compile" the ArduinoISP sketch it comes back with several error messages I have searched the web for a
about three weeks now and cant find a ArduinoISP sketch other than the one from arduino examples!
I have uninstalled arduino software and all files and installed new but still get compile errors!! Again new to this but should the ArduinoISP sketch be bad from the arduino example list? or am I so new and missing something??
Have you got a suitable arduino ATtiny85 core (there are a few) and installed it correctly in the Arduino IDE?
To use the ArduinoISP you need to set board type to UNO then upload the ArduinoISP sketch to your UNO.
Disconnect the UNO from power and connect the ATtiny85 as per instructions on the playground to the UNO.
Also connect the capacitor to prevent the UNO from auto resetting.
Connect the UNO again to USB/power.
Select ATtiny85 board type in the IDE and load your ATtiny85 sketch you want to upload.
Ensure 'Arduino as ISP' is selected in tools/programmer menu of the IDE.
Select 'File/Upload Using Programmer' and the sketch should compile and be uploaded to the tiny via the UNO.
Be aware that not all libraries etc work on the tiny as it has fewer chip resources/features than the UNO but if it compiles when the tiny is selected as target device you have a chance.
Thanks for the quick reply. I am at work now but when I get home i will recreate the the scenario and copy the errors.
NOTE: I just verified ArduinoISP sketch here at work and it was good! So I misspoke in original post, it is when i tried to Compile!!
Sorry for the confusion.. But will post errors Later
OK after the quick response from all of you I got the Arduino Uno programed as isp programer and actually loaded the basic "blink"
sketch to the at-tiny 85 and it worked! Thought i was home free but I'm not, the attached sketch is what I am intending to load on
the t85 chip for the wife's birthday gift (jar of fire fly's) in two days....Try to verify and get "PB1 undeclared here (not a function) " I am floundering like a beached whale!! This programming stuff is tough I have the utmost respect for those of you who get it and or mastered it.... Any help on the following would be greatly appreciated.
The code you have linked to is not written for use in the Arduino IDE so will show errors. You could try downloading a suitable IDE that will compile it of maybe someone here will do it for you and supply the HEX file for you to upload. I only have the Arduino IDE at home and wont be back in work for a couple of days to compile using AVR studio or Codeblocks.
FatGut:
Thank you for the information! If I understand you correctly the sketch is in "C" and I need Hex?
Not quite, the code is written in C++ (the same as normally used in the Arduino IDE) but it is not written for compiling on the Arduino IDE.
All sketches written for the Arduino IDE need a void setup() and void loop() and expect hardware pins/ports etc to have specific names. The program you supplied is written for compiling on a different IDE (with different needs and names) and to save you downloading/installing & learning this new IDE I hoped someone here who already has it installed would compile it to create the .hex file for you that you can then upload to the tiny85 MCU.
EDIT:
Or re-write the code to work on Arduino as Erni has done.
Thank you both so much! I can build electronic devices, computers, mesh nodes and antenna systems to talk around the world but for the life of me I can not grasp the programming side of things that is why I purchased an arduino. Maybe for my first project I went to "BIG"? Erni thanks for the rework on the file but I still get a whole lot of "NOT Declared errors"
I will continue searching for answers and will not accept failure as an option!
FatGut:
Try to verify and get "PB1 undeclared here (not a function) "
The correct identifier is PORTB1 (or PINB1). Changing PB1 to PORTB1 will solve the problem. You will have to do the same for the other PB# identifiers.
I feel like a complete idiot!! the original .ino file you sent works if you select attiny85 after loading the ISP program on to to the UNO.... I got so caught in the programming I forgot the hardware. You have been a great help to me and my Birthday gift .It is working and looks fantastic and will let the Wife know that the real credit goes to you!!!
I Know the ham radio community is fantastic and now I have found another community of "FANTASTIC" people that are willing to share there expertise..