Help! wire.h not working for I2C master-slave M4 to Arduino Nano

Discussion in 'UDOO NEO' started by Misha, Mar 14, 2018.

  1. Misha

    Misha New Member

    Joined:
    Jan 10, 2017
    Messages:
    3
    Likes Received:
    0
    I got two Nanos working with these master/slave sketches. Bytes are flying between them via I2C. No such luck with the Udoo Neo Full M4 I'm trying to connect as master to a Arduino Nano slave via I2C. I think the SLC and SDA signals are generated properly by the M4 on the Wire.requestFrom command. 5 packages w/ addresses 2 through 6 are sent per the master sketch (Oscilloscope), but somehow no data packages are sent or received from the Arduino Nano slave. I got the bi-directional logic level shifter connected to 5V, and the waveforms are crisp. I even got the sketches running with the same hardware between a 3.3V Adafruit Feather master and a 5V Nano slave to exclude logic level / timing issues.

    I found this thread and I followed waltervl's advice, read the MQX RTOS Release Note paragraph 4.3, changed the user_config.h to set the #define BSPCFG_ENABLE_I2C2 and #define BSPCFG_ENABLE_II2C2 to "1" accordingly and re-booted the Neo. No success. What am I doing wrong? Is the I/O build generated during start-up from the user_config.h file or do I need to compile something?

    This is for my DIY solar thermal project. I'm tired of running to the basement to read the system status on the Arduino LCD. I want it on the internet! Pronto, please. :). I'll have multiple Arduinos to control my other stuff such as room thermostats, boiler, security system, so porting the Arduino sketch to the M4 is not an option as I do want the subsystems to be modular aside from running out of pins on the M4. I wanted the M4 to display the system info received from the Arduino nanos locally on LCDs and to sent them on via A9 and python. If this can't be done I'll be disappointed but - what are my best options? Can the Arduino Nanos be connected easily to the A9 I2C bus and the data then be sent back down to the M4 LCDs?
     
    Last edited: Mar 14, 2018
  2. Misha

    Misha New Member

    Joined:
    Jan 10, 2017
    Messages:
    3
    Likes Received:
    0
    I'm still stuck.

    [​IMG]

    [​IMG]

    Follow this Link for photos of how things should go (Adafruit Feather as Master) and the dud output of the Udoo Neo's M4 as Master. Both are running the same script.

    Anybody else run into problems with wire.h on M4 - please help.
     
  3. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  4. Misha

    Misha New Member

    Joined:
    Jan 10, 2017
    Messages:
    3
    Likes Received:
    0
    "waltervl: Did you switch off I2C-2 on the A9 side as instructed on this documentation page?"
    Yes, I did that at the beginning of my I2C journey. Any other ideas?
    Aside: I set all the I2C ports 1 through 4 to "1" in the RTOS user_config.h just in case - should I be setting them back to "0" the way I found them? I.e.variables #define BSPCFG_ENABLE_I2Cx and #define BSPCFG_ENABLE_II2Cx, x being 1, 3,4
     
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Sorry, I have no further clues.
     
  6. Gorgo

    Gorgo UDOOer

    Joined:
    Nov 9, 2016
    Messages:
    159
    Likes Received:
    17
    Did you try a simple I2C communication with a sensor first?
    I'm using I2C on M4 reading/setting time with a rtc DS3231 or reading air pressure with a BMP180 using Wire. I'm not sure it may be your same master/slave scenario though.
     

Share This Page