
am AVR (Mega):
bei 400kHz: ja, ebenfalls; seltsamerweise sogar auch noch 78...7E
bei 100kHz auch, aber mit I2C Error 4 (dargestellt als ?? )
https://github.com/arduino/ArduinoCo...ity/twi.c#L224
Code:
Scanning at 100k
0 ** ?? ?? ?? ?? ?? ?? ?? -- -- -- -- -- -- -- --
1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
3 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
4 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
5 -- -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --
6 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
7 -- -- -- -- -- -- -- -- ?? ?? ?? ?? ?? ?? ?? **
Scan result for i2cclock 100k
found: 1 devices
error: 14 devices
Scanning at 400k
0 ** 01 02 03 04 05 06 07 -- -- -- -- -- -- -- --
1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
3 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
4 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
5 -- -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --
6 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
7 -- -- -- -- -- -- -- -- 78 79 7A 7B 7C 7D 7E **
Scan result for i2cclock 400k
found: 15 devices
error: 0 devices
- - - Aktualisiert - - -
dies ist mein Scanner Code:
Code:
// --------------------------------------
// i2c_scanner
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
#define ESP_SCL D1 //GPIO5=D1 SCL ESP8266 default
#define ESP_SDA D2 //GPIO4=D2 SDA ESP8266 default
byte error, address;
int nDevices, nDeverr;
void setup()
{
//Wire.pins(D2, D1); // change only if not default
Wire.begin();
Serial.begin(115200);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop() {
static uint32_t i2cclock = 10000;
int iores;
nDevices = 0;
nDeverr = 0;
if(i2cclock==10000) i2cclock=100000;
else
if(i2cclock==100000) i2cclock=400000;
/*else
if(i2cclock==400000) i2cclock=1000000;
*/
else
if(i2cclock==400000) i2cclock=10000;
Wire.setClock(i2cclock);
Serial.print("\nScanning at "); Serial.print(i2cclock/1000); Serial.println("k");
for(address = 0; address < 128; address++ ) {
if (address%16 == 0) {
Serial.println();
Serial.print( (address+1)/16);
Serial.print(" ");
}
if(address==0 || address==127) {
Serial.print("** ");
continue;
}
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
if (address<16) Serial.print("0");
Serial.print(address,HEX); Serial.print(" ");
nDevices++;
}
else if (error==4)
{
Serial.print("?? ");
nDeverr++;
}
else
{
Serial.print("-- ");
}
}
Serial.println();
Serial.print("Scan result for i2cclock "); Serial.print(i2cclock/1000); Serial.println("k");
Serial.print("found: "); Serial.print(nDevices); Serial.println(" devices ");
Serial.print("error: "); Serial.print(nDeverr ); Serial.println(" devices \n");
delay(5000);
}
- - - Aktualisiert - - -
(bei ARMs habe ich nie diese error 4 = ?? , allerdings auch nie die Adressen 78...7E)
Lesezeichen