Pages: 1 [2] 3   Go Down
Author Topic: Arduino 1.0.3 - Arduino Uno and ATTiny85 problems (video included)  (Read 2548 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


There are two possibilities... 1. Wiring; 2. Clocking

If you have never successfully changed the fuses (done by "Burn Bootloader") then it cannot be #2.


i bought the attiny85 from ebay and this is the first time i'm doing something with it.

i've read some stuff about clocking but I can't figure it out. i have a spare 32KHz crystal, I tried plugin it in the attiny external crystal pins (from the datasheet) but it didn't work. I know almost nothing about attiny and external crystals and fuses etc...

So please guide me, it must be the clock. My arduino is running the ArduinoISP sketch successfully (it is heartbeating in D9), everything is connect like it should to the attiny and I have a spare 32KHz crystal I can use (no 16MHz nor 20MHz..). What steps should I take using the crystal to get my attiny to work right at 8MHz with internal clock

ps: and sorry about the other post, my mistake
« Last Edit: February 23, 2013, 07:08:52 pm by andrepcg » Logged

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


Use this version of ArduinoISP... https://raw.github.com/adafruit/ArduinoISP/master/ArduinoISP.ino  Don't forget to remove the capacitor when you upload the new ArduinoISP sketch and reconnect the capacitor after uploading.  Don't forget to change the board setting before uploading.

Connect pin 9 on the programmer (your Uno) to XTAL1 / physical pin 2 on the target (ATtiny85).

Try to upload a sketch to the target.  Don't forget to change the board setting to one of the ATtiny85 internal oscillator settings.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I unplugged Uno, removed the capacitor, set the board as Arduino Uno, plugged Uno, uploaded the ArduinoISP sketch you provided, everything went fine, unplugged Uno again, connected capacitor, set board as ATtiny85 @ 1MHz (internal osc), plugged Uno, sent the blink sketch and freaking error again......

output: http://pastebin.com/YK1hfZaL

what the hell is going on? so much trouble...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry about the double post but it's relevant.

what if I told you that using the command line avrdude and the command -F to ignore the signature, it worked?

but it's too fast. the blinking is set to 1s but it's taking something like 1/4s to blink. and i still can't upload it correctly using the arduino program, it always gives me signature error

is there any way to correct the signature error? the fuses are set correctly but i still can't use the arduino software to send the sketches..

edit: and i can make it run at 1MHz but the timings are off (delay)
« Last Edit: February 23, 2013, 09:49:29 pm by andrepcg » Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 29
Posts: 2244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First step should always to be sticking LEDs on pins 7/8/9. From the ArduinoISP code:

Code:
// this provides a heartbeat on pin 9, so you can tell the software is running.
uint8_t hbval=128;
int8_t hbdelta=8;
void heartbeat() {
  if (hbval > 192) hbdelta = -hbdelta;
  if (hbval < 32) hbdelta = -hbdelta;
  hbval += hbdelta;
  analogWrite(LED_HB, hbval);
  delay(20);
}

Now you'll know if you've actually got the ISP sketch running. Anything else is guesswork.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yep, i did that and it's working. could the problem be from the attiny chip I bought?

i got the attiny running the blink sketch @ 1MHz using the command -F to bypass the signature and it works. the small issue here is that a delay of 1000 (1 second) corresponds to 0.5ms, 2000 -> 1s. what the hell is going on?

is there any way to get the signature stuff working?
« Last Edit: February 23, 2013, 10:20:32 pm by andrepcg » Logged

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


Does it continue blinking if you remove the jumper from pin 9 / XTAL1?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Does it continue blinking if you remove the jumper from pin 9 / XTAL1?

if I give it the clock from pin #9 it blinks faster, if I remove it it blinks for 500ms @ 1MHz but I still cant get the device signature right. I always have to use -F to bypass it
Logged

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


Huh.  That's an interesting twist.  It runs with no clock on XTAL1.  It runs faster with an 8 MHz clock on XTAL1.  And you have not been able to read the signature.

Try reading the fuses.  I think one -v will do it...

Code:
C:\Users\Andre\Desktop\arduino\hardware/tools/avr/bin/avrdude -CC:\Users\Andre\Desktop\arduino\hardware/tools/avr/etc/avrdude.conf -v -pattiny85 -cstk500v1 -P\\.\COM3 -b19200

You may have to add a -F to get it to limp along.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is was i got reading the fuses using -F

Code:
C:\Users\Andre\Desktop\arduino\hardware\tools\avr\bin>avrdude.exe -CC:\Users\Andre\Desktop\arduino\hardware/tools/avr/etc/avrdude.
conf -v -pattiny85 -cstk500v1 -P\\.\COM3 -b19200 -F

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

             System wide configuration file is "C:\Users\Andre\Desktop\arduino\hardware/tools/avr/etc/avrdude.conf"

             Using Port                    : \\.\COM3
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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
               flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
               lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

             Programmer Type : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us

avrdude.exe: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATtiny85 is 1E 93 0B
avrdude.exe: safemode: lfuse reads as 62
avrdude.exe: safemode: hfuse reads as D7
avrdude.exe: safemode: efuse reads as FF

avrdude.exe: safemode: lfuse reads as 62
avrdude.exe: safemode: hfuse reads as D7
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

Logged

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

Code:
avrdude.exe: safemode: lfuse reads as 62
avrdude.exe: safemode: hfuse reads as D7
avrdude.exe: safemode: efuse reads as FF

...

Code:
Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value
Divide clock by 8 internally; [CKDIV8=0]
Brown-out detection disabled; [BODLEVEL=111]
Serial program downloading (SPI) enabled; [SPIEN=0]
Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

...common fuse settings for 1 MHz.


Try a different section of you breadboard.  Avoid the "power rails".
Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 196
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I ran into the same issues. It turned out to be a connection problem. Use your multimeter to test each pins and wires. It couldn't hurt to get another ATTiny too. They're so cheap, might as well.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

already tried another section of the breadboard using no powerails and it's the same, can't get the signature........

i bought 2 attiny85 from ebay, already tried both of them with no success and that's what's weird..

but tomorrow i'll get another one from a local store and try them. it's very weird because the pins are getting powered, there are no connection issues that i can see, but the problem persists

edit: tried another breadboard, changed the resitor and led to a different layout, the capacitor for the reset is also on the breadboard and doesn't work........
« Last Edit: February 25, 2013, 03:17:29 pm by andrepcg » Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 196
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the connection while it's unpowered. I test the ohms from the pin to the end of the wire. You should get something besides zero.
Push the chip down aggressively.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the connection while it's unpowered. I test the ohms from the pin to the end of the wire. You should get something besides zero.
Push the chip down aggressively.

which wire?
Logged

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