Go Down

Topic: Need some direction with using ATTINY85 (Read 2220 times) previous topic - next topic

pick1e

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,

Denbo

Try http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=547834

Coding Badly

#2
Oct 05, 2012, 05:30 am Last Edit: Oct 05, 2012, 10:20 am by Coding Badly Reason: 1
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".

fungus


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").

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

strykeroz


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
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Go Up