pixidu
Posts: 2
Joined: Thu Nov 22, 2018 2:14 pm
Location: Brazil, Fortaleza

Re: Compute Module I2C not working (I2Cdetect)

Thu Nov 29, 2018 5:52 pm

jeba wrote: I was sure i was doing something wrong and i finally found it! I used level shifter but it was not soldered.. I hoped PCB will have contact with pins but looks like it hadn't. Now I've solderd it (first time, looks great for me :)) and I'm one step further :D

Code: Select all

pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~ $

Image


Hi all!


I'm trying to connect raspiberry pi 3 model B with Mega2560. I read a lot of forums and I made the settings of Jeba above. The configuration is all the same of Jeba and I didn't have any successful. I'm using this code below in Mega2560:


Code: Select all

// Wire Master Writer
// by Nicholas Zambetti <http://www.zambetti.com>

// Demonstrates use of the Wire library
// Writes data to an I2C/TWI slave device
// Refer to the "Wire Slave Receiver" example for use with this

// Created 29 March 2006

// This example code is in the public domain.


#include <Wire.h>

void setup() {
  Wire.begin(6); // join i2c bus (address optional for master)
}

byte x = 0;

void loop() {
  Wire.beginTransmission(8); // transmit to device #8
  Wire.write("x is ");        // sends five bytes
  Wire.write(x);              // sends one byte
  Wire.endTransmission();    // stop transmitting

  x++;
  delay(500);
}

A electrical circuit below:

Raspi3B_Mega2560_bb.png
Raspi3B_Mega2560_bb.png (215.24 KiB) Viewed 1542 times
Note: I'm using 12V power supply to power the arduino.


A figure below show the SCL in side of LV:
Rpi_SCL_1.JPG
Rpi_SCL_1.JPG (198.66 KiB) Viewed 1521 times

A figure below show the SDA in side of LV:
Rpi_SDA_1.JPG
Rpi_SDA_1.JPG (197.66 KiB) Viewed 1521 times

Below is VCLOG.txt:

Code: Select all

001377.849: brfs: File read: /mfs/sd/config.txt
001378.981: brfs: File read: 1833 bytes
001415.737: brfs: File read: /mfs/sd/config.txt
001417.102: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001611.875: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
001613.166: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001661.859: *** Restart logging
001661.924: brfs: File read: 1833 bytes
001663.338: brfs: File read: /mfs/sd/cmdline.txt
001663.444: Read command line from file 'cmdline.txt':
001663.510: 'dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait splash plymouth.ignore-serial-consoles quiet'
001663.844: brfs: File read: 181 bytes
002035.651: brfs: File read: /mfs/sd/kernel7.img
002035.717: Loading 'kernel7.img' to 0x8000 size 0x4b4d00
002225.154: No kernel trailer - assuming DT-capable
002225.236: brfs: File read: 4934912 bytes
002229.703: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
002229.770: Loading 'bcm2710-rpi-3-b.dtb' to 0x4bcd00 size 0x62df
002369.354: brfs: File read: 25311 bytes
002372.167: brfs: File read: /mfs/sd/config.txt
002372.778: dtparam: i2c_arm=on
002389.549: dtparam: spi=on
002404.158: brfs: File read: 1833 bytes
002409.420: brfs: File read: /mfs/sd/overlays/ads7846.dtbo
002432.293: Loaded overlay 'ads7846'
002432.345: dtparam: penirq=25
002434.593: dtparam: speed=10000
002435.641: dtparam: penirq_pull=2
002436.437: dtparam: xohms=150
002437.629: dtparam: audio=on
002560.772: brfs: File read: 2426 bytes
002566.768: brfs: File read: /mfs/sd/overlays/pi3-disable-bt.dtbo
002588.560: Loaded overlay 'pi3-disable-bt'
002645.560: brfs: File read: 954 bytes
002656.310: brfs: File read: /mfs/sd/overlays/w1-gpio.dtbo
002665.160: Loaded overlay 'w1-gpio'
003820.746: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
003938.108: Device tree loaded to 0x2eff9500 (size 0x6a0b)
003940.184: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
005063.933: vchiq_core: vchiq_init_state: slot_zero = 0xfad80000, is_master = 1
005073.442: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000057

Thanks for any help!!

pixidu
Posts: 2
Joined: Thu Nov 22, 2018 2:14 pm
Location: Brazil, Fortaleza

Re: Compute Module I2C not working (I2Cdetect)

Wed Dec 05, 2018 1:18 pm

All Working!!
test_arduino.PNG
test_arduino.PNG (57.86 KiB) Viewed 1506 times
I changed the board Raspi 3 B for other equal and All it's working now. I suppose that have problem in GPIO pins i2c.
The tutorial that I follow is HERE !

Regards.

khalass
Posts: 7
Joined: Tue Dec 18, 2012 3:22 am

Re: Compute Module I2C not working (I2Cdetect)

Mon Jan 21, 2019 7:30 am

Hi,
I have similar issue with the i2c not working. I have been following the Adafruit tutorial on PCA9685 for the Raspberry Pi.
https://learn.adafruit.com/adafruit-16- ... pi-for-i2c

when I enter the command " i2cdetect -y 1"
I get exactly the same output as above, no readings in any rows.

I want to try the overlay. What do I need to modify in the config.txt file?

Return to “Compute Module”