RFM69HW connection to 2560 Mega Pro board



  • Hi,

    I'm building a sensor using a Robotdyn Mega Pro board.

    [https://robotdyn.com/mega-2560-pro-mini-atmega2560-16au.html](link url)

    The pinout of this board is here:

    [https://robotdyn.com/pub/media/0G-00005642==MEGA-PROMINI-ATmega2560/DOCS/PINOUT==0G-00005642==MEGA-PROMINI-ATmega2560.jpg](link url)

    My network uses RFM69 antennas.

    My connections are:

    MISO 50
    MOSI 51
    SCK 52
    SS 53
    DIO00 2

    Power is connected to 3.3v line. I know that Mega pins are 5v and in theory RFM69 are 3.3v, but I have more sensors installed in a similar setup with mini Pro 5v and Nano boards that work perfectly.

    I have also tried two different radios to discard hardware issues.

    On start my sketch shows:

    3 TSM:INIT
    4 TSF:WUR:MS=3000
    106 !TSM:INIT:TSP FAIL
    108 TSM:FAIL:CNT=1
    109 TSM:FAIL:DIS
    

    My concern is that pinout diagrams for "normal" Mega boards show that pin D2 is assigned to INT0, while the pinout for this board linked above indicates that pin D2 is assigned to INT4.

    In view of this, I have tried adding the following defines with no success:

    #define MY_RFM69_IRQ_PIN 2
    #define MY_RFM69_IRQ_NUM 0
    

    I have tried all numbers from 0 to 5 for MY_RFM69_IRQ_NUM.

    I also tried pins 18 and 19. I can't use 20 and 21 since I'm using I2C comms.

    No matter what I try, I'm still getting the same error.

    I searched through the forum and on the inet with no success.

    I'd really appreciate if someone could point me in the right direction... thanks!



  • Answering to myself... after many tests I decided to start to start working backwards and started to discard assumptions... finally I discarded :

    I know that Mega pins are 5v and in theory RFM69 are 3.3v, but I have more sensors installed in a similar setup with mini Pro 5v and Nano boards that work perfectly.

    So I fit a ttl levels shifter between the Mega Pro and the RFM69 and it started to work right away.

    It looks like AT328 and AT2560 have different levels of sensitivity as of being able to interpret 3.3v correctly as a "1". Interestingly, I checked the datasheets for both chips and the specification is the same, min 0.6Vcc volts, so anything over 3v should be interpreted as a "1"... go see...

    As a final detail, I was able to use a 4way ttl shifter since the MISO line doesn't need to be shifted, which left me with MOSI, SCK, SS and INT. Credit to this forum page for this:

    I can also confirm that pin D2 on these boards is connected to INT0 as standard... I don't know why the pinout diagram indicates something different.

    I hope this helps others.


 

197
Online

8.6k
Users

9.4k
Topics

99.0k
Posts