attiny 85, any pointers?/

Yup...it runs standalone..you'll only need a resonator/crystal if you set the fuses to 20MHz . I was able to control an ultrasonic rangefinder and a servo from an ATTiny85 and transmit the servo postiton and sensor reading to my computer with a pair of XBee radios.. You'll just need to set it back to 1MHz to use the simple sketches like Blink and Fading.

Cheers,
Mr_E

Why wouldn't simple sketches work? Does it affect millis() or something?

winner10920:
Why wouldn't simple sketches work? Does it affect millis() or something?

At 20 MHz, millis and the other time functions will be off. It's a limitation brought over from the Standard Arduino Core.

The Tiny Core works well at the typical clock speeds: 1, 8, and 16 MHz and should work fine at 2 and 4 MHz.

Note: The ATtiny85 processor is able to run at 16 MHz with no external components.

Yes, exactly what Coding Badly said :slight_smile: ... The Arduino Core has limitations like that.

Cheers!
Mr_E

Ok, so I've got the atttiny85 fuses set for 8mhz, and uploading programs work
now I just gotta work on that spi
Im gonna try and use that playground example as part of an 85spi library, if anyone knows of one already let me know lol

Ok, I set the 85. To 16Mhz, figured it can't hurt
made myself a mirf85 and spi85 library, which at this point mesh well and compiles, however the functions I need to replicate are blanked out for now
if anyone knows these it will helpp me, im gonna try and do it myself but mybe there's a bettter way
I need
Begin()
setDataMode(SpiMode0)
sesetClockDivisor(SPI2xclockmask)
end()

Success! Sorta
I got spi working for use with the nrf24l01 module, actually not too hard at all
now the problem lies with that I used all my I/o on it so I can't do anything lol
Guess I should've gotten the 84 for use with the nrf24l01, although I kinda like the small 8pin dip I can fit on the back of the nrf24l01 if I wanted
I think perhaps if I only use it in tx mode I can save the ce and csn pin by tieing them to a rail, tht will allow me 2 pins maybe for ds18b20 and a few buttons

Hi there,

Would you mind sharing exactly how you got spi to work? I'm trying to do something similar (ATtiny84 with RF24 library), and I modified both libraries so that my program would compile but it is still not working. I am not getting a clock signal at the SCK pin so I suspect I am referring to the pins incorrectly in the modified SPI library.

Thanks!

Here's the modified libraries, both the modified spi and the mirf modified to use the new spi
If you want to reuse the pins from spi you should be able to call spi85.end but I haven't tested that yet
Note that the mosi miso are opposite for the attiny85 so the mosi pin is being used as miso and vice versa, that's just the way the USI hardware is
this should also work with the attiny84 although that too I didn't test yet

Thanks for the reply, although I might be missing something as I don't see any download links?

Guess my phone didn't upload it right, ill try again
i may have to get a different browser on my phone

attiny85l.zip (23.7 KB)

Thank you very much, I'm gonna try and play around with it later today

Just wanted to thank you again, your modified library worked like a charm with the 84, And everything is working beautifully!

Awesome, wasn't sure if it was going to, I was planning on getting an 84 eventually so i coded for it
glad i could help : )

navidad:
Just wanted to thank you again, your modified library worked like a charm with the 84, And everything is working beautifully!

Could you post some sample code?

I'm trying to use the ping_client and ping_server examples. I've got an ATtiny84 running the ping_client (modified to use the libraries provided by winner10920) and I've got an Arduino Uno using the ping_server example but just the stock example, not modified at all.

The ATtiny sends the packets, but the Uno doesn't receive them.

Hey there,

First off, how do you know the 84 is sending? I would check to see that MISO and MOSI are connected properly (they are opposite on the 84, kinda confusing).

Also, I would make sure one of the devices has the "role pin" set to ground (I think that's how it worked?).

Let me know if you still can't get it to work, I can try to dig up some code

I double checked my connections and it turns out that I didn't have the MISO and MOSI reversed on the UNO. I had them reversed on the ATtiny, but not the UNO.

Of course, I shouldn't have had them reversed on the ATtiny because the library reverses the mappings already. Whoops.

What did you mean by the role pin though?

I had them reversed on the ATtiny, but not the UNO.

Semantics :slight_smile:


Rob

skootles:
I double checked my connections and it turns out that I didn't have the MISO and MOSI reversed on the UNO. I had them reversed on the ATtiny, but not the UNO.

Of course, I shouldn't have had them reversed on the ATtiny because the library reverses the mappings already. Whoops.

What did you mean by the role pin though?

Glad you fixed that

Just looking at the standard ping example at http://maniacbug.github.com/RF24/pingpair_8pde-example.html

If you read the comments there is a section that describes how you set the "role" of the transmitter, and you should have one of each role so that you have back-and-forth communication.

I wasn't using the RF24 examples, I was using the MIRF examples which don't use the role pin.

Also, it appears I spoke too soon. The UNO was reporting that it was getting packets even though none were being sent. I'll take another crack at it tomorrow when I'm more rested, but if you've got any example that you know works, that'd be helpful.