NRF24L01 with UNO and ATMega1284P


i using following code on arduino uno , bobuino board. ce pin on arduino code pin 8 , on bobuino pin 29

code: [select]
/*
copyright (c) 2011 james coliz, jr. <maniacbug@ymail.com>

program free software; can redistribute and/or
modify under terms of gnu general public license
version 2 published free software foundation.
*/


#include <avr/pgmspace.h>
#include <rf24network.h>
#include <rf24.h>
#include <spi.h>
#include <onewire.h>
#include <tictocs.h>
#include <tictoctimer.h>
#include "nodeconfig.h"
#include "printf.h"
#include "ftoa.h"

#include <sd.h>
#include <utft.h>
utft        myglcd(itdb32s,a1,a2,a0,a3);

// declare fonts using
extern uint8_t smallfont[];
extern uint8_t bigfont[];

// git version tracking.  safe ignore
#ifdef version_h
#include "version.h"
#else
const char program_version[] = "unknown";
#endif

// pin definitions
#ifndef pins_defined
#define __platform__ "getting started board"

// pins radio
const int rf_ce = 29;
const int rf_csn = a5;
  int i=0;
  int j=0;
  int k=0;
  int l=0;


#endif

rf24 radio(rf_ce,rf_csn);
rf24network network(radio);

// our node address
uint16_t this_node;




void setup(void)
{
  //
  // print preamble
  // 
    myglcd.initlcd(portrait);
  myglcd.clrscr();
 
  myglcd.setcolor(255, 255, 255);
  myglcd.setbackcolor(0, 0, 0);
  myglcd.setfont(bigfont);
  //
  // pull node address out of eeprom
  //
  // node we?
  this_node = nodeconfig_read();
      myglcd.printnumi(this_node, 40, 100);

  //
  // bring rf network
  //
  spi.begin();
  radio.begin();
  network.begin(/*channel*/ 92, /*node address*/ this_node);
}


void loop(void)
{
  // pump network regularly
  network.update();
  // there ready us?
  while ( network.available() )
  {
   
    // if so, grab , print out
    rf24networkheader header;
    char message[24];
    network.read(header,&message,sizeof(message));
    if(header.from_node == 012)
    {
      myglcd.print(message, 20, 110);
      myglcd.printnumi(k, 20, 160);
      k++;
    }
    else if (header.from_node == 022)
    {
      myglcd.print(message, 140, 110);
      myglcd.printnumi(l, 140, 160);
    l++;
    }
      myglcd.printnumi(j, 120, 190);
    j++;
  }
      myglcd.printnumi(i, 120, 210);
      i++;
  // stop listening
 
 
 
 
 
  // listen new node address
//  nodeconfig_listen();
}
// vim:ai:cin:sts=2 sw=2 ft=cpp



while on uno works fine , receives messages, on bobuino either no response (the program prints number on screen) or receive 1 message , there no "network available". have been having thoughts if utft library conflicts rf24network library (because rf modules work fine if check them using serial terminal on both boards) or if has spi.

you don't seem doing spi.
do the  librarys require call out? or set themselves?
utft not seem using spi, looks connects bunch of analog pins.

is before of other devices connected? sd card, use spi connections?


Arduino Forum > Using Arduino > Project Guidance > NRF24L01 with UNO and ATMega1284P


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62