Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2CREAD-HELP!!!!!!!!!!!

Status
Not open for further replies.

Frank1313

New Member
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

some opinion??
thaks to all
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top