I'm having a little trouble sorting out what your symptom is. USIIFG is set at (MCU) Reset, so I'm not very surprised that setting USIIE without writing something to USICNT would trigger the ISR. You could always clear USIIFG directly. A more common case would be to pre-load USISR/UCICNT to give something to the Master as soon as it "connects" -- that would have the side-effect of clearing USIIFG. Also, "USICTL0 = ", as you cited above, clears USISWRST. Is that the symptom, or is it that the MCU is stuck in the timer ISR waiting for the master to do something? A little more context might make things more clear. Unsolicited: You should probably grab the contents of USISR, then immediately re-load USICNT (and maybe USISR), and only then think about what you received. If you think too long and miss the next clock, both ends end up with a shifted "mush" (pardon the jargon).
↧