Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with communicating 2 PIC16F876 using I2C bus

Status
Not open for further replies.

Frank1313

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

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top