Comments on: I²C Communication with PIC Microcontroller – MPLAB XC8 https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/ You Inspire.....We Create..... Mon, 31 Aug 2020 05:51:36 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: atul redekar https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9722 Mon, 31 Aug 2020 05:51:36 +0000 https://electrosome.com/?p=11919#comment-9722 Thank you so much works perfectly

]]>
By: Ligo George https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9707 Wed, 05 Aug 2020 05:18:19 +0000 https://electrosome.com/?p=11919#comment-9707 In reply to derlo.

Firstly above example uses PIC 16F877A while 16F877 is a different microcontroller and above code is tested too.
This tutorial is intended for beginners/students who are new to these.

If you want more efficient code for your project you should utilize interrupts for that. That was not in the scope of above tutorial.

]]>
By: derlo https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9704 Tue, 04 Aug 2020 10:05:17 +0000 https://electrosome.com/?p=11919#comment-9704 In reply to Ligo George.

Pity that this code is not utilizing the power of a true hardware I2C MASTER mode; when working it is the most efficient way to implement I2C; instead it waits for each state to complete; very inefficient; Also PIC16F877 is obsolete now; would be nice to see a newer PIC micro with full I2C MASTER mode ; I am working on it right now but it does not work properly – that’s the reason I came across this page – searching for hints re what I might be doing wrong

]]>
By: Jimmy https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9588 Thu, 02 Apr 2020 23:12:29 +0000 https://electrosome.com/?p=11919#comment-9588 In reply to Ligo George.

I look at the same. Send more variable to the Slave

]]>
By: Ligo George https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9577 Thu, 02 Apr 2020 03:57:14 +0000 https://electrosome.com/?p=11919#comment-9577 In reply to Devang Lad.

You can understand and make necessary changes to the above program.

]]>
By: Devang Lad https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9570 Tue, 31 Mar 2020 11:52:40 +0000 https://electrosome.com/?p=11919#comment-9570 If i want to send more than one variable from master to slave and save them on diffrent variable on slave
how i can do it.

]]>
By: Ligo George https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/9527 Sun, 16 Feb 2020 06:42:33 +0000 https://electrosome.com/?p=11919#comment-9527 In reply to Mazzarolo, Moises Antonio.

? is conditional operator in C
(condition)?true part;false part
same as if(condition) {true part;} else {false part};

]]>
By: Hatem https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/8617 Tue, 03 Dec 2019 00:03:53 +0000 https://electrosome.com/?p=11919#comment-8617 Great job !! otherwise i am still surprised that it’s working for you.
+ slave should release SCL stretch by setting CKP flag at data reception in this case => SSPSTAT.D/A = true. //data
+ also in this case if(!SSPSTATbits.D_nA && !SSPSTATbits.R_nW) after address+write byte reception (0x30), if SCL is kept stretched by slave, master won’t be able to set clock again.

NB:
SSPCON.CKP flag In I2C Slave mode:
SCK release control
1 = Enable clock
0 = Holds clock low (clock stretch). (Used to ensure data setup time.)

]]>
By: Mazzarolo, Moises Antonio https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/8400 Sat, 16 Nov 2019 01:51:24 +0000 https://electrosome.com/?p=11919#comment-8400 Hello, I am studying the RTC code and did not understand what it means (a)? 0: 1;
Can someone explain me?

]]>
By: Robert https://electrosome.com/i2c-pic-microcontroller-mplab-xc8/#comments/7816 Fri, 27 Sep 2019 19:08:50 +0000 https://electrosome.com/?p=11919#comment-7816 Thanks. Work fine!!

]]>