attiny 85, any pointers?/

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.

If you wanna look at my programs, it may not be that well explained since it wasn't designd as an example, but maybe it'll help u figure it out
Ps. Not sure about the ds18b20 code, that was a work in progress
however the part in setup I know worked and I received it using an uno and the nrf24l01

That's fine if there isn't documentation, I'm sure I can decipher it. I'd just like to get an example working. Pin mappings might be nice too... I'm sure I've got everything wired correctly but you never know.

Srry I meant to post it last post, my phone doesn't seem to want to post it right now, ill tyr again tomorrow on an actual computer

Thanks, can't wait to get this working.

srry for the delay

ATTINY85MIRF.ino (1.7 KB)

No problem. Could I bother you for the receiver code as well?

heres some code that recieves a message and i think replies as ewell as readoff to an lcd, but it is for an uno and doesnt use the attiny85 spi

mirfreply.ino (2.12 KB)

I'm not quite sure what I'm not doing correctly. Hopefully you can help me out. My pin connections:

ATtiny84 -> Nrf24L01+
MISO (PA6) -> MISO
MOSI (PA5) -> MOSI
SCK (PA4) -> SCK
CSN (PA3) -> CSN
CE (PA2) -> CE

The code uploads to the ATtiny84 perfectly well, and seems to be working.

When I run the uno code you provided, though, it fails to detect any data. Here are the connections:

UNO -> Nrf24L01+
D9 -> CE
D10 -> CSN
D11 (MOSI) -> MOSI
D12 (MISO) -> MISO
D13 (SCK) -> SCK

And here is the stripped down code:

ATTinyMirf.ino

#include <avr/io.h>
#include <inttypes.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <SPI85.h>
#include <Mirf85.h>
#include <nRF24L0185.h>
#include <MirfHardwareSpiDriver85.h>
#include "SoftwareSerial.h"



byte data[32] = {
  'T','T','W','I','R','E','L','E','S','S','Q','Q','Q','Q','Q','Q',
  'Q','Q','R','J','F','E','D','O','R','Q','Q','Q','Q','Q','Q','Q'
}; 

SoftwareSerial mySerial(9,10);

void setup(){
  mySerial.begin(9600);
  mySerial.write("ATTINY - Setup\n");
  
  // pinMode(3,0);
  pinMode(0, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  // digitalWrite(3,1);
  delay(1000);
  
  Mirf.cePin = 2; //attiny
  Mirf.csnPin = 3; //attiny
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();

  Mirf.setRADDR((byte *)"sendr");
  Mirf.payload = 32;
  Mirf.channel = 8;
  Mirf.setTADDR((byte *)"reply");
  Mirf.send(data);
delay(3000);
mySerial.write("ATTINY - End Setup\n");

}

void loop(){

  delay(1000);
  digitalWrite(0, HIGH);
  mySerial.write("ATTINY - Sending... \n");

  Mirf.send(data);
  digitalWrite(0, LOW);
  delay(100);

  
}

and for the UNO:

UnoMIRF.ino

//mirf recieve and replay
/*
PIN ||arduino || mirf
 GND ||  GND   ||  1
 VCC ||  5V    ||  2
 CE  ||     9  ||  3
 CSN ||     10 ||  4
 SCK ||     13 ||  5
 MOSI||     11 ||  6
 MISO||     12 ||  7
 IRQ ||  NA    ||  8
 */
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
byte data[32]; //size of payload
void setup(){
  Serial.begin(9600);
  //begin nrf24ll01
  Mirf.cePin = 9; //uno
  Mirf.csnPin = 10; //uno
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();

  Mirf.setRADDR((byte *)"reply");
  Mirf.setTADDR((byte *)"sendr");
  Mirf.payload = 32;
  Mirf.channel = 8;
  Mirf.config();
  Serial.println("Setup finished");
}
void loop(){
  // Serial.print(".");

  if(Mirf.dataReady()){
    Mirf.getData(data);


    delay(50);
    for (int i = 0; i < 32; ++i)
    {
      Serial.print(data[i]);
      Serial.print(",");
    }
    Serial.println();
  }

}

I'm pretty sure the chips themselves work; the RF24 library was able to get the status register of the transceivers, so it must be a problem with the ATtiny and/or Uno code

Thank you again

I'm also having an issue getting this working on an ATtiny84. I've had success with the ATtiny85 however. Perhaps there's an error in the library?

Edit: Oh, and of course thanks winner10920 for your code.