Сообщение от Someone
|
|
Этими командами ты просто отключил модуль ТВИ. Не отработав стоп.
|
Так что я раньше правильно делал, когда давал команду СТОП?
Я поменял после того. как прочитал:
"Status $00 indicates that a bus error has occurred during a Two-wire Serial Bus trans-
fer. A bus error occurs when a START or STOP condition occurs at an illegal position in
the format frame. Examples of such illegal positions are during the serial transfer of an
address byte, a data byte, or an acknowledge bit. When a bus error occurs, TWINT is
set. To recover from a bus error, the TWSTO flag must set and TWINT must be cleared
by writing a logic one to it.
This causes the TWI to enter the not addressed slave mode
and to clear the TWSTO flag (no other bits in TWCR are affected). The SDA and SCL
lines are released, and no STOP condition is transmitted."
Но, правда, я применил это не только к состоянию $00, но и к другим неопределенным состояниям. Возможно, это плохо.