Go Down

Topic: Need help with ATtiny85. (Read 4907 times) previous topic - next topic

jonrobertd

So I bought an ATtiny85 20pu, and have been doing a lot of research as to burning bootloader, setting clock speeds, ect but I am at a total loss.  First off this is my setup: tiny core, Mega 2650 as isp, triple checked pins, red LED on error, green on heartbeat, and yellow on programming. The green pulses fine, but the yellow pulses too when not programming. The yellow goes out when trying to program, is this normal. 

Now on to the main problem, I know that Tools> burn bootloader doesn't actually burn a bootloader, it sets the clock fuses, I want to do this at 8Mhz so I select Board> ATtiny85 @8Mhz and hit burn bootloader and this is one of two errors I get:
Code: [Select]
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
***failed; 
avrdude: verification error, first mismatch at byte 0x0000
         0xff != 0x00
avrdude: verification error; content mismatch


and this is the other:
Code: [Select]
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Expected signature for ATtiny85 is 1E 93 0B
         Double check chip, or use -F to override this check.


I know the default is 1Mhz so I select that as the board and try to upload the blink example and get the same error as the first except 0x1a instead of 0xff.
Any help is appreciated as I am a complete NOOB when it comes to this stuff.

Nick Gammon

I've uploaded a sketch to the Attiny 85 using a custom uploader:

http://www.gammon.com.au/forum/?id=11638

See here in particular: http://www.gammon.com.au/forum/?id=11638&reply=1#reply1

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jonrobertd

Thank you for the quick response, but you just blew my mind out. Any tutorial on how to use it? I saw where you had one hooked up to an uno, I have a mega so are there things I need to change, I don't have an sd reader,....... AHHH who am I kidding, im totally lost.  Thanks for any help.

borland

After you figure it out.  You may want to consider using a AVR USBtinyISP instead.  You can make a programming adapter or  include a ICSP on your ATtiny85 breadboard.

AVR USBtinyISP  are available on eBay from China with a blue plastic case for about $14, which includes shipping to USA.

Coding Badly


Resistors with those LEDs?

The problem is very likely wiring.  What are you using for a guide?

Nick Gammon


Thank you for the quick response, but you just blew my mind out. Any tutorial on how to use it? I saw where you had one hooked up to an uno, I have a mega so are there things I need to change, I don't have an sd reader,....... AHHH who am I kidding, im totally lost.  Thanks for any help.


That particular sketch works without the SD card connected. You can verify the chip is OK, and change the fuses.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jonrobertd

Yes there are resistors with the LEDs. And for wiring I followed the Arduino as ISP sketch following the pinout for the mega. As far as following a guide, I have tried the MIT, and a few others with no success.

Nick, do I upload your sketch to my mega, if so how do I see the commands, serial monitor or something. 

Nick Gammon

Yes, serial monitor. 115200 baud from memory.

The pins would be the same (numbers) as it is bit-banged SPI for the programming (hardware SPI for the SD card).
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jonrobertd

Ok so I have everything wired up (D4-7) run the sketch, open serial monitor and watch, it hangs on attempting to enter programming mode. Where does D9 need to connect to attiny to see if that helps?

Nick Gammon

You shouldn't need the external clock unless you changed the fuses.

However it looks like CLKI (clock input) is pin 2 on the chip. If running D9 to that doesn't help can you post a photo of your wiring please?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Coding Badly

Ok so I have everything wired up (D4-7) run the sketch...


D4 through D7 on the target?

jonrobertd

Nope D4-7 on the mega. Here is that pic:

Nick Gammon

Can you get a closer-up pic? I can hardly make out what is going where.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Coding Badly

Nope D4-7 on the mega.


Wrong pins...

http://arduino.cc/en/Hacking/PinMapping2560

...50 through 53 are correct.

jonrobertd



Do I use 50-53 or 4-7?  I'm even more lost.

Go Up