Stanko Posted September 6, 2023 Share Posted September 6, 2023 Hi, there seems to be an issue with the api for setting up I2C DIOs. The example works with DIO 0 and 1 but if i want to use 24 and 25, then i get the following error: Error: i2c -> open -> Invalid channel index provided FDwfDigitalI2cSclSet attached you can find the code example test_i2c_poti_new.py Link to comment Share on other sites More sharing options...
0 attila Posted September 6, 2023 Share Posted September 6, 2023 Hi @Stanko The Digital Discovery has 16 DIOs and 24 DINs. Only the DIOs can be used for protocols. These are labels as DIO24-39 and in programming used with 0 base indexing, 0=DIO24, 1=DIO25... Link to comment Share on other sites More sharing options...
0 Stanko Posted September 7, 2023 Author Share Posted September 7, 2023 (edited) hi @attila, thanks for the insight. The labels and how they relate to the indexing is a bit confusing. however i still get a NAK error. When i communicate over the GUI everything is fine. GUI: trying to do the same with python I am getting a NAK error Is there a way, maybe through some logger to read back the set settings and on which GPIO actually is sent what. In the gui I am seeing the full message sent... Edited September 7, 2023 by Stanko Link to comment Share on other sites More sharing options...
0 Stanko Posted September 7, 2023 Author Share Posted September 7, 2023 the warning message is also not helping a lot. what means NAK: index "c_long(1)'? I would appriciate any advice on how to troubleshoot the issue. Link to comment Share on other sites More sharing options...
0 attila Posted September 7, 2023 Share Posted September 7, 2023 Hi @Stanko You are getting NAK on the first word, at the address. Make sure the address is correct, is 8 bit format, see the examples. Link to comment Share on other sites More sharing options...
0 Stanko Posted September 7, 2023 Author Share Posted September 7, 2023 hi @attila, Thank you, issue is resolved. I had to shift the 7bit address 1 bit to the left '0x28 <<1' for the write operation. Now it is working. A debugging feature, like a logger. which displayes the raw messages sent would be nice to have. Do you have something like this, which i could use for the future? Similar like we see this in the gui: attila 1 Link to comment Share on other sites More sharing options...
0 attila Posted September 7, 2023 Share Posted September 7, 2023 Hi @Stanko The written address and data should be what it was specified. It returns error or nak index and the read data. Link to comment Share on other sites More sharing options...
Question
Stanko
Hi, there seems to be an issue with the api for setting up I2C DIOs.
The example works with DIO 0 and 1 but if i want to use 24 and 25, then i get the following error:
Error: i2c -> open -> Invalid channel index provided
FDwfDigitalI2cSclSet
attached you can find the code example
test_i2c_poti_new.py
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now