I am developing a PCB of a test setup based on AD3.
I am using I2C to control a couple of I2C I/O expanders to control relays (lots of them).
There are a few other devices (relays, LEDs, switches etc.) that I was thinking of controlling through the digital I/O signals. I found a recent thread with a similar use case. That user, though, was trying to use the DigitalOut functions and I understood it is not possible using both, protocol and Digital[In/Out] because of resource conflicts.
I only need static I/O and, one of the answers by @attila suggests that it should be possible using DigitalIO:
Quote
You can use the digital-io functions to control the DIOs.
I implemented two small classes in python to perform the i2c and DigitalIO functions I need, and I have run a few tests. In a very similar way as user @liu, I can have the object instances of either class to work separetely, but when I create the i2c object and then the DigitalIO object, this latter breaks the former (it returns "NAK -1").
Looking at the pdf version of the reference manual, I found this:
Quote
The digital IO signals are shared in the device between Digital-IO, Out and In functions. The Digital-IO has priority over Digital-Out. The Digital-Out is only applied for a signal when the Digital-IO Enable and Output are zero for the respective bit.
I obviously made some mistake as the statement above is not entirely clear to me. Is there an example or code snippet that I could use as a basis to allow me to use both I2C and DigitalIO without conflicts?
Question
EVC
I am developing a PCB of a test setup based on AD3.
I am using I2C to control a couple of I2C I/O expanders to control relays (lots of them).
There are a few other devices (relays, LEDs, switches etc.) that I was thinking of controlling through the digital I/O signals. I found a recent thread with a similar use case. That user, though, was trying to use the DigitalOut functions and I understood it is not possible using both, protocol and Digital[In/Out] because of resource conflicts.
I only need static I/O and, one of the answers by @attila suggests that it should be possible using DigitalIO:
I implemented two small classes in python to perform the i2c and DigitalIO functions I need, and I have run a few tests. In a very similar way as user @liu, I can have the object instances of either class to work separetely, but when I create the i2c object and then the DigitalIO object, this latter breaks the former (it returns "NAK -1").
Looking at the pdf version of the reference manual, I found this:
I obviously made some mistake as the statement above is not entirely clear to me. Is there an example or code snippet that I could use as a basis to allow me to use both I2C and DigitalIO without conflicts?
Thanks in advance.
Link to comment
Share on other sites
2 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