Skip to content

FroggyCorp/MySensors-Attiny

Repository files navigation

MySensors with Attiny support (v0.2). "Fork" from MySensors Library v2.4.0-alpha.

What works :

  • Attiny85
  • Micronucleus or no bootloader
  • Direct reading RFM69 register than using int for ACK

What should work :

  • Any Attiny
  • Optiboot (save 1.5KB than micronucleus)

What is not working :

  • Interrupt : int0 is on the same pin as SCK. DIO stay high all the time, so can't use PCINT

How to make it work :

  1. Take an arduino (UNO/Nano/...), put the sketch Examples/arduinoISP/arduinoISP

  2. Connect the arduino to the Attiny85 : (https://www.instructables.com/How-to-Program-an-Attiny85-From-an-Arduino-Uno/)

Attiny Attiny (Pin number) (Pin number) Arduino
Reset/PB5 (1) (10)
PB3 (2) -
PB4 (3) -
GND (4) GND
MOSI/PB0 (5) (11)
MISO/PB1 (6) (12)
SCK/PB2 (7) (13)
VCC (8) 5V

Add a Capacitor (10uF) on arduino beetween ground & reset.

  1. Add Attiny85 board on Arduino IDE

  2. (Optional) Try it with blink test & adding a LED

  3. Download AVRDUDESS (https://github.com/ZakKemble/AVRDUDESS)

  1. Launch AVRDUDESS and put the bootloader, change fuse if needed.

  2. Connect HW-260 card or same, put Attiny85, install the drivers (W10) with zadig from micronucleus directory

/!\ The Attiny85 need to be at least at 8Mhz /!
/!\ Don't remove writing capacity /!
/!\ Don't put external clock /!\

  1. Connect RFM69 to Attiny85 :

RFM69 don't support 5V, use convertor

Attiny Attiny (Pin number) RFM69
SS/PB3 (2) SCK
MOSI/PB1 (6) MOSI
MISO/PB0 (5) MISO
SCK/PB2 (7) SCK

/!\ In documentation, PB1 = MISO & PB0 = MOSI, Spence Konde explain it here : (ATTinyCore/hardware/avr/1.5.2/variants/tinyX5pins_arduino.h)

"This part has a USI, not an SPI module. Accordingly, there is no MISO/MOSI in hardware. There's a DI and a DO. When the chip is used as master, DI is used as MISO, DO is MOSI; the defines here specify the pins for master mode, as SPI master is much more commonly used in Arduino-land than SPI slave, and these defines are required for compatibility. Be aware of this when using the USI SPI fucntionality (and also, be aware that the MISO and MOSI markings on the pinout diagram in the datasheet are for ISP programming, where the chip is a slave. The pinout diagram included with this core attempts to clarify this)"

  1. Use Arduino IDE to send sketch, select Attiny85 (Micronucleus) board & Micronucleus as programmer /!\ Actually (27/03/2023), Arduino IDE 2.0.4 don't work, looks like it need some update from Attinycore (1.5.2), use the 1.8.x version Enjoy

In case of, to burn the fuse :

https://www.best-microcontroller-projects.com/unbrick-attiny.html

Pseudo Versionning :

v0.2 :

  • Add MY_RFM69_NO_IRQ option, set it to remove the IRQ. It reads registers on part of RFM69 drivers where it needs to get interrupt information. Save 1 I/O of Attiny85
  • Add pseudo hwCPUFrequency() by reading fuse

v0.1 :

I don't know what i'm doing

About

MySensors for Attiny85 RFM69 and others

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published