ON 20110101@5:56:53 PM at page: On a web page you were interested in at: http://techref.massmind.org/Techref/microchip/multitasking.htm# David A Cary[DAV-MP-E62a] edited the page. Difference: http://techref.massmind.org/techref/diff.asp?url=\Techref\microchip\multitasking.htm&version=0 ON 20110105@10:56:55 AM at page: On a web page you were interested in at: http://www.piclist.com/microchip/i2c-dv.htm#40547.8832407407 James Newton[JMN-EFP-786] published post 40547.8832407407 Andrew, Thanks for the excellent I2C code. I'm using it successfully to communicate with an Avago proximity sensor. I just wanted to let you know that I found one small flaw in the code _when used on my hardware_ (PIC16F917). I found that the Byte_In routine was always setting the MSB of the Data_Buf to 1. The reason is that the rlf just after the label ControlIn is rotating the carry bit into the LSB. In the PIC16F917, the carry bit is high when no carry has occurred. One solution is to put a clrc on the line just before "rlf Data_Buf". I found that this solved my stuck-MSB problem. Thanks again! Dave |Delete 'P-' before: '' but after: ' What is a good way to define at the top of my source code which pin is connected to the red LED, the green LED, etc.? When (not if!) they get re-connected to some other pin, I want to tweak that one place at the top of my code and it will Just Work -- rather than painstakingly finding and changing each and every line that ever touches the red or green LED. (Where is the page in the MassMind that already covers this, if any?)