NRF24L01 with UNO and ATMega1284P

I am using the following code on an arduino UNO and a Bobuino board. The ce pin on the arduino code is pin 8 and on bobuino is pin 29

/*
 Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the 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 which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];

// This is for git version tracking.  Safe to 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 for 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 
  //
  // Which node are we?
  this_node = nodeconfig_read();
      myGLCD.printNumI(this_node, 40, 100);

  //
  // Bring up the RF network
  //
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 92, /*node address*/ this_node);
}


void loop(void)
{
  // Pump the network regularly
  network.update();
  // Is there anything ready for us?
  while ( network.available() )
  {
    
    // If so, grab it and print it 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 for a new node address
//  nodeconfig_listen();
}
// vim:ai:cin:sts=2 sw=2 ft=cpp

While on UNO it works fine and receives all messages, on bobuino all i get is either no response (the program only prints the number i on screen) or i receive one message and then there is no "network available". I have been having thoughts as to if the UTFT library conflicts with the RF24Network library (because the rf modules work fine if i check them using the serial terminal on both boards) or if it has something to do with SPI.

You don't seem to be doing anything with SPI.
Do the librarys require you to call it out? Or do they set it up themselves?
UTFT does not seem to be using SPI, looks like it connects to a bunch of analog pins.

Is this before some of the other devices are connected? Like an SD card, which will also use SPI connections?

CrossRoads:
You don't seem to be doing anything with SPI.
Do the librarys require you to call it out? Or do they set it up themselves?
UTFT does not seem to be using SPI, looks like it connects to a bunch of analog pins.

Is this before some of the other devices are connected? Like an SD card, which will also use SPI connections?

UTFT uses SPI for the Touch screen.
I believe the problem has something to do with the SPI bus, because sometimes when i restart the sketch it prints out some messages from a previous run of the sketch. Something might have to do with the buffer. But only on Bobuino, on UNO everything works fine.

What pin does UTFT use for slave select? Is not obvious from the code.
Am not familiar with all the libraries called out, so the connections are not clear.

CrossRoads:
What pin does UTFT use for slave select? Is not obvious from the code.
Am not familiar with all the libraries called out, so the connections are not clear.

Pin 10 on Bobuino is SS for Touch
Pin 8 was SS for TF, i am not using it
Pin 29 is SS for NRF24L01. Tried with pin 8, same functioning, same problem

Might have to check the libraries, see if a specific port is being called out that is not being mapped or something like that.

From what i found today, i believe the problem stems from this.

I messed with the ports of the uC and now these are the different voltages i found out:
While on other boards or when i don't mess with the library MISO has a mean voltage of 3.2V, when i use the edited library, MISO pin drops to 0V. I believe this is the problem.

MISO is driven by the slave - why is the slave not outputting anything?

Sketch: calibration
BOBUINO | UNO

PIN PORT EDIT NOEDIT PORT Voltages

D0 PD0 0.05 0.05 PD0 0
D1 PD1 4.31 4.36 PD1 4.44

D2 PD2 0 0 PD2 0
D3 PD3 0 0 PD3 0
D4 PB0 0 0.06 PD4 0
D5 PB1 4.3 0.06 PD5 4.44
D6 PB2 0 0.06 PD6 0
D7 PB3 0 0.06 PD7 0

D8 PD5 0 4.39 PB0 0
D9 PD6 3.24 3.26 PB1 3.26
SS PB4 0 4.36 PB2 4.44 --
MO PB5 4.3 4.36 PB3 4.44
MI PB6 0 3.24 PB4 3.25 --
SCK PB7 0 0 PB5 0

A0 PA7 4.3 4.37 PC0 4.44
A1 PA6 0 0 PC1 0
A2 PA5 4.3 4.37 PC2 4.44
A3 PA4 4.3 4.37 PC3 4.44
A4 PA3 2.46 2.47 PC4 2.48
A5 PA2 - - PC5 -

On this "matrix" you see:
"EDIT" means edited HW_AVR so that i send all 8 digital outputs to D0-D7 according to the other problem i had
"NOEDIT" means using the UTFT library "as is"
and UNO voltages is the voltage output of all uno pins when using UTFT.

As you can see, when i edit the UTFT library, the problem seems to be at pins 10 (D10-SS) and 12 (D12-MISO).

Hello

I'm doing the same thing with an NRF24l01+ and an ATMEGA1284P. I'm using the RF24 library. It looks like my radio works, but I'm getting resets often, and I had it working on the same setup I had before with a pro mini. I'm not sure its the radio that's causing the resets, and I plan to do more troubleshooting tonight on it. When I get an idea of what's going on (and resets fixed or not), I'll reply here with some code.

One thing I've noticed is that a lot of things can cause SPI to go wrong. Make sure your connections are clean, and double check everything! I can't tell you how many times I've looked at my board and thought everything was hooked up right, but it wasn't (or I had a short somewhere between pins).

Sam