Pages: [1]   Go Down
Author Topic: Need some direction with using ATTINY85  (Read 2037 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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".
« Last Edit: October 05, 2012, 03:20:42 am by Coding Badly » Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 152
Posts: 5761
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

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

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Pages: [1]   Go Up
Jump to: