Yesterday, I had a bug in my code when reading from the SLG46826V, it turned out to be that there was no grace period between commands to the MCP2221A. At work it suddenly popped up in my mind, maybe the other problems with the MCP2221A could be because of no grace time.
I started adding the grace time everywhere without realizing that I could just add it twice, since most code executes commands using the two same functions... stupid me. I'm going to refactor the code. I simply added the grace time to the send_command and read_response. Now I could remove all the other grace time before all the calls to these functions. Now I need to backup my code, before refactoring further.
I should probably move all MCP2221A related code into it's own library. Sadly no time for that today.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.