ArduinoISP fails to comple/load

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
robert_david
 
Posts: 16
Joined: Thu Jan 14, 2021 6:44 am

ArduinoISP fails to comple/load

Post by robert_david »

I am trying to program a ATtiny85 using Arduino UNO R3 and have found an article by Ashish Choudhary (https://circuitdigest.com/microcontroll ... ng-arduino)
which gives very clear instructions. Unfortunately when I tried to follow them it failed at almost the first step!
Which was to locate Arduino ISP and upload it to the UNO

Going to File > Example > ArduinoISP the ISP was located and opened, BUT when up loaded it failed with the message 'Serial' was not declared in this scope. The section of code identified was

#ifdef SERIAL_PORT_USBVIRTUAL
#define SERIAL SERIAL_PORT_USBVIRTUAL
#else
#define SERIAL Serial This line was highlighted
#endif

I freely admit that I am a complete novice in this matter so cannot hope to know what to do in order to successfully upload the code. In my limited experience I have only used <Serial.begin(9600);> in setup in order to monitor what's happening in a sketch using Serial.println( ) etc. So a code section such as #ifdef to #endif is new to me as is <SERIAL.print((char)STK_UNKNOWN);> etc. I can see that #ifdef tests what follows to see if it is defined or not, but what is SERIAL_PORT_USBVIRTUAL as far as the UNO R3 is concerned? Is it defined?

So help please what should I do to successfully upload the ISP code?

I'm using Arduino 1.8.19 with an UNO R3

Thank you

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: ArduinoISP fails to comple/load

Post by adafruit_support_carter »

Just guessing - but make sure you select the board as being UNO when uploading the ArduinoISP sketch. You switch to ATtiny85 once that is done. And note that example sketch they have you upload to the ATtiny85 is the simple Blink example that does not use Serial.

User avatar
robert_david
 
Posts: 16
Joined: Thu Jan 14, 2021 6:44 am

Re: ArduinoISP fails to comple/load

Post by robert_david »

Great that worked! Many thanks for such a simple fix - shows what a beginner I am to have not thought to check that the correct board was selected

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”