Pages: 1 [2] 3 4 5   Go Down
Author Topic: Arduino translated to AVR?  (Read 11741 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well great, now when I tried to verify the ArduinoISP sketch to my Uno, i recieve several error messages.  The proper board and serial port were chosen. This is all happeneing after I added those attiny core files into the 'hardware' folder, as instructed before.  I may have placed them in the wrong folder or something, but I now recieve these error messages:

I'm going to go ahead and switch to 1.0 before continuing....
Code:
ArduinoISP.cpp: In function 'void setup()':
ArduinoISP:48: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void loop()':
ArduinoISP:105: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'uint8_t getch()':
ArduinoISP:111: error: 'Serial' was not declared in this scope
ArduinoISP:112: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void readbytes(int)':
ArduinoISP:116: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void empty_reply()':
ArduinoISP:163: error: 'Serial' was not declared in this scope
ArduinoISP:167: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void breply(uint8_t)':
ArduinoISP:173: error: 'Serial' was not declared in this scope
ArduinoISP:178: error: 'Serial' was not declared in this scope
ArduinoISP.cpp: In function 'void start_pmode()':
ArduinoISP:232: error: 'SS' was not declared in this scope
ArduinoISP:234: error: 'SCK' was not declared in this scope
ArduinoISP:239: error: 'MISO' was not declared in this scope
ArduinoISP:240: error: 'MOSI' was not declared in this scope
ArduinoISP.cpp: In function 'void end_pmode()':
ArduinoISP:246: error: 'MISO' was not declared in this scope

AND THE LIST GOES ON....




Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have upgraded a step to Arduino 1.0
I downloaded the atiny zip and placed it in the 'hardware' folder within the sketchbook. from http://code.google.com/p/arduino-tiny/downloads/list
The instructions state that there should be an option for 'Atiny85v (with Arduino as ISP)'
That option is not available, and I couldn't get any of the 85v options to upload successfully.  Here are the options that I have available:

Why is it that I don't have the same board options that the instructions indicate?


* img.jpeg (271.71 KB, 641x836 - viewed 58 times.)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 205
Posts: 12844
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Why is it that I don't have the same board options that the instructions indicate?

The names used in the Tiny Core are just a bit different and a bit more descriptive than the names used in the HLT core.  The Tiny Core is correctly installed.

At this point you should be able to select any of the ATtiny85 entries, perform a Tools / Burn Bootloader in the IDE, and have a processor configured and ready to use.  I suggest starting with the 8 MHz entry: ATtiny85 @ 8 MHz  (internal oscillator; BOD disabled).

Quote
That option is not available, and I couldn't get any of the 85v options to upload successfully.

Error message?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried to burn the bootloader, with these options:

Board > attiny85v @ 8 MHz  (internal oscillator, BOD disabled)
Programmer > Arduino as ISP
selected 'Burn Bootloader'

recieved this as the error message:
Quote
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
« Last Edit: June 08, 2012, 09:30:21 pm by Drc3p0 » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 205
Posts: 12844
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


When you perform the Burn Bootloader, does the LED on pin 13 ever blink?  Does the LED on pin always display a heartbeat?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LED on pin 13 blinks while uploading the ArduinoISP sketch, but only while its uploading.  I am not able to burn the bootloader due to the error messages that are displayed above. 
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 205
Posts: 12844
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The LED on pin 13 blinks while uploading the ArduinoISP sketch, but only while its uploading.

Perfect.

Quote
I am not able to burn the bootloader due to the error messages that are displayed above.  

Please post the verbose output from an attempt to Burn Bootloader...

• Start the Arduino IDE
• Click File / Preferences
• Ensure Show verbose output during upload is checked
• Click OK
• Click Tools / Burn Bootloader
• Copy-and-paste the text from the status window into a reply

Hopefully something in there will shed some light on the problem.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your patience, I really appreciate it.  Here's the verbose output from the attempt to burn the bootloader to the Attiny85 @ 8 MHz (internal oscillator with BOD disabled) and the Arduino as ISP.

Code:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cstk500v1 -P/dev/tty.usbmodemfa141 -b19200 -e -Uefuse:w:0xFF:m -Uhfuse:w:0xD7:m -Ulfuse:w:0xE2:m

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/Darcyneal/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodemfa141
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
         AVR Part                      : ATtiny85
         Chip Erase delay              : 4500 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Recv: . [14]

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [02]

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [10]

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
         Hardware Version: -1863096046
         Firmware Version: -1073746664.-1609565488
         Topcard         : STK502
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [86]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [87]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [89]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [02] . [00] . [00] . [00]   [20] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: Send: Q [51]   [20]
avrdude: Recv: . [10]
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.



Moderator edit: changed to code tags.
« Last Edit: June 09, 2012, 01:27:20 pm by Coding Badly » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2686
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a clear solution for any issues that may arise with this upgrade and UNO?

I have both versions installed (0022 and 1.0.1).  I have only encountered one annoyance: Arduino 1.0x changes the filename extension when a sketch is saved.  That behaviour can be disabled under File / Preferences.

Serial changed considerably.  If you rely on Serial being "blocking" stick with 0022.

That and some of the core code changes along with some compiler option flag changes creates larger code with 1.x vs pre 1.x.
So if you are pushing the edge of the capacity of the flash, your image not fit when you upgrade to 1.x

Plus there are still quite a few libraries that have not been converted over to 1.x.
Arduino 1.0 broke 100% of the existing 3rd party libraries. While the changes to fix them are often quite minimal
it is just something to be aware of. So if you have some exiting libraries you may run into compile issues
unless they are very recent libraries.


--- bill
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 205
Posts: 12844
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That and some of the core code changes along with some compiler option flag changes creates larger code with 1.x vs pre 1.x.
So if you are pushing the edge of the capacity of the flash, your image not fit when you upgrade to 1.x

For this topic, she's using the Tiny Core not the Standard Core.  Image sizes are the same (same compiler; core hasn't changed for years).

The problem is a synchronization bug in ArduinoISP.  I'm in the process of tracking down the solution.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2686
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That and some of the core code changes along with some compiler option flag changes creates larger code with 1.x vs pre 1.x.
So if you are pushing the edge of the capacity of the flash, your image not fit when you upgrade to 1.x

For this topic, she's using the Tiny Core not the Standard Core.  Image sizes are the same (same compiler; core hasn't changed for years).

The problem is a synchronization bug in ArduinoISP.  I'm in the process of tracking down the solution.

Sorry for the confusion. There are actually 2 separate things:
- larger 1.x core code (which won't impact the Tiny Core)
- larger code do to compiler options changing. (affects everything)

I have seen larger code emitted for my own source/objects.
I can compile some of my own source code modules and the generated code is,
slightly larger and less optimized code with the newer post 1.0 IDE.
There are a few command line option changes and its been a while but I tracked it down to
-felide-constructors
which is not used with the newer IDEs.
Not sure what the full impact of this option change is but I have notice that without it
certain code gets larger.

--- bill
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried to burn the bootloader, with these options:

Board > attiny85v @ 8 MHz  (internal oscillator, BOD disabled)
Programmer > Arduino as ISP
selected 'Burn Bootloader'

recieved this as the error message:
Quote
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12

Although your avrdude error messages are different than those I first received when first using arduino-tiny on an ATTiny85, I found I had to edit avrdude.conf to support reading of lockbits on ATTiny85.  See post 99 of this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/90

George
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 205
Posts: 12844
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Found it.  Exact same failure...
http://arduino.cc/forum/index.php/topic,88649.msg673025.html#msg673025

Why the failure occurs...
http://arduino.cc/forum/index.php/topic,88649.msg673678.html#msg673678

@Drc3p0: I think you will have to modify the ArduinoISP sketch that came with Arduino 1.x by hand.  I can't find a patch or a modified sketch that is meant to work with Arduino 1.x.  If you have trouble making the change, let me know and I'll give it a try.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



@Drc3p0: I think you will have to modify the ArduinoISP sketch that came with Arduino 1.x by hand.  I can't find a patch or a modified sketch that is meant to work with Arduino 1.x.  If you have trouble making the change, let me know and I'll give it a try.

not too sure what exactly needs to be modified to make the ArduinoISP sketch work.  I'll look through it.

Should I just buy an AVR ISP to program the attiny's?
Logged

Patna, INDIA
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Fascinated at once with arduino. LOVE IT.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try googlling around uwill find some proper solution  4 it. It was also on the knot, but partially solved.
Logged

Pages: 1 [2] 3 4 5   Go Up
Jump to: