Go Down

Topic: attiny 85, any pointers?/ (Read 23187 times) previous topic - next topic

winner10920

I just recentlygot a bunch of attiny85's and I was wondering how the best way to use them would be, I was thinking some wireless applications but those need spi or serial which it doesn't have
I did a little research and it doesn't seem that bad to do the regular arduino code on it, but every other library looks like it needs to be reworked, does anyone know any good links to some attiny 85 libraries for like spi and serial?

wanderson

The tiny85 does have a USI bus, I believe, which can be set-up as I2C and I believe SPI as well.  And CB's tiny core provides software serial compatibility
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Runaway Pancake

The 85's program memory isn't very big, lots (most?) libraries would gobble most of that up, leaving room for little else.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

wanderson

#3
Jul 25, 2012, 03:14 pm Last Edit: Jul 25, 2012, 03:16 pm by wanderson Reason: 1

The 85's program memory isn't very big, lots (most?) libraries would gobble most of that up, leaving room for little else.


The 85 has basically the same specs in terms of memory as the original Arduino with the ATMEGA8...  8k flash / 1k ram

That is a lot of space, more than my first desktop computer had...
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Graynomad

Yes the USI can be used for SPI, but for that matter so can any 2-3 pins if you want to bit bang.

I've used 85s with AVR Studio, they are pretty easy to use even without the Arduino framework.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

winner10920

I was thinking along the lines of just transmitting simple enviroment data, other than the library not much code just digital or analog reads
I was thinking using the nrf24l01 since they are so cheap but couldn't find any rx/tx examples with an attiny 85
anyone got a link to an attiny spi library? I could probably get the library that uses spi to work with another but the usi hardware to spi part I think is beyond my current level of programming
Im gonna look into that cp's core since I definetly may have some hardwired rs485 uses for an attiny85

wanderson

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

winner10920

I did see that before but it didn't mention the 85, I guess that would work tho?

wanderson


I did see that before but it didn't mention the 85, I guess that would work tho?


The code might require some minor changes, but it should work.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Chagrin


I did see that before but it didn't mention the 85, I guess that would work tho?


It doesn't mention the ATTiny except for this mention, you mean ;)

As you may know the ATtiny chips come with an USI module, which can be made to work as an SPI (master/slave) device, or even a I²C device as well. The latter is a bit tricky though for beginners. There's an article + library on the playground as well.



Graynomad

Quote
char *ptr = 0x0000014;

I've been waiting to see how long it took for someone to pick up on the "pointer" :)

But shouldn't it be

char *ATtiny = 85;

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

winner10920

Lol good one, and I meant mention attiny 85 not the series in broad which I don't like to assume it works as is for everything since I imagine everything from the 28pin ic to the 6pin doesn't have the same machine code

Graynomad

#12
Jul 26, 2012, 05:51 am Last Edit: Jul 26, 2012, 05:52 am by Graynomad Reason: 1
Quote
28pin ic to the 6pin doesn't have the same machine code

By and large they are the same, different peripherals and numbers of peripherals of course and therefore different registers to address but the core machine instructions are the same (at the ASM source code level) and at the C level there's no difference.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

winner10920

So if I make a library called spi85 that basically includes that code, then change the mirf library to use the spi85 instead of regular spi, it should work right? I know size of the library may cause problems but I think I can handle that

Graynomad

There's always a gotcha but in theory it should work.

I don't know what the mirf library is or what it needs, but presumably you will have to emulate all the normal SPI functions with your own versions.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up