Problem with communicating 2 PIC16F876 using I2C bus

Status
Not open for further replies.

Frank1313

Newbie level 2
Joined
Nov 18, 2003
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
22
I2CREAD HELP

I WRITE A PROGRAM TO DO A COMUNICATION ,USING I2C BUS AND 2 PIC16F876..
THE SLAVE USE ASSEMBLER,AND I THINK IS O.K.
THE MASTER USE PICBASICPRO,AND CAN'T RECEIVE THE DATA.
I USE THIS CONFIGURATION:

DEFINE HSER_BAUD 19200
DEFINE I2C_SLOW 1
DEFINE ONINT_USED 1 ' BOOTLOADER
SCL VAR PORTC.3 ' Clock pin
SDA VAR PORTC.4 ' Data pin
FromSlave VAR BYTE 'dati arrivati dallo Slave
Letture VAR BYTE ' Dati letti da ADC (funzione non implementata)
Test VAR PORTA.0
SSPCON= %00101000 ' Setta il dispositivo in Master Mode
SSPADD= %00001001 ' 100KHz con Fosc 4MHz
PORTA= 0
TRISA= %11111110
PORTB=0
TRISB=0
PORTC=0
TRISC=%10111111
FromSlave=0
CICLO:

I2CRead SDA,SCL,2,[FromSlave],ERRORE
GoTo CICLO

someone can tell how work I2CREAD??
THANKS
 

If something in C helps, look at:
**broken link removed**


HH
NeuralC
 

I dont know what code your basic compiler produces, but to read I2C, you send a start, then a write to the address, then a restart, and then a read.
 

Re: I2CREAD HELP

If you need to know how the I2C bus works here is a good document (the i2c standard):

**broken link removed**

best regards
 

Re: I2CREAD HELP


Frank I am planing to do similar but not have tried yet . I have seen melabs site and there are codes for doing this tak go run and find em there and do tellus if that worked ?


Ts
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…