А вот и полный дамп.
и добавил...А вот и код Сниффера:
#define MAX_EVENTS 512
int SCL_PIN = 2;
int SDA_PIN = 3;
char data[MAX_EVENTS];
int dp = 0;
void setup()
{
pinMode(SCL_PIN, INPUT);
pinMode(SDA_PIN, INPUT);
Serial.begin(115200);
}
void loop()
{
unsigned char s;
dp = 0;
//byte inputByte = PIND;
lookForStart:
// Expect both SCL and SDA to be high
while ((PIND & 0b00001100) != 0b00001100);
// both SLC and SDA high at this point
// Looking for START condition. Ie SDA transitioning from
// high to low while SLC is high.
while ((PIND & 0b00001100) != 0b00000100);
data[dp++] = 'S';
// wait for SCL low
while ((PIND & 0b00000100) != 0);
lookForData:
while (dp < MAX_EVENTS)
{
// wait for SCL low
while ((PIND & 0b00000100) != 0);
// Wait for SCL to transition high
while ((PIND & 0b00000100) == 0);
// Sample SDA at the transition point
s = PIND & 0b00001000;
data[dp++] = (s == 0 ? '0' : '1');
// Wait for SCL to transition low while looking
// for start or stop condition. A START or STOP
// means the previous bit isn't a data bit. So will
// write START, STOP condition into the same memory slot
if (s == 0)
{
while ((PIND & 0b00000100) != 0)
{
if ((PIND & 0b00001000) != 0)
{
// detected STOP condition
data[dp-1] = 'P';
goto lookForStart;
}
}
}
else
{
while ((PIND & 0b00000100) != 0)
{
if ((PIND & 0b00001000) == 0)
{
// detected START condition
data[dp-1] = 'S';
goto lookForData;
}
}
}
}
// have exceed storage. Dump to serial port and restart.
writeData();
}
void writeData ()
{
int i;
for (i = 0; i < dp; i++)
{
Serial.print (data
);
if (data == 'P')
{
Serial.println ("");
}
}
Serial.println ("");
}
и добавил...
Никаких переменных, отвечающих за частоту на шине нет. Программа просто читает пины синхронизации и данных.
и добавил...
У тебя не было таких проблем?
и добавил...
Я считаю, что это большое продвижение за несколько часов работы
Интересно, что китаец выставил Quantizer на 8 бит. Я заметил, что лучший звук для моей платы можно получить с Quantizer 8 или 9 бит.