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.

Connecting 2 PIC16F876A via I2C, and testing in MPLAB?

Status
Not open for further replies.

JulioSilva

Junior Member level 2
Joined
Mar 21, 2005
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,466
mplab i2c

Hello!

I want to connect 2 PIC16F876A via I2C.
Is there any "sample" source code in ASM for doing that? Since I'm kinda lost in DataSheet...

What BRG in SSPADD should I use for the maximum speed (with 20MHz XTal)?

Thanks in advance,

jS
 

16f876a master 16f876a slave

Hi,

Have a look at the microchip web site under Application notes, I2C.
There you will find lots of info.
Also look at www.microchipc.com

If you found this information useful, click on the Helped me

Good luck.
 

pic16f876a i2c

Hello!

The I2C Slave AN was very usefull.
I'm trying to connect both with the Slave source code, but it keep's giving error in I2C (the PORTB,7 Led turn ON, and WDTG reset's...)
I've tried several programs for the master, and the Slave always get that error...

I see the master Data & Clock in osciloscope getting out, but something wrong with the slave...

The I2C Master AN is complicated, all I want for now is to change the status of PORTB of Master and send it to the Slave PORTB.

Does anyone know where to find a simple code (master&slave) working, that I can check up?

Thanks again,

jS

PS: I'm working with 2 PIC16F876A at 20Mhz, and 12d in SSPADD.
 

mplab i2c help

Hello

Is it supose AN734&AN735 to work without any changes in PIC16F876A?

I'm always getting ERROR Led ON!

Please help,

jS
 

mplab i2c source

Hello!

Please post your code that I can check it.

Regards!
 

i2c testing

Hello

I'm using the source code of AN734&AN735 original of Microchip.

I'm only changing FOSC in AN735 (Master) source of 8Mhz to 20Mhz.

Programming, and testing.
When testing the Error Led in AN734 (Slave) is Set, then WDT reset the PIC, then when receive next data the Error Led is Set again, and keep like this...

I'm kinda desperate with this comunication....

Thanks in advance,

jS
 

pic16f876a i2c sample

I have used these 2 apppliaction notes before
they are really very good and very easy
the code worked from the first time
also , you will find an example source code on the site of microchip but it was hard to me to track this
So, if you could try this , it will help you

thanks
 

i2c driver mplab

Hello,

That's my problem, they are not working...

I use the original source code from Microchip site, only change it to PIC16F876A... What PIC did you use?

Thanks

jS
 

i2c+pdf+mplab

Hello

I think the problem is somewhere related with Slave PIC...

jS

Added after 5 hours 59 minutes:

Hello Again...

I'm more and more desperate with this I2C comunication!!!!

Please someone help me...

I'm using the Slave AN734, and it receives the ADDRESS, and then does not receive the data, jumps to Error...

The SSPCON at this state (error) is 01110110, and SSPSTAT is 01110110...
I clear the SSPOV, but it's the same...

If someone has done this with 16F876A please help me...

Thanks in advance,

jS
 

pic16f876a i2c slave

Hi,

Have a look at the registers again. IF you will look at the SSPSTAT bit 1 you will see that the data sheet says:
bit 1 UA: Update Address (10-bit Slave mode only)
1 = Indicates that the user needs to update the address in the SSPADD register
0 = Address does not need to be updated

Also it looks like you are getting overflow... you are not reading the data in time...

please re check the error codes that you are getting, and try to do a step at a time. see on what error the led turn on, and fix that. then move to the next and so on...

Good luck.
 

Sorry to bump a slightly old thread, but did this ever get solved? I am having exactly the same issue with a pair of 16f886's.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top