Hundred1906
Member
Has anyone seen any simple flow control techniques for i2C?
I have a picaxe 20x2 acting as an i2c LCD. The 20x2 is in slave mode and simply receives and passes on to the LCD command and text streams sent by the i2cMaster, but it takes the Slave and LCD a little while to execute the display requests.
Flow control is achieved for now by the Slave device setting a busy/not busy flag in it's scratchpad memory where the Master can read it. The problem is that at the Master end I need a function allowing the Master to hang about for a bit if the slave is busy but not allowing the Master to get itself locked up. In my case the Master is also picaxe and it has plenty of other time related tasks to get on with.
A way round this is of course to use a cyclic/ring buffer.
Would appreciate any views, experience or shortcut ideas.
I have a picaxe 20x2 acting as an i2c LCD. The 20x2 is in slave mode and simply receives and passes on to the LCD command and text streams sent by the i2cMaster, but it takes the Slave and LCD a little while to execute the display requests.
Flow control is achieved for now by the Slave device setting a busy/not busy flag in it's scratchpad memory where the Master can read it. The problem is that at the Master end I need a function allowing the Master to hang about for a bit if the slave is busy but not allowing the Master to get itself locked up. In my case the Master is also picaxe and it has plenty of other time related tasks to get on with.
A way round this is of course to use a cyclic/ring buffer.
Would appreciate any views, experience or shortcut ideas.