Safe to switch between using AVRDUDE and Arduino IDE?

Go To Last Post
55 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, I want to program an ATtiny using my Arduino UNO R3. To program my Arduino on an everyday basis I use Atmel Studio 6 and avrdude. To make the Arduino act like an AVRISP I will have to use Arduino IDE.

 

The question is: The "bootloader" Arduino IDE burns is just a regular hex-file right? So I can reprogram my UNO as usual using avrdude whenever I want after I've used it with Arduino IDE?

 

(when using avrdude I specify the "programmer", writing "-c arduino" - this has to do with the small chip on the UNO that interfaces with the USB right? Using Arduino IDE won't change any of this does it?)

 

Thanks so much for help.

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To program my Arduino on an everyday basis I use Atmel Studio 6 and avrdude.

You mean talking to the Uno's bootloader? Or do you own some ISP programmer such as a USBAsp that avrdude, invoked, from Studio 6, is driving? (though that would presumably raise the question as to why you cannot simply use that to program the tiny anyway?).

 

I guess what I'm asking os: has the Arudino board had its bootloader wiped or not?

 

if not then what's the mystery here - you just connect the board back to the Arduino IDE and it can "see" it just as before?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe I'm approaching this the wrong way.. Let me put it like this:

 

I want to program an ATtiny85-20PU, but I do not have an AVRISPMK2 or Atmel-ICE or anything. Just an Arduino UNO R3.

What is the best way of doing it? (I read you have to change fuses and so on in the guide, that got me worried, I don't do fuses)

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just load the sketch using the Arduino IDE to make the UNO a programmer.   Then you can use AVRDUDE to program the tiny using the UNO as programmer using the -c arduino command to AVRDUDE.     Simple. 

You can return the UNO back to normal use by loading other sketch's an needed. 

It makes a very handy programmer.

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

Just load the sketch using the Arduino IDE to make the UNO a programmer.   Then you can use AVRDUDE to program the tiny using the UNO as programmer using the -c arduino command to AVRDUDE.     Simple. 

You can return the UNO back to normal use by loading other sketch's an needed. 

It makes a very handy programmer.

But I don't write "sketches" normally. I use avrdude to load .hexfiles created in Atmel Studio 6.1. Can I do all this and then just write C code like normal, writing over the "bootloader". I don't want my UNO to mimic an ISP forever.

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have not understood how the UNO works.

 

You can (and I do) write regular C programs.    Then upload to the UNO hardware via the Bootloader:   avrdude -c arduino

You can (and I do) write regular C programs.    Then upload to a breadboard via an ArduinoISP sketch running on a UNO:   avrdude -c stk500v1 -b 19200

 

You can (and I don't) upload to the UNO hardware via the ISP 6-pin:   avrdude -c avrisp2       (or whatever ISP programmer)

This will destroy the Bootloader but some people like shooting their own feet.

 

Remember that you can always restore the Bootloader via the Arduino IDE Tools menu.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tickstart wrote:
...I use avrdude to load .hexfiles created in Atmel Studio 6.1. Can I do all this and then just write C code like normal, writing over the "bootloader". I don't want my UNO to mimic an ISP forever.

 

As long as you have been loading those hex files using avrdude with the -c arduino parameter then you will be fine.  The Arduino IDE passes that same parameter to avrdude when it programs the UNO as an ISP programmer.  In this case you are not overwriting the bootloader, you are using the bootloader to program the application hex file into the UNO.

 

 

 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Mon. Feb 16, 2015 - 05:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

You have not understood how the UNO works.

 

You can (and I do) write regular C programs.    Then upload to the UNO hardware via the Bootloader:   avrdude -c arduino

You can (and I do) write regular C programs.    Then upload to a breadboard via an ArduinoISP sketch running on a UNO:   avrdude -c stk500v1 -b 19200

 

You can (and I don't) upload to the UNO hardware via the ISP 6-pin:   avrdude -c avrisp2       (or whatever ISP programmer)

This will destroy the Bootloader but some people like shooting their own feet.

 

Remember that you can always restore the Bootloader via the Arduino IDE Tools menu.

 

David.

So I've been using the bootloader all along? But I thought the bootloader had like a five second delay or something before the program on the board starts.. I have no delay. I have never used the Ard. IDE, but I do know that the UNOs can come with the boot already installed. The tutorial I follow states the command:

avrdude -c avrisp -p t85 -P comX -b 9600 –U flash:w:example_attiny85.hex:i

.. this is after the ISP-program is on the UNO. Will this shoot my foot? o:

 

larryvc wrote:

 

Tickstart wrote:

...I use avrdude to load .hexfiles created in Atmel Studio 6.1. Can I do all this and then just write C code like normal, writing over the "bootloader". I don't want my UNO to mimic an ISP forever.

As long as you have been loading those hex files using avrdude with the -c arduino parameter then you will be fine.  The Arduino IDE passes that same parameter to avrdude when it programs the UNO as an ISP programmer.  In this case you are not overwriting the bootloader, you are using the bootloader to program the application hex file into the UNO.

 

So.. when programming the attiny85 through the arduino, what arguments do I pass to avrdude? -c arduino, -c stk500, -c avrisp, -c avrisp2? It's hard to know when the guides never specify why they do the stuff they do..

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not Google "ArduinoISP" and read the tutorials?

 

If you have a bare tiny85 on a breadboard,   you are probably going to use a 6-wire ISP programmer.

e.g. AVRISP-2, ATMEL-ICE, DRAGON, ... or a USBASP (with 10-pin -> 6-pin adapter.

 

However,   if you have a UNO,   you can use ArduinoISP.

 

But it is very important to understand the differences between "-c arduino" and "-c avrisp2" or "-c usbasp" or ...

Strangely enough,   if you Google "avrdude manual" you can see for yourself.   

You probably already have "avrdude.pdf" on your PC.

 

Of course,  it is quite possible that your tiny85 is running a bootloader.    But a virgin tiny85 can only do ISP.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wait.. So, in an ideal world, if the UNO acts as an ISP, Atmel Studio would recognize it as an avrisp too? So I can program the ATtiny through Atmel Studio? o:

 

wääh help me I'm totally lost +_+'

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll follow this tutorial. Has anyone any experience with this sort of thing?

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well,   most ArduinoISP.ino sketches use 19200 baud

 

Most avrdude commands would use "-c stk500v1" and not "avrisp"

 

I can't believe that that is the only Tutorial on the Internet.

 

And let's face it.    Your link shows a Linux PC.    Atmel Studio is a Windoze application.     I would look to see if there is a tutorial near to your hardware.     

 

And no,   AS6.2 will not recognise a non-Atmel programmer like ArduinoISP.ino

But you can add the correct avrdude command to your "After Build".

 

David.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tickstart wrote:

Wait.. So, in an ideal world, if the UNO acts as an ISP, Atmel Studio would recognize it as an avrisp too? So I can program the ATtiny through Atmel Studio? o:

 

wääh help me I'm totally lost +_+'

Unfortunately this is not an ideal world.  No, Atmel Studio will not recognize it as an avrisp, so no you cannot program the ATtiny directly with Atmel Studio.  You can however create a post build step in the project properties that will call avrdude to program the chip.  You can also create an External Tool in Atmel Studio that will program the chip.

 

You are not totally lost, you are only confused.  You are trying to run when you can't even walk yet.  Slow down, read more, do things slowly and in a methodical manner.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Mon. Feb 16, 2015 - 10:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David, stop preempting my posts!wink  Okay, I was a minute late. 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What does it matter if it runs on linux or win, avrdude is supposedly doing the same thing right? And I'm trying to read as much I can, but I need some guidance, please. 

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay, I just set up my Arduino as an ISP and issued this command to read the fuses and confirm that I had connected the programmer to the chip correctly.  (my target chip is an ATtiny2313 and my com port is com7, yours will probably be different) 

avrdude -c stk500v1 -p t2313 -P com7 -b 19200 -vv

This is what the command returned

 

C:\>avrdude -c stk500v1 -p t2313 -P com7 -b 19200 -vv

avrdude: Version 6.0.1, compiled on Dec 11 2013 at 19:32:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\avrdude\avrdude.conf"

         Using Port                    : com7
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATtiny2313
         Chip Erase delay              : 9000 us
         PAGEL                         : PD4
         BS2                           : PD6
         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        128    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      2048   32     64  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: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e910a
avrdude: safemode: lfuse reads as 24
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF

avrdude: safemode: lfuse reads as 24
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:DF, L:24)

avrdude done.  Thank you.

So I suggest you start with that command, modified for your chip and com port, and post the results even if you get errors.  If you do get errors double check the connections before posting.

 

EDIT: It really annoys me that no matter how I tried to paste that result into this post it always converted "0"  "9000"  "9000" "0" into something control character like. :\

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Feb 17, 2015 - 12:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow that's great! Did you hook up the capacitor between GND and RESET on the Arduino? I don't have a capacitor at the moment, hopefully I can get one tomorrow.

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No capacitor should be between GND and /RESET.  A 10K pullup resistor should be wired from +VCC to /RESET.  A 100nf bypass capacitor should be between +VCC to GND.

 

I did not have any of those in the circuit I just set up.  Try it, you may surprise yourself when it works. 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're probably referring to the 10 uF cap across RESET and ground on the UNO, recommended by some tutorials.  No you don't need it.  See this related thread:

https://www.avrfreaks.net/forum/serial-debugging-attiny84a-through-arduino-uno-isp

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:

No capacitor should be between GND and /RESET.  A 10K pullup resistor should be wired from +VCC to /RESET.  A 100nf bypass capacitor should be between +VCC to GND.

 

I did not have any of those in the circuit I just set up.  Try it, you may surprise yourself when it works. 

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is, I don't know.. I can upload code too. This worked too flawlessly to be real, something must be wrong here.. Did I just trigger some sort of nuclear missile!?

 

Hey larryvc, can I program fuses too? It's running @1MHz, but if I change the DIV8-fuse will I need to change something else then? The baudrate or, whatever..?

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I programmed the fuses, it works great! Now have an ATtiny85 running at 8MHz with the internal oscillator. Nothing other than jumper cables needed! Thanks guys you're the best!

 

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Hello, I want to program an ATtiny....."

 

Here's what I would do:  Take the plunge and buy a USBASP programmer from eBay.  They are around $4.00 USD.  Download and install the latest ASP driver.  Plug it in and check  Device Manager for USB ASP in the listing.

 

Put the ATtiny into a breadboard.  Connect wires from the USBasp 10-pin header to your bread-board that has the ATtiny plugged into it.  Check that +5v is getting to the ATtiny Vcc.   

 

Generate your .hex file from AVR Studio.  Run AVRdude with this command line: avrdude -p t85 -c usbasp -P usb -U flash:w:%1.hex

I run AVRdude as an Advanced:DOS command using UltraEdit text-editor.   I can directly upload (write a hex file to the ATtiny's flash space) assembler code this way.  For Arduino, I compile the program ('verify' ) with verbose listing selected.  Then I get the tmp directory from the listing.  There will be a file called:

<your .ino program's filename> plus .cpp  plus  .hex     ("Blink.cpp.hex").  Send this hex file to the ATtiny.  Make sure that the Arduino has been extended to be able to write code for the tiny AVR if you use Arduino.

 

This is fairly simple and reliable, and it could be made much easier with batch files and scripts.  If you want to use your Arduino UNO as a ISP programmer, take lots of notes on everything that doesn't work.  Post them here as a message or a project.  Make lots of charts with .GIF and .JPG image file programs.  If you figure out how Arduino works,  write it all  out on a WhiteBoard with colored magic markers.   Scan each section of the white board by holding the white board section over the scanner window.  Zip all the files and post them here as a project.  Make a You-tube video.

 

But I fear that asking questions here might just get you into techo-babble tread-mill with message short replies to an advanced but completely under-documented subject.  Which is anything dealing with amateur embedded-systems development.   Last but not least:  Dare to be stupid.  Ask over and over again whatever you don't understand.  But try all the various web pages even the really deep ones on Google.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, something's wrong now.. I can't read the device signature anymore.. I didn't do anything different :(

 

And now it sporadically worked again.. I don't know what's wrong, the chip is not broken, the LED blinks just fine. But it's just really hard to get the device signature apparently :/

sol i sinne - brun inne

Last Edited: Tue. Feb 17, 2015 - 02:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most likely the connections.  You should add the components, that I mentioned earlier, to the circuit.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aah, okay. I will do that when I get the hardware (: thanks for all help!

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:

Most likely the connections.  You should add the components, that I mentioned earlier, to the circuit.

Um, you're talking about the Arduino still right? And, I don't know what a pull-up resistor or a bypass capacitor is either :$ Guess I'll do some more reading

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No you mean on the tiny? That makes sense

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I programmed the fuses, it works great! Now have an ATtiny85 running at 8MHz with the internal oscillator. Nothing other than jumper cables needed! Thanks guys you're the best!

 

It all comes down to making good connections and following the advice from the data sheet.   i.e. 100nF capacitors.

 

It is worth making or buying a breadboard friendly ISP header.    Then you can use the reliable ribbon cable as intended.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, something's wrong now.. I can't read the device signature anymore.. I didn't do anything different

Did you experiment with using avrdude to change "fuses" by any chance?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

His avrdude command to the ArduinoISP sketch was fine.    And it verified.

 

I suspect any problems will be down to breadboard addiction and capacitor allergy.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will try to acquire the means to implement a correct setup today. If it works better then that will really be a lesson learnt in terms of basic circuit considerations.

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I favour dev boards.   You know that you have reliable soldered joints for the 'basics' like ISP and UART comms.

 

If you do go for a breadboard,   just follow the conventional advice.   i.e. 100nF capacitors close to the AVR and ISP on a proper header.

 

It does not matter too much if you lash up your GPIO with clothes pegs and sticky tape.   If they fail,  your AVR does not get bricked.

If you have 'unreliable' ISP connections,   glitches might change the fuses.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

see next post

sol i sinne - brun inne

Last Edited: Tue. Feb 17, 2015 - 09:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anyone have any clue? Code is running on the ATtiny85 (some basic blink program) so at least some parts of the chip are working. Last time I got a connection the fuses were all in good order.

 

I now have a 10uF and a 100nF capacitor in parallel (or is it in series? fuch I can't tell) between GND and VCC, so noise shouldn't be an issue, I want to believe. I have a 10k Ohm pull-up resistor between the RESET pin on the tiny and VCC. I have removed all cabling and re-done it from the beginning. Still I get:

 

sol i sinne - brun inne

Last Edited: Tue. Feb 17, 2015 - 09:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reprogram the arduino with the ISP sketch, then try to read the chip with avrdude again.

 

Post a clear picture of your breadboard and connections.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the best I can do. Did try to reprogram. Not sure I've added the components correctly (hope not!) The fancy looking capacitor on the Arduino is not installed.

sol i sinne - brun inne

Last Edited: Tue. Feb 17, 2015 - 11:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You do not need the cap on the arduino!  I thought I said that earlier, oh look up there, I did!wink 

 

For a test, only leave the 10K resistor and the 100nF cap on the tiny.  Make sure the resistor is 10K ohms.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:

You do not need the cap on the arduino!  I thought I said that earlier, oh look up there, I did!wink 

 

For a test, only leave the 10K resistor and the 100nF cap on the tiny.  Make sure the resistor is 10K ohms.

Yep I read it, many times over! :D Just wanted to avoid misunderstandings about the picture. Just noticed I had a 4.7k resistor, swapped it for a 10k, i get the same error message :c I don't get it, is the chip ruined or what?

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the chip ruined?  Possibly.  Is the chip installed in the right direction?  Don't you have any other chips available, spares?

 

Code is running on the ATtiny85 (some basic blink program) so at least some parts of the chip are working. Last time I got a connection the fuses were all in good order.

Last time you got a connection was when you programmed the fuses wasn't it?

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Wed. Feb 18, 2015 - 12:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:

Is the chip ruined?  Possibly.  Is the chip installed in the right direction?  Don't you have any other chips available, spares?

 

Code is running on the ATtiny85 (some basic blink program) so at least some parts of the chip are working. Last time I got a connection the fuses were all in good order.

Last time you got a connection was when you programmed the fuses wasn't it?

Hm, hope not :/ I programmed the fuses, but after that I did succeed in uploading a .hex-file to it. So it's really weird..

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am impressed.    A nice clear diagram of your wiring.    Now all that you have to do is see whether real-life corresponds to your computer-generated diagram.

 

You appear to have a good connection from message #20.    And your command in message #22 looks fine.   i.e. it just clears the CLKDIV8.

 

I would just type

avrdude -c stk500v1 -P com3 -b 19200 -p ATtiny85

Since the report says that "AVR device initialised and ready to accept instructions"  in message #35,   you must be almost good.

If it reports Signature = 0x000000,   type it again:

avrdude -c stk500v1 -P com3 -b 19200 -p ATtiny85

If you do not get an "initialised",   this means that ArduinoISP is not running.

 

Are you sure that the "10k resistor" really is 10k ?

You can remove it completely.

 

And yes,   breadboard wires can break or make poor connections.    It is worth testing with a multimeter.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

I am impressed.    A nice clear diagram of your wiring.    Now all that you have to do is see whether real-life corresponds to your computer-generated diagram.

 

You appear to have a good connection from message #20.    And your command in message #22 looks fine.   i.e. it just clears the CLKDIV8.

 

I would just type

avrdude -c stk500v1 -P com3 -b 19200 -p ATtiny85

Since the report says that "AVR device initialised and ready to accept instructions"  in message #35,   you must be almost good.

If it reports Signature = 0x000000,   type it again:

avrdude -c stk500v1 -P com3 -b 19200 -p ATtiny85

If you do not get an "initialised",   this means that ArduinoISP is not running.

 

Are you sure that the "10k resistor" really is 10k ?

You can remove it completely.

 

And yes,   breadboard wires can break or make poor connections.    It is worth testing with a multimeter.

 

David.

I do get the initialized-thing.. I guess this is better than nothing, but why isn't it doing more than that? D: Are there some fuses that could've gone haywire or, I don't know. Thinking of getting another chip, but it feels like such a shame.. And another 30 SEK!

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not knowing what caused the problem in the first place is problematic.   Even if you purchase another chip, what if it happens again?  En annan 30 SEK?

 

I know you want to be able to do something more off of an arduino.  I do suggest that you consider a better alternative.  Atmel have the ATmega328P Xplained Mini, they sell it for US $8.88, though they charge a higher price than that for shipping.  You should be able to order one from a more local European distributor.  

 

The beauty of that board is that, unlike an arduino, it has a built in debugger that works seamlessly with Atmel Studio 6.2.  So then if you got one of these you could both program and debug your code.  I think they are a great value.  Håller ni med mig?

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Thu. Feb 19, 2015 - 06:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Haha visserligen! But you know, once I get something on my mind.. I was totally fine exploring the possibilities of the 328P on the arduino before I thought of programming the tiny. So I think I will try one more time (this time with the correct circuit from the beginning), if it fails then I will go back to just programming the Arduino as usual.

 

Thanks for the help though, I will return to confirm that I've ruined another chip or not.

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seriously.    Re-build your breadboard with fresh wires.    Or perhaps a different location on the breadboard.

 

Or buy an XMINI from a European distributor like Farnell.     Atmel Store is expensive for Shipping and you have to pay an extra $20 to DHL.

 

If you want to do lots of programming of a Tiny85 on a breadboard,   a $3 USBASP will be more convenient than the UNO.

 

David.

Last Edited: Thu. Feb 19, 2015 - 08:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay, I hate my life. The new chip behaves exactly the same, I can read it at first, I set the lower fuse to 0xE2 (unprogram CKDIV8), I can then program the chip ONCE. Then it never responds again. I'm done with this hobby :'(

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does this help?

 

https://www.avrfreaks.net/forum/t...

 

Bottom line: apart from RSTDISBL there is very little you can do to an AVR to lose contact completely.

 

I'm too lazy to read this entire thread but which micro is this? If a debugwire one then setting DWEN can also look "difficult" sometimes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's an (well, two now..) ATtiny85 with Arduino as ISP. The fuses were set correctly, I'm sure. Here's the datasheet table plus windows calculator value. I will read the link you provided, thanks.

sol i sinne - brun inne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The fuse calculator says:

avrdude -c stk500v1 -P com3 -b 19200 -p ATtiny85 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m 

So I can't see where the problem might be other than unreliable wiring.

 

Mind you,   if you own an Arduino,   you can make almost any project that you like.    Reliably.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah f*** this s***, I don't think I'll do any more electronics for a while. 

sol i sinne - brun inne

Pages