Hello The following is a code snip for I2C between a BS2 and another device. I am new at this and trying to understand the code. It is not commented. I was hoping someone could explain how this works. It seems to me it would be more effective to use the shiftin/shiftout command? I am really having trouble with the : IF (bit_count & in_byte) then si2c_wbyte_do1 The "in_byte" is the value we want to write, but it is the "bit_count" that is shifted to the right. Does this previous command mask the two variables and "bit_count" is now the sum of those two variables after the mask? Can someone make this code more efficient? Help si2c_wbyte: ' returns 1 if successful, 0 = NACK ' in_byte is byte to be written bit_count=%10000000 si2c_wbyte_lp: low si2c_clk input si2c_data IF (bit_count & in_byte) then si2c_wbyte_do1 low si2c_data si2c_wbyte_do1: bit_count=bit_count>>1 input si2c_clk IF bit_count then si2c_wbyte_lp ' now test the acknowlege bit low si2c_clk input si2c_data input si2c_clk exit_ack=0 IF in1 then si2c_wbyte_ex exit_ack=1 si2c_wbyte_ex: return