NRF24L01 with Arduino Pro Mini at 1Mhz



  • Hello,

    When i use my arduino pro mini 3.3V at 8Mhz everything works fine.
    But after changing the fuses of my arduino to 1Mhz, the communication between the arduino and the gateway is note working:

    196 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
    311 TSM:INIT
    327 TSF:WUR:MS=0
    360 TSM:INIT:TSP OK
    376 TSM:FPAR
    4292 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6389 !TSM:FPAR:NO REPLY
    6406 TSM:FPAR
    10321 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    12419 !TSM:FPAR:NO REPLY
    12435 TSM:FPAR
    16351 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    18448 !TSM:FPAR:NO REPLY
    18464 TSM:FPAR
    22380 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    24477 !TSM:FPAR:FAIL
    

    My code:

    #define MY_DEBUG
    #define MY_BAUD_RATE (9600ul)
    #define MY_RF24_SPI_SPEED (1000000ul)
    #define MY_RADIO_RF24
    
    #include <MySensors.h>
    
    #define DOOR_ID 0
    #define DOOR_PIN 2
    
    MyMessage msg(DOOR_ID, V_TRIPPED);
    
    void setup()
    {
      pinMode(DOOR_PIN, INPUT);
    }
    
    void presentation()
    {
      sendSketchInfo("Door 2", "1.4");
      present(DOOR_ID, S_DOOR);
    }
    
    void loop()
    {
      uint8_t value;
      static uint8_t sentValue = 2;
      
      delay(50);
      value = digitalRead(DOOR_PIN);
    
      if (value != sentValue) {
        send(msg.set(value == HIGH));
        sentValue = value;
      }
    
      sleep(DOOR_PIN - 2, CHANGE, 0);
    }
    

    My fuses settings:

    ## Arduino Pro or Pro Mini (1.8V, 1 MHz) w/ ATmega328
    ## --------------------------------------------------
    pro.menu.cpu.1MHzatmega328=ATmega328 (1.8V, 1 MHz)
    
    pro.menu.cpu.1MHzatmega328.upload.maximum_size=30720
    pro.menu.cpu.1MHzatmega328.upload.maximum_data_size=2048
    pro.menu.cpu.1MHzatmega328.upload.speed=9600
    
    pro.menu.cpu.1MHzatmega328.bootloader.low_fuses=0x62
    pro.menu.cpu.1MHzatmega328.bootloader.high_fuses=0xD4
    pro.menu.cpu.1MHzatmega328.bootloader.extended_fuses=0xFE
    pro.menu.cpu.1MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_1MHz.hex
    
    pro.menu.cpu.1MHzatmega328.build.mcu=atmega328p
    pro.menu.cpu.1MHzatmega328.build.f_cpu=1000000L
    

    I don't know why when my arduino is at 1Mhz the nrf24l01 is not working. When i put back my arduino to 8Mhz every thing works fine.

    Do you have any idea ?

    Thank you for your help


  • Mod

    @snyfir are you using the same power supply and capacitors in both cases?
    What does the gateway log say?



  • Yes i use the same board. My gateway log (in debug) say that i received nothing.


  • Mod

    @snyfir could you see if defining MY_DEBUG_VERBOSE_RF24 before including MySensors.h can give a clue to what's going wrong? Comparing the output for 8mhz and 1mhz might show a difference.



  • With 1Mhz (not working):

    196 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
    311 TSM:INIT
    327 TSF:WUR:MS=0
    344 RF24:INIT
    360 RF24:INIT:PIN,CE=9,CS=10
    393 RF24:WBR:REG=0,VAL=14
    442 RF24:WBR:REG=3,VAL=3
    458 RF24:WBR:REG=4,VAL=95
    491 RF24:WBR:REG=5,VAL=76
    524 RF24:WBR:REG=6,VAL=39
    557 RF24:WBR:REG=16,VAL=115
    589 RF24:WBR:REG=29,VAL=4
    606 RF24:RBR:REG=6,VAL=39
    638 RF24:RBR:REG=5,VAL=76
    671 RF24:WBR:REG=2,VAL=2
    704 RF24:WBR:REG=1,VAL=0
    720 RF24:WBR:REG=28,VAL=3
    753 RF24:FRX
    770 RF24:FTX
    786 RF24:WBR:REG=7,VAL=112
    819 TSM:INIT:TSP OK
    835 TSM:FPAR
    851 RF24:SPL
    868 RF24:WBR:REG=0,VAL=14
    901 RF24:OWP:RCPT=255
    933 RF24:WBR:REG=10,VAL=255
    950 RF24:WBR:REG=16,VAL=255
    983 RF24:TXM:TO=255,LEN=7
    1015 RF24:FTX
    4931 RF24:WBR:REG=7,VAL=48
    4964 RF24:STL
    4980 RF24:WBR:REG=0,VAL=15
    5013 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    5095 RF24:RBR:REG=23,VAL=1
    5128 RF24:RBR:REG=23,VAL=1
    5160 RF24:RBR:REG=23,VAL=1
    5193 RF24:RBR:REG=23,VAL=1
    5210 RF24:RBR:REG=23,VAL=1
    5242 RF24:RBR:REG=23,VAL=1
    5275 RF24:RBR:REG=23,VAL=1
    5308 RF24:RBR:REG=23,VAL=1
    5341 RF24:RBR:REG=23,VAL=1
    5373 RF24:RBR:REG=23,VAL=1
    5406 RF24:RBR:REG=23,VAL=1
    5439 RF24:RBR:REG=23,VAL=1
    5472 RF24:RBR:REG=23,VAL=1
    5505 RF24:RBR:REG=23,VAL=1
    5521 RF24:RBR:REG=23,VAL=1
    5554 RF24:RBR:REG=23,VAL=1
    5586 RF24:RBR:REG=23,VAL=1
    5619 RF24:RBR:REG=23,VAL=1
    5652 RF24:RBR:REG=23,VAL=1
    5685 RF24:RBR:REG=23,VAL=1
    5718 RF24:RBR:REG=23,VAL=1
    5750 RF24:RBR:REG=23,VAL=1
    5783 RF24:RBR:REG=23,VAL=1
    5816 RF24:RBR:REG=23,VAL=1
    5832 RF24:RBR:REG=23,VAL=1
    5865 RF24:RBR:REG=23,VAL=1
    5898 RF24:RBR:REG=23,VAL=1
    5931 RF24:RBR:REG=23,VAL=1
    5963 RF24:RBR:REG=23,VAL=1
    5996 RF24:RBR:REG=23,VAL=1
    6029 RF24:RBR:REG=23,VAL=1
    6062 RF24:RBR:REG=23,VAL=1
    6094 RF24:RBR:REG=23,VAL=1
    6127 RF24:RBR:REG=23,VAL=1
    6144 RF24:RBR:REG=23,VAL=1
    6176 RF24:RBR:REG=23,VAL=1
    6209 RF24:RBR:REG=23,VAL=1
    6242 RF24:RBR:REG=23,VAL=1
    6275 RF24:RBR:REG=23,VAL=1
    6307 RF24:RBR:REG=23,VAL=1
    6340 RF24:RBR:REG=23,VAL=1
    6373 RF24:RBR:REG=23,VAL=1
    6406 RF24:RBR:REG=23,VAL=1
    6422 RF24:RBR:REG=23,VAL=1
    6455 RF24:RBR:REG=23,VAL=1
    6488 RF24:RBR:REG=23,VAL=1
    6520 RF24:RBR:REG=23,VAL=1
    6553 RF24:RBR:REG=23,VAL=1
    6586 RF24:RBR:REG=23,VAL=1
    6619 RF24:RBR:REG=23,VAL=1
    6651 RF24:RBR:REG=23,VAL=1
    6684 RF24:RBR:REG=23,VAL=1
    6717 RF24:RBR:REG=23,VAL=1
    6733 RF24:RBR:REG=23,VAL=1
    6766 RF24:RBR:REG=23,VAL=1
    6799 RF24:RBR:REG=23,VAL=1
    6832 RF24:RBR:REG=23,VAL=1
    6864 RF24:RBR:REG=23,VAL=1
    6897 RF24:RBR:REG=23,VAL=1
    6930 RF24:RBR:REG=23,VAL=1
    6963 RF24:RBR:REG=23,VAL=1
    6995 RF24:RBR:REG=23,VAL=1
    7028 RF24:RBR:REG=23,VAL=1
    7045 RF24:RBR:REG=23,VAL=1
    7077 RF24:RBR:REG=23,VAL=1
    7110 !TSM:FPAR:NO REPLY
    

    with 8mhz (working):

    208 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
    321 TSM:INIT
    335 TSF:WUR:MS=0
    354 RF24:INIT
    368 RF24:INIT:PIN,CE=9,CS=10
    399 RF24:WBR:REG=0,VAL=14
    432 RF24:WBR:REG=3,VAL=3
    458 RF24:WBR:REG=4,VAL=95
    485 RF24:WBR:REG=5,VAL=76
    512 RF24:WBR:REG=6,VAL=39
    540 RF24:WBR:REG=16,VAL=115
    569 RF24:WBR:REG=29,VAL=4
    598 RF24:RBR:REG=6,VAL=39
    624 RF24:RBR:REG=5,VAL=76
    651 RF24:WBR:REG=2,VAL=2
    677 RF24:WBR:REG=1,VAL=0
    704 RF24:WBR:REG=28,VAL=3
    731 RF24:FRX
    745 RF24:FTX
    759 RF24:WBR:REG=7,VAL=112
    788 TSM:INIT:TSP OK
    808 TSM:FPAR
    823 RF24:SPL
    837 RF24:WBR:REG=0,VAL=14
    864 RF24:OWP:RCPT=255
    886 RF24:WBR:REG=10,VAL=255
    917 RF24:WBR:REG=16,VAL=255
    946 RF24:TXM:TO=255,LEN=7
    972 RF24:FTX
    989 RF24:WBR:REG=7,VAL=48
    1015 RF24:STL
    1030 RF24:WBR:REG=0,VAL=15
    1058 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    1136 RF24:RBR:REG=23,VAL=17
    1165 RF24:RBR:REG=23,VAL=17
    1196 RF24:RBR:REG=23,VAL=17
    1224 RF24:RBR:REG=23,VAL=17
    1253 RF24:RBR:REG=23,VAL=17
    1284 RF24:RBR:REG=23,VAL=17
    1312 RF24:RBR:REG=23,VAL=17
    1343 RF24:RBR:REG=23,VAL=17
    1372 RF24:RBR:REG=23,VAL=17
    1402 RF24:RBR:REG=23,VAL=17
    1431 RF24:RBR:REG=23,VAL=17
    1460 RF24:RBR:REG=23,VAL=17
    1490 RF24:RBR:REG=23,VAL=17
    1519 RF24:RBR:REG=23,VAL=17
    1550 RF24:RBR:REG=23,VAL=17
    1579 RF24:RBR:REG=23,VAL=17
    1607 RF24:RBR:REG=23,VAL=17
    1638 RF24:RBR:REG=23,VAL=17
    1667 RF24:RBR:REG=23,VAL=17
    1697 RF24:RBR:REG=23,VAL=17
    1726 RF24:RBR:REG=23,VAL=16
    1757 RF24:RXM:LEN=8
    1777 RF24:WBR:REG=7,VAL=64
    1806 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    1863 TSF:MSG:FPAR OK,ID=0,D=1
    1896 RF24:RBR:REG=23,VAL=17
    1925 RF24:RBR:REG=23,VAL=17
    1955 RF24:RBR:REG=23,VAL=17
    1984 RF24:RBR:REG=23,VAL=17
    2015 RF24:RBR:REG=23,VAL=17
    2043 RF24:RBR:REG=23,VAL=17
    2072 RF24:RBR:REG=23,VAL=17
    2103 RF24:RBR:REG=23,VAL=17
    2131 RF24:RBR:REG=23,VAL=17
    2162 RF24:RBR:REG=23,VAL=17
    2191 RF24:RBR:REG=23,VAL=17
    2220 RF24:RBR:REG=23,VAL=17
    2250 RF24:RBR:REG=23,VAL=17
    2279 RF24:RBR:REG=23,VAL=17
    2310 RF24:RBR:REG=23,VAL=17
    2338 RF24:RBR:REG=23,VAL=17
    2369 RF24:RBR:REG=23,VAL=17
    2398 RF24:RBR:REG=23,VAL=17
    2426 RF24:RBR:REG=23,VAL=17
    2457 RF24:RBR:REG=23,VAL=16
    2486 RF24:RXM:LEN=8
    2508 RF24:WBR:REG=7,VAL=64
    2537 TSF:MSG:READ,6-6-255,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    2594 RF24:RBR:REG=23,VAL=17
    2625 RF24:RBR:REG=23,VAL=16
    2654 RF24:RXM:LEN=8
    2674 RF24:WBR:REG=7,VAL=64
    2703 TSF:MSG:READ,4-4-255,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    2762 RF24:RBR:REG=23,VAL=17
    2791 RF24:RBR:REG=23,VAL=17
    2822 RF24:RBR:REG=23,VAL=17
    2850 RF24:RBR:REG=23,VAL=17
    2881 RF24:RBR:REG=23,VAL=17
    2910 RF24:RBR:REG=23,VAL=17
    2938 RF24:RBR:REG=23,VAL=17
    2969 RF24:RBR:REG=23,VAL=17
    2998 RF24:RBR:REG=23,VAL=17
    3028 RF24:RBR:REG=23,VAL=17
    3057 RF24:RBR:REG=23,VAL=17
    3086 RF24:RBR:REG=23,VAL=17
    3117 RF24:RBR:REG=23,VAL=17
    3145 TSM:FPAR:OK
    

    I see that the begining is the same. But after

    TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    

    we have for the 1Mhz:

    RF24:RBR:REG=23,VAL=1
    

    and for the 8Mhz:

    1136 RF24:RBR:REG=23,VAL=17
    

  • Mod

    @snyfir nice work.

    I think REG=23 is in decimal, which means register 0x17 which is RF24_REG_FIFO_STATUS.

    I checked the datasheet and it seems like value 1 means that the RX buffer is empty. Value 17 means TX buffer is empty and RX buffer is empty. That doesn't say me much though.

    Maybe @tekka can confirm if the debug output registers are in decimal, and chip in what could be causing the problem?



  • The data is not send because VAL=1 means TX_FIFO not empty.
    Maybe the flag to trigger the send data is not emit in the right time ?


  • Admin

    @snyfir Can you run the same tests using the latest release, i.e. 2.3.1?



  • @tekka said in NRF24L01 with Arduino Pro Mini at 1Mhz:

    @snyfir Can you run the same tests using the latest release, i.e. 2.3.1?

    It's working ! 🕺 😃
    Thanks you very much @tekka and @mfalkvidd 👍


Log in to reply
 

Suggested Topics

  • 3
  • 5
  • 6
  • 2
  • 1

58
Online

11.4k
Users

11.1k
Topics

112.7k
Posts