Go Down

Topic: UNO R3 ISP trouble (ATtiny45) (Read 7517 times) previous topic - next topic

winter14

Hello all,

I'm an engineering student and I just purchased my first Arduino (UNO R3, from Adafruit) for a project. However, I have run into some problems.

I successfully loaded the "Blink" sketch onto the board and the L LED blinks on/off in one second intervals. Now I am trying to change the clock speed of the ATtiny as per the instructions found here:

http://hlt.media.mit.edu/?p=1695

For "Board" I have selected ATtiny45 (8MHz internal clock)
For "Programmer" I have selected "Arduino as ISP"
I have not changed the Serial Port since uploading "Blink" to the Arduino

When I try to "Burn Bootloader" the RX light on the Arduino blink 3 times and the L LED blinks several times (never the TX) and the software runs as if it is going to complete the action. However, then I get an error message:

avrdude: stk500_recv(): programmer is not responding

I don't understand if this is a problem with the Arduino or the ATtiny45. Perhaps a connection issue, as I am connecting to the ATtiny via breadboard (though I have checked the wiring setup multiple times). Here is a schematic:

http://hlt.media.mit.edu/?p=1706

Any help would be greatly appreciated! Thanks!

Coding Badly


Did you upload the ArduinoISP sketch to your Arduino?

How did you disable auto-reset?

winter14

#2
Aug 20, 2012, 08:29 pm Last Edit: Aug 20, 2012, 08:37 pm by winter14 Reason: 1
Thanks for the response! I just uploaded the ArduinoISP sketch to my Arduino and now I get a new set of messages when I try to burn boot loader:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45

It was my understanding that the 10uF capacitor (connected between the GND and RESET on the Arduino) kept it from automatically resetting. Am I mistaken?

winter14

However, it does say "Done Burning Bootloader" even with the messages:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45

So I'm not sure if I was actually successful... I'll try loading a sketch onto the ATtiny45 as a test.

Coding Badly


Those are warnings.  They can be ignored.

Coding Badly

It was my understanding that the 10uF capacitor (connected between the GND and RESET on the Arduino) kept it from automatically resetting. Am I mistaken?


You are correct.

winter14

Ok, now I'm trying to burn the .hex file to the ATtiny and I'm getting even more errors. This is the beginning of what the hex file looks like (middle part removed):

:100000000BC225C224C223C222C221C220C21FC2E7
:100010001EC21DC251C21BC21BC219C218C200049B
:1000200009101821292F32312C231A110A05010039
:1000300000021D517B82683F18020101010101018C
:10004000040F1A242E37424F5B666D7379838E98A6
(removed)
:060A5000952F802D089592
:100A560013001E00770031006C00A800820014010C
:100A6600630096018800F9015D0081024400DE0200
:100A760060006400680068006C006C006C00700028
:100A86007000740074007400780078007C007C00AC
:0C0A96007C00021E00CE74080401100257
:00000001FF

And these are some of the errors (I had to remove some due to allowed characters per post):

sketch_aug20a.cpp:2:2: error: invalid suffix "BC225C224C223C222C221C220C21FC2E7" on integer constant
sketch_aug20a.cpp:4:2: error: exponent has no digits
sketch_aug20a.cpp:6:2: error: invalid suffix "F32312C231A110A05010039" on integer constant
sketch_aug20a.cpp:8:2: error: invalid suffix "D517B82683F18020101010101018C" on integer constant
sketch_aug20a.cpp:10:2: error: invalid suffix "F1A242E37424F5B666D7379838E98A6" on integer constant
sketch_aug20a.cpp:12:2: error: invalid suffix "B978D85838790999E9E9A97969594906D" on integer constant
sketch_aug20a.cpp:14:2: error: invalid suffix "B888A919BA1A099908A8B91989C9A9455" on integer constant
sketch_aug20a.cpp:16:2: error: invalid suffix "D8A8C9196999998989A9A968E86818471" on integer constant
sketch_aug20a.cpp:18:2: error: invalid suffix "CA8AAA192837975747473716E6D6A3F" on floating constant
sketch_aug20a.cpp:20:2: error: invalid suffix "C50433A34312E2B27211B16120E0B70" on integer constant
(removed)
sketch_aug20a.cpp:338:2: error: invalid suffix "A760060006400680068006C006C006C00700028" on integer constant
sketch_aug20a.cpp:340:2: error: invalid suffix "A86007000740074007400780078007C007C00AC" on integer constant
sketch_aug20a.cpp:342:2: error: invalid suffix "C0A96007C00021E00CE74080401100257" on integer constant
sketch_aug20a.cpp:344:2: error: invalid suffix "FF" on integer constant
sketch_aug20a:0: error: expected unqualified-id before ':' token

Am I even burning the correct file? The instructions on Instructables mention a compiled hex file so I figured that was what I was supposed to be burning to the ATtiny45. Here's the link to the Instructables page (if it helps):

http://www.instructables.com/id/Jar-of-Fireflies/?ALLSTEPS

At the very bottom (Step 16) is the link to the source code file. Thanks again for all the help! I really appreciate it!

Coding Badly


The project is not intended to be used with the Arduino IDE.  If you rename firefly.c to firefly.pde and remove the non-source files (like the dot-hex file) the Arduino IDE may be able to build the project.

Or, search for uploading a HEX file using avrdude.

winter14


The project is not intended to be used with the Arduino IDE.  If you rename firefly.c to firefly.pde and remove the non-source files (like the dot-hex file) the Arduino IDE may be able to build the project.


I don't understand what you mean by this. Could you dumb it down a little? I'm sorry, like I said I'm new to this. I tried changing the name of the file and it just added the .c back on the end.


Or, search for uploading a HEX file using avrdude.


I loaded avrdude and verified that Arduino is one of the supported ISP's and ATtiny45 is a supported microcontroller so I don't think that is the problem, but when I enter the command to burn the hex file I get an error:


Roberts-MacBook-Pro:~ robertwinter$ avrdude -c arduino -p t45 -U flash:w:firefly.hex
avrdude: ser_open(): can't open device "unknown": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device

avrdude done.  Thank you.


Any ideas? Thanks!!!

Coding Badly



The project is not intended to be used with the Arduino IDE.  If you rename firefly.c to firefly.pde and remove the non-source files (like the dot-hex file) the Arduino IDE may be able to build the project.


I don't understand what you mean by this.


Which one of the three items do you not understand?

Quote
I tried changing the name of the file and it just added the .c back on the end.


Why did you append a dot-c?

Quote

Roberts-MacBook-Pro:~ robertwinter$ avrdude -c arduino -p t45 -U flash:w:firefly.hex
avrdude: ser_open(): can't open device "unknown": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device

avrdude done.  Thank you.


You did not specify the serial port.  I believe -P (dash-uppercase-P) is the argument.

winter14

I tried adding the -P usb argument and got the same error message, except instead of "unknown" it calls it "usb." The avrdude tutorial said it will automatically look in the usb for the programmer so it wasn't necessary. I looked up the name of the usb, thinking I may have not used the correct name to call it and tried again, but I got the same error. Here's both attempts:



Roberts-MacBook-Pro:~ robertwinter$ avrdude -P usb -c arduino -p t45 -U flash:w:firefly.hex
avrdude: ser_open(): can't open device "usb": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device

avrdude done.  Thank you.

Roberts-MacBook-Pro:~ robertwinter$ ls -l /dev/cu.*
crw-rw-rw-  1 root  wheel   33,   1 Aug 20 09:17 /dev/cu.Bluetooth-Modem
crw-rw-rw-  1 root  wheel   33,   3 Aug 20 09:17 /dev/cu.Bluetooth-PDA-Sync
crw-rw-rw-  1 root  wheel   33,  11 Aug 20 11:17 /dev/cu.usbmodemfa131 <--------------- I then tried using this instead

Roberts-MacBook-Pro:~ robertwinter$ avrdude -P usbmodemfa131 -c arduino -p t45 -U flash:w:firefly.hex
avrdude: ser_open(): can't open device "usbmodemfa131": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device

avrdude done.  Thank you.


Am I specifying the serial port correctly?

And I guess the biggest question I have is: Is there an easier way to do this? I feel like I'm over complicating things, and perhaps there is a better way to insert the source code (in C++ instead of hex?) into the Arduino environment so I can get this chip programmed? What would you do if you were me?

winter14

Ok, I believe I now have the correct command. Now it says the programmer is not responding:

Roberts-MacBook-Pro:~ robertwinter$ avrdude -p t45 -P /dev/cu.usbmodemfa131 -c arduino -U flash:w:firefly.hex
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.


Then if I immediately try the same command (I copied the command so I could easily paste it and try again) I get a different error:

Roberts-MacBook-Pro:~ robertwinter$ avrdude -p t45 -P /dev/cu.usbmodemfa131 -c arduino -U flash:w:firefly.hex
avrdude: stk500_getsync(): not in sync: resp=0xe0

avrdude done.  Thank you.


At this point I think there is a problem with the way the Arduino is set up but I could be wrong. I should also note that the L LED is solid, and the RX and TX only blink once, followed by a long pause before terminal gives me the error message "programmer is not responding." When I get the "not in sync" error the L LED is solid and the RX and TX LED's blink and immediately I receive the error message ("not in sync").

Is there something wrong with my Arduino?

Erni

Quote
Is there something wrong with my Arduino?


If I understand you right, you are able to both opload the blink sketch, and burn bootloader, so your Arduino and connections should be OK.

I would try to turn on verbose option in the IDE, and upload the blink sketch. This will tell you how the AVRDude commandline shoul be

winter14

#13
Aug 21, 2012, 07:11 pm Last Edit: Aug 21, 2012, 07:30 pm by winter14 Reason: 1
Verbose output from Arduino IDE when loading blink sketch onto ATtiny45:
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/robertwinter/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping
        Using Port                    : /dev/cu.usbmodemfa131
        Using Programmer              : stk500v1  <--------- Does not say Arduino, programmer is 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                      : ATtiny45
        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        256    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      4096   64     64  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: . [02]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
        Hardware Version: 2
        Firmware Version: 1.18
        Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
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         : 0.0 V
        Varef           : 0.0 V
        Oscillator      : Off
        SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [01] . [00] . [00] . [00] . [10] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: Send: P [50]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [1e]
avrdude: Recv: . [10]
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [92]
avrdude: Recv: . [10]
################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [06]
avrdude: Recv: . [10]
################################## | 100% 0.06s

avrdude: Device signature = 0x1e9206
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
        To disable this feature, specify the -D option.
avrdude: Send: V [56] . [a0] . [00] . [fc] . [00]   [20]
avrdude: Recv: . [10]
avrdude: erasing chip
avrdude: Recv: . [10]
avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [01] . [00] . [00] . [00] . [10] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: Send: P [50]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: reading input file "/var/folders/d2/j8mp7t8j3ng3dgflw6j29c5w0000gn/T/build3844067978631596133.tmp/Blink.cpp.hex"
avrdude: writing flash (832 bytes):
(I removed some stuff in the middle)


avrdude: Recv: . [ff] . [1f] . [ec] ] [5d] . [ff] O [4f] . [a5] . [91] . [b4] . [91] / [2f] . [b7] . [f8] . [94] f [66] # [23] ! [21] . [f4] . [8c] . [91] . [90] . [95] . [89] # [23] . [02] . [c0] . [8c] . [91] . [89] + [2b] . [8c] . [93] / [2f] . [bf] . [08] . [95] . [cf] . [93] . [df] . [93] o [6f] . [df] . [ba] . [de] . [c0] . [e0] . [d0] . [e0] . [a4] . [de]   [20] . [97] . [e9] . [f3] d [64] . [de] . [fb] . [cf] . [f8] . [94] . [ff] . [cf] . [0d] . [00]
avrdude: Recv: . [10]
#### | 100% 0.80s

avrdude: verifying ...
avrdude: 832 bytes of flash verified
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.


So I think it was successful in writing the blink program.

But then when I use the "stk500v1" as the programmer (from previous post) I get this error message:

Roberts-MacBook-Pro:~ robertwinter$ avrdude -p t45 -P /dev/cu.usbmodemfa131 -c stk500v1 -U flash:w:firefly.hex
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

It seems that the Arduino responds to the Arduino IDE but not to the AVRdude command line.

EDIT: I just noticed the L LED on the Arduino is blinking on and off in one second intervals. Is it possible that the blink sketch was burned to the Arduino and not the ATtiny45? I'll have to get an LED to verify.

winter14

I just confirmed that the "Blink" sketch was uploaded to the ATtiny45 with an LED. Then I tried burning the "Fade" sketch to the ATtiny, reconnected the LED, and everything works fine. The LED fades just as it should. So the connection between the Arduino and the ATtiny is correct so the problem must be how the AVRdude is communicating with the Arduino. Any suggestions?

Go Up