ATtiny supported?
-
I would like to use small 8pin AVRs for nodes with only one sensor (like temp).
Is ATtinys supported?I'm sorry if this is a dumb question, I'm new to the Arduino and AVR world.
-
I would like to use small 8pin AVRs for nodes with only one sensor (like temp).
Is ATtinys supported?I'm sorry if this is a dumb question, I'm new to the Arduino and AVR world.
I doubt it but this might help: :)
http://hackaday.com/2014/02/16/nrf24l01-using-3-attiny85-pins/ -
I would like to use small 8pin AVRs for nodes with only one sensor (like temp).
Is ATtinys supported?I'm sorry if this is a dumb question, I'm new to the Arduino and AVR world.
@Rasmus-Eneman IMHO there's nothing in the library that would prevent it from running on an ATTiny, but you might (will?) probably have troubles fitting everything in the available flash/ram.
Connecting the nRF24 radio might also be troublesome as the ATTiny really has too little pins. I saw an article where somebody combined CE/CSN pins but this required some external components and modifications to the nRF24 library.
ATTiny is also not supported by Arduino and can only be added by using third party software.
I doubt if all is worth the trouble really... -
I doubt it but this might help: :)
http://hackaday.com/2014/02/16/nrf24l01-using-3-attiny85-pins/ -
I actually saw some Arduino projects on ATtiny, however I didn't thought of the IO problem.
Guess I will have to kill that idea.Thanks both of you for the fast response :)
-
I would like to use small 8pin AVRs for nodes with only one sensor (like temp).
Is ATtinys supported?I'm sorry if this is a dumb question, I'm new to the Arduino and AVR world.
You can find a lot of guides on the web about using the Arduino environment for the ATTiny series.
The TMRH2o nRF library is supposed to support ATTiny, but may not have been tested.
You already know that pins are going to be very tight, but if you have a one-pin sensor which doesn't need much code...
It might be possible to fit the sensor code (for some sensors) and the MySensors libraries, but if so it would be tight.
One tip: avoid any floating point code (some node sketches use it and some do not).
I'd actually love to see somebody make a MySensors node on an ATTiny.
-
You can find a lot of guides on the web about using the Arduino environment for the ATTiny series.
The TMRH2o nRF library is supposed to support ATTiny, but may not have been tested.
You already know that pins are going to be very tight, but if you have a one-pin sensor which doesn't need much code...
It might be possible to fit the sensor code (for some sensors) and the MySensors libraries, but if so it would be tight.
One tip: avoid any floating point code (some node sketches use it and some do not).
I'd actually love to see somebody make a MySensors node on an ATTiny.
I have looked into this too but decided against it.
Mainly for 2 reasons:- A board stacked onto your own pcb would make that you can keep the width and length of your pcb small. Imho adding your own microcontroller etc. to your own pcb would make it larger. Unless I am mistaken.
- When going that route why not use the ATmega328? Price can't be the reason not to use it or is it?
-
I found such board with ATtiny84 and NRF24L01.
http://nettigo.pl/products/bezprzewodowy-sensor-tinybrd
I am trying to find out from the producers if mysensors library will also work on it.
What do you think? Hardware site is already done. Will it be possible to run sketches with mysensors on it?
Regards -
I am still interested in the answer to the question 'why would you want to use an ATtiny?'....
-
I am still interested in the answer to the question 'why would you want to use an ATtiny?'....
-
I am still interested in the answer to the question 'why would you want to use an ATtiny?'....
@marceltrapman
Because in case of door/window sensor it is better looking, when you have sth small sticked to the frame :) -
Actually i tried to port the mysensors lib to the attiny, a few months ago..
https://github.com/Oitzu/Arduino
I had to remove much of the auto-id, repeater and gw stuff to fit it into the memory of the attiny.
But it the end it didn't run stable enough. This can maybe be fixed but i didn't investigated further. -
I am still interested in the answer to the question 'why would you want to use an ATtiny?'....
@marceltrapman said:
I am still interested in the answer to the question 'why would you want to use an ATtiny?'....
For example, an ATTiny85 is
- cheaper (just $1),
- it's smaller,
- it uses less power (about 1/4 as much),
- it's programmable using the arduino IDE,
- it also sports a differential ADC (for higher accuracy) that the atmeg328p simply doesn't have,
- doesn't require external support components
- wouldn't require a breakout board
For the last point, consider this type of possibility:

http://jeelabs.org/book/1501a/Is that enough of an answer? If necessary software can be crammed in there, it's a clear win.
Some of the attiny's support SPI natively. For those that don't (such as the ATTiny85), I've read there's a softSPI library for it
-
@marceltrapman said:
I am still interested in the answer to the question 'why would you want to use an ATtiny?'....
For example, an ATTiny85 is
- cheaper (just $1),
- it's smaller,
- it uses less power (about 1/4 as much),
- it's programmable using the arduino IDE,
- it also sports a differential ADC (for higher accuracy) that the atmeg328p simply doesn't have,
- doesn't require external support components
- wouldn't require a breakout board
For the last point, consider this type of possibility:

http://jeelabs.org/book/1501a/Is that enough of an answer? If necessary software can be crammed in there, it's a clear win.
Some of the attiny's support SPI natively. For those that don't (such as the ATTiny85), I've read there's a softSPI library for it
@NeverDie I would like to add my support for your worthy quest. Some time ago I was looking for a way to make MySensors RFID like tags for presence detection but the result was just too big as well as too energy consuming.
-
@NeverDie @Moshe-Livne the underlying rf24 library supports the use of the attiny85.
As mentioned above, the modified (shrinked) mysensors library runs on the attiny85 but is a little bit unstable.
There could be multiple reasons for this... i stopped the development of the attiny85 port because of low interest and time for other projects.@Sweebee : Do you still have the sketches and layouts for the attiny85 mysensors node?
-
@NeverDie @Moshe-Livne the underlying rf24 library supports the use of the attiny85.
As mentioned above, the modified (shrinked) mysensors library runs on the attiny85 but is a little bit unstable.
There could be multiple reasons for this... i stopped the development of the attiny85 port because of low interest and time for other projects.@Sweebee : Do you still have the sketches and layouts for the attiny85 mysensors node?
@Oitzu said:
@NeverDie @Moshe-Livne the underlying rf24 library supports the use of the attiny85.
As mentioned above, the modified (shrinked) mysensors library runs on the attiny85 but is a little bit unstable.
There could be multiple reasons for this... i stopped the development of the attiny85 port because of low interest and time for other projects.Which fork or version of RF24 did you try? Perhaps we can pick up where you left off.. I've read that TMRh2O is both supported and has fixes to bugs in prior versions. Is there presently anything better? However, if it turns out that's unstable too, then maybe just poking registers on the NRF24L01+ is enough for something barebones but stable. Anybody know? A softSPI library would still be needed though. Any suggestions on which of those would be a good choice for the Attiny85?
I recently received a tiny AVR programmer:

http://sfe.io/p11801
purely for convenience, but I haven't tried it out yet. There's also a youtube video (https://www.youtube.com/watch?v=30rPt802n1k) which shows another way how to do it using a spare arduino as the programmer. -
@NeverDie @Moshe-Livne the underlying rf24 library supports the use of the attiny85.
As mentioned above, the modified (shrinked) mysensors library runs on the attiny85 but is a little bit unstable.
There could be multiple reasons for this... i stopped the development of the attiny85 port because of low interest and time for other projects.@Sweebee : Do you still have the sketches and layouts for the attiny85 mysensors node?
-
@Sweebee said:
@Oitzu https://github.com/sweebee/Arduino-home-automation/tree/master/2.4Ghz (MySensors)/Attiny/button-switch
I gave it a quick read, and noticed that it appears to be using maniacbug's RF24 library. Six months ago Maniacbug posted the following here:
My fork has been abandoned.TMRH20 now has the premier fork - by far. You'll find considerably improved reliability and performance over both my fork and the original code base. Plus he has made an effort to keep RF24Network working well. Don't walk, but run from the orginal code base and immediately starting using TMR's fork.
Unfortunately, he posted this seemingly vital news in a comment buried way down the page instead of at the top, which is where it belongs. I wouldn't be surprised if most people are unaware of it.
Would it be much effort to migrate to the new library? It sounds like that alone might solve the stability problem.
-
@NeverDie i used a spare arduino nano as programmer for the attiny85. This works great.
As you maybe have seen i'm using a fork of the mysensors library of the end of may 2015.
I don't really can identify, at this moment, with which version of rf24 the mysensors library comes by...
but because the last update of this lib seems to be 9 months ago i should give it a try to update it.My suggested way to go would be: To merge the changes in the mysensors library from may 2015 to now into the fork (to be up-to-date with mysensors again) and then try to replace the rf24 library with a newer version.
Did we have anyone here able to test the libs? At the moment i have no spare attiny & nrf laying arround, i'm waiting for a new delivery.
About SPI: The rf24 lib includes a softSPI lib for communication.The lib even supports different ways to connect the nrf24 with the attiny.
See: http://tmrh20.github.io/RF24/rf24ping85_8ino-example.htmlI never tried the 3 connect. I simply connected CE with VCC to get one pin for testing free.