|
I think there is a bug in usiTwlSlave.c when buffer underruns occur. Specifically, if this bit of code is ever reached, its game over: { // the buffer is empty SET_USI_TO_TWI_START_CONDITION_MODE( ); return; } // end if The fix is to change SET_USI_TO_TWI_START_CONDITION_MODE to set SDA as an input rather than leaving it as a output in the buffer underrun case: #define SET_USI_TO_TWI_START_CONDITION_MODE( ) \ { \ /* set SDA as input */ \ DDR_USI &= ~( 1 << PORT_USI_SDA ); \ USICR = \ I was seeing the issue you were seeing today until I did this.
|