I'm complete newbie working on a program for a PIC18f24J10 that takes data off of an i2c bus and displays it on an LCD screen (cheap two wire LCD backpack module)
I'm looking at the data for the hardware i2c module and software i2c module and cannot find a command for i2c slave mode. Am I missing something?
If slave mode support does not exist, does someone have something they have coded already to give me a head start of building a module for it?
i2C Slave Module Support
Moderators: David Barker, Jerry Messina
Thanks
Good ideas - I was hoping to insulate the i2c master(s) from having to send control signals and do timing as well as display text by i2c- i have multiple i2c masters who will be sending status information to a shared common lcd display that are of different micro types- i would have to write an i2c expander driver for each of these micros unless the slave display peripheral handles these functions.
Looks like I may have to write a module....
It looks like a good start may be these picbasic pro routines unless anyone has seen something better:
http://www.astrosurf.com/soubie/pic_as_an_i2c_slave.htm , and:
http://www.astrosurf.com/soubie/downloads.htm
Looks like I may have to write a module....
It looks like a good start may be these picbasic pro routines unless anyone has seen something better:
http://www.astrosurf.com/soubie/pic_as_an_i2c_slave.htm , and:
http://www.astrosurf.com/soubie/downloads.htm
I hope so- this article explains it:
http://www.esacademy.com/faq/i2c/general/i2carbit.htm
"When a master changes the state of a line to HIGH, it MUST always check that the line really has gone to HIGH. If it stays low then this is an indication that the bus is occupied and some other device is pulling the line low.
Therefore the general rule of thumb is: If a master can't get a certain line to go high, it lost arbitration and needs to back off and wait until a stop condition is seen before making another attempt to start transmitting."
I will have to modify i2c bus master to check the current state of a line hi/lo before transmitting, and implement a random timer to attempt transmission again. This should effectively make it a multi-master i2c bus.
http://www.esacademy.com/faq/i2c/general/i2carbit.htm
"When a master changes the state of a line to HIGH, it MUST always check that the line really has gone to HIGH. If it stays low then this is an indication that the bus is occupied and some other device is pulling the line low.
Therefore the general rule of thumb is: If a master can't get a certain line to go high, it lost arbitration and needs to back off and wait until a stop condition is seen before making another attempt to start transmitting."
I will have to modify i2c bus master to check the current state of a line hi/lo before transmitting, and implement a random timer to attempt transmission again. This should effectively make it a multi-master i2c bus.