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

Dead time after resetting #4

Open
therealprof opened this issue Jan 6, 2019 · 7 comments
Open

Dead time after resetting #4

therealprof opened this issue Jan 6, 2019 · 7 comments

Comments

@therealprof
Copy link

I'm writing a driver in Rust for the I2CEncoderV2 and noticed that my initialisation sequence does not work because as a good citizen I would like to do a RESET followed by proper initialisation but when I set the reset bit the following I2C interaction automatically receives a NACK.

@Fattoresaimon
Copy link
Owner

Hello,
I just did some tests.
I have found that the board requires at least 400uS for RESET.
Try to put a 400uS after issuing the RESET command.
Sorry i never had measured it before, i will add in the datasheet.
Thank you.

@therealprof
Copy link
Author

Hm, no idea how to achieve that in a generic driver. Can I keep polling until it comes back?

@Fattoresaimon
Copy link
Owner

You can try, but i'm not sure that is the way.
Remember that the I2C Encoder V2 is based on a MCU and not on FPGA or CPLD.
So it's a bit slower on some operations.

@therealprof
Copy link
Author

Yeah, but I2C is not super fast anyway. I'd totally expect that any MCU can handle the timing by setting I2C up early and stretching the clock until it is ready to handle additional data.

@Fattoresaimon
Copy link
Owner

Clock stretch is not enabled, check the other issue #3

@Fattoresaimon
Copy link
Owner

The RESET command is a full reset of the MCU.
So after that the MCU will restart from the beginning: initialize the peripherals, the variables, ecc..

@therealprof
Copy link
Author

Sure. But maybe if you want to have a proper I2C slave you should try to prioritise the functionality required for an I2C slave first?

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

No branches or pull requests

2 participants