Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i2c bus scan #5

Closed
theedge456 opened this issue Nov 14, 2020 · 9 comments
Closed

i2c bus scan #5

theedge456 opened this issue Nov 14, 2020 · 9 comments
Labels
question Further information is requested

Comments

@theedge456
Copy link

Hello,
First, thanks for making this API available. It helped a lot.
I have an old DVB-T dongle derived from the FX2LP connected to an i2c device.
To know what address it is using, I'm using the following code:

#include <fx2i2c.h>
//#include <fx2regs.h>
#include <fx2lib.h>
//#include <stdio.h>

// Scratchpad is from 0xe000 to 0xe1fff (cf TRM sec 5.3 / EZ USB FX2LP p11)

int main() {

  uint8_t i;
 bool r;
 for (i=0;i<128;i++) {
     r=i2c_start(i);
     if (r)
       scratch[i]=i;
     else
       scratch[i]=0x00;
     i2c_stop();
   }
 while (1);
}

The problem is that the dump shows 00 for every element.
Any hint ?

--
Fabien

@whitequark whitequark added the question Further information is requested label Nov 14, 2020
@whitequark
Copy link
Owner

Can you test this with a known good I2C chip, like a 24C02 or similar generic EEPROM?

@theedge456
Copy link
Author

theedge456 commented Nov 15, 2020 via email

@theedge456
Copy link
Author

theedge456 commented Nov 16, 2020 via email

@whitequark
Copy link
Owner

Ok. What if you do the same on your original dongle? Also, you might want to scan write addresses only (i<128, i2c_start(i<<1)). If you scan read address you need to read a dummy byte afterwards.

@theedge456
Copy link
Author

theedge456 commented Nov 16, 2020 via email

@whitequark
Copy link
Owner

Yes, that seems to imply that the dongle has loaded its firmware from a EEPROM at the unshifted address 0b1010001.

@theedge456
Copy link
Author

theedge456 commented Nov 17, 2020 via email

@whitequark
Copy link
Owner

Sure. I don't see what that has to do with libfx2 though.

@theedge456
Copy link
Author

You're right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants