Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Help needed for I2C-slave command
Page 2 of 2 | |||||
Author | Message | ||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3196 |
No, both I2C_Rcv_Tail and I2C_Rcv_Head addresses will vary with each compile. It seems that I will have to build a test system and dig further into this. Unfortunately it will have to wait until I am back in a couple of months. Geoff Geoff Graham - http://geoffg.net |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6102 |
No problems Geoff. We can easily flush the buffer to make sure the problem doesn't cause grief. Jim VK7JH MMedit MMBasic Help |
||||
viscomjim Guru Joined: 08/01/2014 Location: United StatesPosts: 925 |
Hi TassyJim and FrankNFurter, Have you come to any final conclusions on this I2C thing? I have designed this into a project to use a uMite as I2C slave to another uMite master to expand a few ports and am worried that this is not working as expected. Is it necessary to flush the receive buffer or does the open and close do that? FrankNFurter, I am especially interested in what you are doing as it sounds similar to my application. Are you having any better results yet? Thanks a million!!!! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6102 |
Jim, I would feel confident with using the I2C SLAVE commands. There are two things to remember. 1. If you don't issue the I2C SLAVE CLOSE command, the master will not know that the slave is not responding. You could add code to send a 'reply'. This should only be a problem if the slave falls over. 2. Whenever the I2C SLAVE OPEN is issued, apart form the initial startup, there will be extra data in the receive buffer which needs to be flushed. How you do this depends on what format your data is in. ie fixed length or random length data would need to be handled differently. You are not able to flush this extra data until the first RECEIVE interrupt occurs so the first data after a fault may have to be discarded. The problem sounds easy to fix but because it is closely intermingled with the MASTER and sending code, a quick fix may not be a good idea. Jim VK7JH MMedit MMBasic Help |
||||
viscomjim Guru Joined: 08/01/2014 Location: United StatesPosts: 925 |
Hi TassyJim, In my application, the master will be sending the slave only 1 byte as a command, so when I send to slave, should I anticipate that I need to flush 1 byte from the buffer prior to reading the next data byte? or should I do a major flushing like a few bytes and then read the data? Thanks for your help!!! |
||||
Page 2 of 2 |
Print this page |