Arduino Forum

Using Arduino => Microcontrollers => Topic started by: pick1e on Oct 05, 2012, 05:15 am

Title: Need some direction with using ATTINY85
Post by: pick1e on Oct 05, 2012, 05:15 am
Hi all, hopefully someone can give me some direction on this, I don't know where to start looking.

I have an ATTINY85 that I've been able to program with some simple blink/beep type sketches using my Arduino Uno as ISP. But how do I access its registers and EEPROM?

The first thing I need this for is to set pin 1 as an I/O pin rather than RESET. I assume I need to set a register value but I have no idea how I'd access it.

I'm using Arduino 1.0.1, and Arduino-Tiny http://code.google.com/p/arduino-tiny/

Thanks in advance,
Title: Re: Need some direction with using ATTINY85
Post by: Denbo on Oct 05, 2012, 05:23 am
Try http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=547834
Title: Re: Need some direction with using ATTINY85
Post by: Coding Badly on Oct 05, 2012, 05:30 am
But how do I access its registers and EEPROM?


Exactly the same way you do with an Arduino board...
http://www.arduino.cc/en/Reference/PortManipulation
http://www.arduino.cc/en/Reference/EEPROM

The ATtiny85 datasheet also has good C examples of register access.

Quote
The first thing I need this for is to set pin 1 as an I/O pin rather than RESET.


Once you do that you can only program the processor using a high-voltage programmer or a bootloader.

Quote
I assume I need to set a register value but I have no idea how I'd access it.


No.  You change a "fuse bit".
Title: Re: Need some direction with using ATTINY85
Post by: fungus on Oct 05, 2012, 10:13 am

Hi all, hopefully someone can give me some direction on this, I don't know where to start looking.

I have an ATTINY85 that I've been able to program with some simple blink/beep type sketches using my Arduino Uno as ISP. But how do I access its registers and EEPROM?


Same as any other Arduino.


The first thing I need this for is to set pin 1 as an I/O pin rather than RESET. I assume I need to set a register value but I have no idea how I'd access it.


Nah, you don't want to do that.

The reset pin is used for programming the chip. If you reconfigure it you lose the ability to upload code, etc. The only way to get it back again is with a special device (a "High voltage programmer").

Title: Re: Need some direction with using ATTINY85
Post by: strykeroz on Oct 05, 2012, 01:22 pm

The first thing I need this for is to set pin 1 as an I/O pin rather than RESET. I assume I need to set a register value but I have no idea how I'd access it.
You know it can be used in a limited way as an IO pin while retaining the reset functionality too?  It's capable of being addressed as digital pin 5 or analog 0 if you're coding from the IDE.  What are you intending to connect it to?

Geoff