How to discover I2C device addresses

Does anyone have a code snippet or other means of discovering any I2C device's address?
I have a couple I2C displays and other things that I would like to interface, but don't know the proper I2C address.
Thanks in advance!
I have a couple I2C displays and other things that I would like to interface, but don't know the proper I2C address.
Thanks in advance!
Comments
@JonnyMac has some code on github that scans for a range of addresses and lists what it finds in a matrix.
https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_i2c_devices
At least that's how I read the code. It looks like the zip file has all the objects you need to run the code. I'm downloading it now to test it. It only prints the addresses though.
However, there are a couple of URLs which do list I2c addresses. Below are a few I found with the "Is there a database of I2C addresses" google search:
https://i2cdevices.org/addresses
https://learn.adafruit.com/i2c-addresses/the-list
Their list seems to terminate at 0x7F. Not sure why. They don't have the $A4 and $A5 addresses for my RV-3028-C7 RTC though.
Thanks!
*** I2C *** $40 I/O $A0 EE/RTC $AE EE/RTC $DE RTC
TAQOZ# lsi2c --- I2C DEVICES $36 P2D2 UB USB+SUPPORT UUID:E09BAD5834DEE811A8D742B1A51F80DA $A4 RV-3028 RTC $C4 Si5351A CLOCK GEN ok
Peter, I can't seem to get lsi2c to work on my P2 Edge in the Flexprop terminal that is started when selecting P2 ROM TAQOZ.
lsi2c ???
Is lsi2c part of some extended command set? Or is because there aren't any I2C devices currently connected?
I2C is one of those acronyms that people use freely, while not knowing what it stands for (Inter-Integrated Circuit).
There is nothing stopping you from taking a few seconds to load the TAQOZ binary into RAM, and if you have an SD card inserted, just tell it to backup to it with BU.
------------------------------------------------------------------------------- Parallax P2 .:.:--TAQOZ--:.:. V1.1--v33h 190219-1900 ------------------------------------------------------------------------------- TAQOZ# --- ok TAQOZ# lsi2c ??? --- ok TAQOZ# WORDS --- DUP OVER SWAP ROT -ROT DROP 3RD 4TH 2DROP 3DROP NIP 2SWAP 2DUP ?DUP AND ANDN OR XOR ROL ROR >> << SAR 2/ 2* 4/ 4* 8<< 16>> 8>> 9<< 9>> REV |< >| >N >B >9 BITS NOT = <> 0= 0<> 0< < U< > U> <= => WITHIN DUPC@ C@ W@ @ C+! C! C@++ W+! W! +! ! BIT! SET CLR SET? 1+ 1- 2+ 2- 4+ + - UM* * W* / U/ U// // */ UM// C++ C-- W++ W-- ++ -- RND GETRND SQRT SETDACS ~ ~~ W~ W~~ C~ C~~ L>S >W L>W W>B W>L B>W B>L MINS MAXS MIN MAX ABS -NEGATE ?NEGATE NEGATE ON TRUE -1 FALSE OFF GOTO IF ELSE THEN BEGIN UNTIL AGAIN WHILE REPEAT SWITCH CASE@ CASE= CASE> BREAK CASE ADO DO LOOP +LOOP FOR NEXT ?NEXT I J LEAVE IC@ I+ BOUNDS H L T F R HIGH LOW FLOAT PIN@ WRPIN WXPIN WYPIN RDPIN RQPIN AKPIN WAITPIN WRACK PIN @PIN ns PW PULSE PULSES HILO DUTY NCO HZ KHZ MHZ MUTE BLINK PWM SAW BIT BAUD TXD RXD TXDAT WAITX WAITCNT REBOOT RESET 0EXIT EXIT NOP CALL JUMP >R R> >L L> !SP DEPTH COG@ COG! LUT@ LUT! COGID COGINIT COGSTOP NEWCOG COGATN POLLATN SETEDG POLLEDG KEY WKEY KEY! CON NONE COM CONKEY CONEMIT SEROUT EMIT EMITS CRLF CR CLS SPACE SPACES RAM DUMP: DUMP DUMPW DUMPL DUMPA DUMPAW QD QW DEBUG lsio COG LUT KB MB M . PRINT .AS .AS" .DECL .DEC4 HOLD #> <# # #S <D> U. .DEC .BIN .H .B .BYTE .W .WORD .L .LONG .ADDR PRINT$ LEN$ " ." CTYPE ?EXIT DATA? ERASE FILL CMOVE <CMOVE s ms us CNT@ LAP LAP@ .LAP .ms HEX DEC BIN .S WORDS @WORDS GET$ SEARCH $># @DATA HERE @HERE @CODES uemit ukey char delim names TASK REG @WORD SPIN | || , [W] ["] NULL$ $! $= ASM FORGET CREATE$ CREATE VAR pub pri pre : ; [ ] ' := ==! ALIGN DATCON ALLOT org bytes words longs byte word long res [C] GRAB NFA' CPA CFA \ --- ( { } IFNDEF IFDEF TAQOZ TERM AUTO SPIRD SPIRDL SPIWB SPICE SPIWC SPIWW SPIWM SPIWL SPIPINS SPIRX SPITXE SPITX WAIT CLKDIV RCSLOW HUBSET WP WE CLKHZ ERROR SFPINS SF? SFWE SFINS SFWD SFSID SFJID SFER4 SFER32 SFER64 SFERASE SFWRPG BACKUP RESTORE SFRDS SFWRS SFC@ SFW@ SF@ SF .SF SDBUF sdpins MOUNT DIR !SD !SX SD? CMD ACMD cid SDWR SDRDS SDWRS FLUSH FOPEN FLOAD FGET FREAD FWRITE SECTOR SDRD SDRDS SDADR SD@ SD! SDC@ SDC! SDW@ SD @FAT @BOOT @ROOT fat END 432 ok TAQOZ#
For instance I2C. Which pins does this look at and how to change it?
Is there a comprehensive list of which pins TAQOZ default uses for devices?
Thanks!
Hi Dave, I almost missed your post. If you call I2CPINS ( scl sda -- ) it will also setup the pins with stiff 1K5 soft pullups as soon as you start to talk to the bus. You can go as fast as the fastest chip can go (well over 3000 kHZ) or slow right down for those really really old 100kHz chips too by using I2C.KHZ ( khz -- )
You don't external pullups but most of the time they are fairly weak 10k pullups anyway so it doesn't matter if you already have them connected.
Use lsi2c to discover and list the I2C devices on the bus.