Go Down

Topic: Attiny85 tone issue (Read 13258 times) previous topic - next topic

fotokid

I found this:

attiny85arduinoisp.name=ATtiny85 (w/ Arduino as ISP)
attiny85arduinoisp.upload.using=arduino:arduinoisp
attiny85arduinoisp.upload.maximum_size=8192
attiny85arduinoisp.build.mcu=attiny85
attiny85arduinoisp.build.f_cpu=1000000L
attiny85arduinoisp.build.core=attiny45_85

Still the same error message

Coding Badly

Quote
ATtiny85 (w/ Arduino as ISP)


...is that the board you are using?  That you have selected when you upload?

fotokid

No sorry I copied the wrong one, I need to be using this one:

# attiny85at8.upload.using=arduino:arduinoisp


fotokid

I added this:

attiny85at8.name=ATtiny85 @ 8 MHz  (internal oscillator; BOD disabled)
attiny85at8.upload.using=arduino:arduinoisp
attiny85at8.upload.maximum_size=8192
attiny85at8.build.mcu=attiny85
attiny85at8.build.f_cpu=8000000L
attiny85at8.build.core=tiny

it matches the other board.txt formats but still same error message

fotokid

Well somehow it worked itself out and now my tiny is fully programmed. :smiley-mr-green:

Coding Badly


Lazy Glen

Just wanted to thank you for your Tiny core that supports Tone. It took me a while to figure out that I needed to download the code under the Featured heading in the left pane, I was looking at the stuff in the larger area.

Anyway, I'm using my ATTiny85 with the Tone function and I appreciate your efforts.

Lazy Glen

Coding Badly

Just wanted to thank you for your Tiny core that supports Tone.


You are welcome.

Does the HLT core not support Tone?


Quote
It took me a while to figure out that I needed to download the code under the Featured heading in the left pane, I was looking at the stuff in the larger area.


Link added to the larger area.  Thanks for the feedback.

DoctorOctoroc

Hey, I'm jumping in on this topic with a quick question. I did everything I could to figure this out on my own and even have searched other sites for the answer but found nothing. Basically, I have a sketch that uses the tone() funcion to play a noise. It works swimmingly with the Arduino UNO and breadboard prototype but when I try to load it on to the ATtiny85, I get this message:

avrdude: usbdev_open(): did not find any USB device "usb"

I haven't seen that message mentioned here so I'm wondering if there are any changes I need to make to the boards.txt file that are different from the ones that fotokid had to make.

Coding Badly


What are you using for a programmer?

DoctorOctoroc

Sorry, just started using this stuff so I'm not sure exactly what you're asking. Everything I'm doing is the same exact setup as fotokid, as far as I know - same Arduino UNO SMD board, same ATtiny85 chip, and I'm using the same board setting from the core file, which was ATtiny85 @ 8 MHz (internal oscillator; BOD disabled). Using Arduino 1.0 as the IDE. Here's my sketch if it helps:

Code: [Select]
#include "pitches.h"

int melody[] = {
  NOTE_CS4, 0, NOTE_CS8, 0, NOTE_CS4, 0, NOTE_CS8, 0, NOTE_EE, 0, NOTE_DS8, 0, NOTE_EE, 0, NOTE_DS8, 0,
  NOTE_CS4, 0, NOTE_CS8, 0, NOTE_CS4, 0, NOTE_CS8, 0, NOTE_EE, 0, NOTE_DS8, 0, NOTE_EE, 0, NOTE_DS8, 0,
      NOTE_DS7, 0, NOTE_DS8, 0, NOTE_DS7, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0,
      NOTE_DS7, 0, NOTE_DS8, 0, NOTE_DS7, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0,
          NOTE_CS5, 0, NOTE_DS8, 0, NOTE_CS5, 0, NOTE_DS8, 0, NOTE_GG, 0, NOTE_DS8, 0, NOTE_GG, 0, NOTE_DS8, 0,
          NOTE_CS5, 0, NOTE_DS8, 0, NOTE_CS5, 0, NOTE_DS8, 0, NOTE_GG, 0, NOTE_DS8, 0, NOTE_GG, 0, NOTE_DS8, 0,
      NOTE_DS7, 0, NOTE_DS8, 0, NOTE_DS7, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0,
      NOTE_DS7, 0, NOTE_DS8, 0, NOTE_DS7, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0, NOTE_FF, 0, NOTE_DS8, 0, };

int noteDurations[] = {
  30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80,
  30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80,
  30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80,
  30, 80, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80,
  30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80,
  30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80, 30, 80,
  30, 80, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, };

void setup() {
}

void loop() {
  for (int thisNote = 0; thisNote < 128; thisNote++) {

    int noteDuration = 100/noteDurations[thisNote];
    tone(0, melody[thisNote],noteDuration);

    int pauseBetweenNotes = noteDuration * 1.20;
    delay(pauseBetweenNotes);

    noTone(0);
  }
}


Everything compiles fine, then I get that error about the USB.

Coding Badly

Quote
Sorry, just started using this stuff so I'm not sure exactly what you're asking.


No problem.  Is your Uno connected to the ATtiny85?

DoctorOctoroc

Yes, I followed the tutorial on High Low Tech for the proper setup. However, I also get that same error message even if the Uno is not hooked up to the the ATtiny85.

DoctorOctoroc

I just figured out what you were asking (I think). I had it on the "AVRISP mkII" setting for programmer. I tried it as well with the "Arduino as ISP" setting and got this error message:

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

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: stk500_cmd(): programmer is out of sync


From what I understand, the first two lines are not a problem. I'm also assuming that despite the fact that I am indeed attempting to use the Arduino as an ISP for programming the ATtiny85, that is not the correct setting...

Coding Badly


Are you using Arduino IDE 1.0?

Go Up