ATtiny84 can send but not receive using NRF2401

Hi,

iam not able to get this thing working. Iam able to use ATtiny84 as a sender using folowing code.

#include <Arduino.h>

#define PC_PIN 2

int buttonPressed = 0;

#define SPI_CE_PIN 8
#define SPI_CSN_PIN 7
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(SPI_CE_PIN, SPI_CSN_PIN);
const byte address[6] = "00002";

void setup()
{
  pinMode(PC_PIN, OUTPUT);
  if (radio.begin())
  {
    digitalWrite(PC_PIN, HIGH);
    delay(500);
    digitalWrite(PC_PIN, LOW);
  }
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MAX);
  radio.setDataRate(RF24_250KBPS);
  radio.stopListening();
}

void loop()
{
  radio.write(&buttonPressed, sizeof(buttonPressed));
  delay(1000);
}

But i have no idea why its not working as a receiver using this code

#include <Arduino.h>

#define PC_PIN 2
//#define POWER_SUPPLY_PIN 2

int buttonPressed = 0;

#define SPI_CE_PIN 8
#define SPI_CSN_PIN 7
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(SPI_CE_PIN, SPI_CSN_PIN);
const byte address[6] = "00002";

void setup()
{
  pinMode(PC_PIN, OUTPUT);
  while (!radio.begin())
  {
  }
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.setDataRate(RF24_250KBPS);
  radio.startListening();
}

void loop()
{
  if (radio.available())
  {
    digitalWrite(PC_PIN, HIGH);
  }
}

Iam using separate Uno as a receiver to confirm that iam sending and there is no problem. Why my nRF24L01 doesnt work as a receiver using attiny84?

Different SPI pins?

I was thinking about it but when its already working in transmitter mode?

Really?

You need a working receiver to know if the transmitter is working.

I have built total 3 devices Nano as a transmitter and Uno as a receiver to check if the signal is going from or to Attiny84. Only difference is that on the Attiny84 iam using LED to indicate if something happend instead of serial monitor. In this configuration iam able to send data to my Uno (running all the time receiver) but not able to receive data from my Nano even i know data is sent because its received by Uno.

which physical pin number is PC_PIN in your set up? In fact could you upload photo of it?

Actually i have built another one and it seems to be working in both modes. So in my project seems to be HW issue... Those NRF modules seems to be pretty unstable and stubborn to work with... Thanks anyway.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.