Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks mister_e![]()
Or you can stuff it in a ZIP file and post it here. The forum accepts ZIPs as attachments.
Some RAR programs can also save as ZIP format.
Robert
Thanks for the info Robert...
and here is the zip file.
Regards,
tacbanon
Last edited by tacbanon; - 28th April 2012 at 06:03.
Oops here are the codes I'm using for the master, Slave1 and Slave 2.
Thanks for the files tacbanon.
Well, this code for the slaves will allow it to read from both devices.
But it's still not right. And is not a complete slave.Code:main: IF SSPCON1.6 THEN SSPCON1.6 = 0 goto main i2c_int_handler: IF i2c_read then IF i2c_buffer_full=0 THEN SSPBUF=i2c_data[i2c_data_index] i2c_data_index=i2c_data_index+1 ELSE dummy = SSPBUF ENDIF ELSE i2c_data_index=0 ENDIF i2c_release_scl=1 @ INT_RETURN
According to AN734 there are 5 states to maintain. 6 including the ERROR state.
Your original code only handles 1 state, and this modification only does 2 states.
I think by adding the other 4 states, it will get rid of the buffer overflows, but I'm not absolutely sure.
I'm going to convert AN734 state machine to PBP and see what happens.
May take me awhile.
Last edited by Darrel Taylor; - 28th April 2012 at 18:17.
DT
Thank you for the code, and thanks in advance DT for your valuable time...looking forward for the end result(I wish and pray that things goes well). I've been reading about I2C on net, trying to understand and the applications that might be done(particularly on Master-(multi-Slave/Multi-master)) are very interesting...
Regards,
tacbanon
Last edited by tacbanon; - 29th April 2012 at 03:26.
Bookmarks