dmgsarac
Posts: 3
Joined: Thu Mar 10, 2016 10:18 pm
Contact: Website

I2C PIC + Pi problem

Fri Mar 11, 2016 8:40 pm

hi, sir...

we need your help for about I2C Pi to PIC...

Pi is master, PIC (18F67K22) slave...

we enter sudo i2cdetect -y 1 for see address inside our PIC

only 1 time seen then no any address Pi monitor :( we enter sudo i2cdetect -y 1 no any address... then we try and again no any address...

but we reset PIC after again only 1 time seen example pi monutor say us 30... ok no problem but then we enter sudo i2cdetect -y 1 after no read any address...

our PIC code very simple;

#include <18F67k22.h>

#use delay(clock=8000000)
//#use delay(CLOCK=48MHz,CRYSTAL=12MHz)


// #use i2c(slave, scl=pin_d6, sda=pin_d5,I2C2, FORCE_HW,address=8)

//#use I2C(slave, FAST, SCL=PIN_D6, SDA=PIN_D5, FORCE_HW,address=0x30)
#use i2c(Slave,slow,sda=PIN_D5,scl=PIN_D6,force_hw,address=0x30)

void main()
{
setup_psp(PSP_DISABLED); // PSP birimi devre dışı
//setup_spi(SPI_SS_DISABLED); // SPI birimi devre dışı

while(1)
{

}
}

I will wait your help...

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: I2C PIC + Pi problem

Sun Mar 13, 2016 3:33 am

Can you try using Google Translate? I'm having difficulty understanding your English...

If I understood you correctly:

- The Pi is the I2C master.
- You have the PIC attached to SDA, SCL, GND, and 3.3V (or a 5V converter board).
- You run i2cdetect, and the PIC shows up once.
- You run your program.
- After that, the PIC does not show in i2cdetect until the power is reset.

Is that correct?

Return to “C/C++”