Hundred1906
Member
Just trying to get a better understanding of when these two values become valid. I have a 20x2 as slave and a Raspberry Pi as master (using Python and SMBUS).
To my mind the Picaxe Manual is a little vague about these two flags. To clarify:
Would appreciate anyone being able to clarify operation in this area because for my application set-up at the present I sometimes need to write an array, and sometimes just one byte. I am finding that if I don't clear hi2cflag the slave effectively drops off the bus and it's address becomes invalid. My code needs adapting but right now I am not sure how best to change it.
To my mind the Picaxe Manual is a little vague about these two flags. To clarify:
When I write sequential bytes onto the slave hi2cflag is set by each byte?
for control in range (1,num_controls):
i2cb.write_byte_data(Slave,control,controls[control])
When I write a word onto the slave hi2cflag is set ... when?
for control in range (1,num_controls):
i2cb.write_word_data(Slave,control,controls[control])
If I don't clear hi2cflag what happens?
When is hi2clast set and to what address. If it is set after each byte and a byte can only be sent after hi2cflag is clear isn't i2clast limited to an increment of one byte?
for control in range (1,num_controls):
i2cb.write_byte_data(Slave,control,controls[control])
When I write a word onto the slave hi2cflag is set ... when?
for control in range (1,num_controls):
i2cb.write_word_data(Slave,control,controls[control])
If I don't clear hi2cflag what happens?
When is hi2clast set and to what address. If it is set after each byte and a byte can only be sent after hi2cflag is clear isn't i2clast limited to an increment of one byte?
Would appreciate anyone being able to clarify operation in this area because for my application set-up at the present I sometimes need to write an array, and sometimes just one byte. I am finding that if I don't clear hi2cflag the slave effectively drops off the bus and it's address becomes invalid. My code needs adapting but right now I am not sure how best to change it.