' ' I2C_Locator.bas ' ' Checks all I2c devices on the I2c-bus ' ' Ben Zijlstra - 22 februari 2004 - https://benshobbycorner.nl/bzijlstra ' $crystal = 7372800 $regfile = "M16def.dat" $baud = 9600 Config Scl = Portc.0 Config Sda = Portc.1 Dim Adr As Word Dim Row As Byte Wait 1 Print Print " I2c-device locator Bascom-AVR" Print Print " 1 = no device" Print " 0 = device" Print Print " 0 2 4 6 8 A C E" Print Print " 0000 "; For Adr = 0 To 254 Step 2 Row = Adr Mod 16 ' addresses If Row = 0 And Adr > 0 Then Print ' end of line? Print " " ; Hex(adr) ; " "; End If I2cstart ' generate start I2cwbyte Adr Print " " ; Err ; " "; ' 1 no device, 0 device I2cstop Next Adr Print End