I2C-Bus Sniffer

Gast #92164
Lesenswert?

Hallo,

ich habe gerade dank Google bei www.avrfreaks.net einen einfach
aufzubauenden I2C-Bus Sniffer gefunden:
http://www.avrfreaks.net/Tools/showtools.php?ToolID=411

Es wird im großen und ganzen nur ein AVR + ein paar Bauteile benötigt.
Vielleicht kann's jemand brauchen.

Bye,
Roland
Angehängte Dateien:
Gast #92167
Lesenswert?

Hi

I am trying to understand the code of the AVRFreaks project I2C Sniffer
(http://www.avrfreaks.net/modules/FreaksFiles/files/566/DN_048.pdf) but
I am too "green" to understand everything and I hope that there is
somebody who can help me.

1st question (concerning the I2CRead-function):
char I2cRead(void) {
#asm
mov r30,r2
#endasm
}
Why is the programmer copying r2 to r30 ? This function returns one
char bit when following is executed: I2CByte = I2cRead(); Can somebody
approve this ? But it does not make much sense to have only one bit in
the I2CByte.... ????

2nd question:
Why does the programmer initialize the Timer/Counter ? I cannot see any
usage of the Timer/Counter........

I highly appreciate every help from you.....

Thanks a lot.
shorsh

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren