From 5f8e1845c794a9f37ee4f8111fbaf30980ec435d Mon Sep 17 00:00:00 2001 From: ortegafernando Date: Sun, 12 Nov 2017 17:47:45 +0100 Subject: [PATCH 1/3] Update RF24.cpp Add option to ATTINY85 4 pins mode --- RF24.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RF24.cpp b/RF24.cpp index 44a4ed3d1..c31129cce 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -16,7 +16,7 @@ void RF24::csn(bool mode) { #if defined (RF24_TINY) - if (ce_pin != csn_pin) { + if ((ce_pin != csn_pin) && (csn_pin != 0)) { digitalWrite(csn_pin,mode); } else { From 4c59df0b27103e2b19ee50023b3773eafb66c7c5 Mon Sep 17 00:00:00 2001 From: ortegafernando Date: Sun, 12 Nov 2017 17:49:35 +0100 Subject: [PATCH 2/3] Update rf24ping85.ino Add option for ATTINY85 4 pins mode --- examples/rf24_ATTiny/rf24ping85/rf24ping85.ino | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/rf24_ATTiny/rf24ping85/rf24ping85.ino b/examples/rf24_ATTiny/rf24ping85/rf24ping85.ino index b5fc94ec0..3c2b0ace6 100644 --- a/examples/rf24_ATTiny/rf24ping85/rf24ping85.ino +++ b/examples/rf24_ATTiny/rf24ping85/rf24ping85.ino @@ -36,6 +36,18 @@ version 2 as published by the Free Software Foundation. | +----+ | |-----------------------------------------------||----x-- nRF24L01 CSN, pin4 10nF + ATtiny25/45/85 Pin map with CE_PIN 3 and CSN_PIN 0 => PB4 is free to use for application and you can use ackPayload funtionallity + and you will save power as RF24 could get into sleep between writings as we control CE_PIN + + ^^ + +-\/-+ // + PB5 1|o |8 Vcc --- nRF24L01 VCC, pin2 -----------------x--|<|-- 5V + nRF24L01 CE, pin3 --- PB3 2| |7 PB2 --- nRF24L01 SCK, pin5 --|<|---x-[22k]--| LED + NC PB4 3| |6 PB1 --- nRF24L01 MOSI, pin7 1n4148 | + nRF24L01 GND, pin1 -x- GND 4| |5 PB0 --- nRF24L01 MISO, pin6 | + | +----+ | + |-----------------------------------------------||----x-- nRF24L01 CSN, pin4 + 10nF ATtiny24/44/84 Pin map with CE_PIN 8 and CSN_PIN 7 Schematic provided and successfully tested by Carmine Pastore (https://github.com/Carminepz) @@ -54,6 +66,7 @@ version 2 as published by the Free Software Foundation. #define CE_PIN 3 #define CSN_PIN 4 //#define CSN_PIN 3 // uncomment for ATtiny85 3 pins solution +//#define CSN_PIN 0 // uncomment for ATtiny85 4 pins solution #include "RF24.h" @@ -98,4 +111,4 @@ void loop(void){ // Try again 1s later delay(1000); -} \ No newline at end of file +} From 804b1ebc9dfaaf397bfd342abfc658eaa2912ca5 Mon Sep 17 00:00:00 2001 From: ortegafernando Date: Sun, 12 Nov 2017 20:23:17 +0100 Subject: [PATCH 3/3] Update RF24.cpp --- RF24.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RF24.cpp b/RF24.cpp index c31129cce..31150ba8a 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -614,7 +614,7 @@ bool RF24::begin(void) if (ce_pin != csn_pin) pinMode(ce_pin,OUTPUT); #if ! defined(LITTLEWIRE) - if (ce_pin != csn_pin) + if ((ce_pin != csn_pin) && (csn_pin != 0)) #endif pinMode(csn_pin,OUTPUT);