Jump to content
  • 0

IO logic implementation using Analog Discovery 2


bremenpl

Question

Hello there,

I am trying to accomplish a simple logic scenario with the Waveforms and Analog Discovery 2 device, although I don't know how. The scenario is:

1. I define 2 GPIO pish-pull outputs 0 and 1.
2. Once I set a state on IO 0, the state on IO 1 should be reversed (NOT logic).
3. This should possibly work in real time.

Is there a way to accomplish this with the given tools? I would appreciate all feedback!

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @bremenpl

You could use a Script which at each run toggles the value:

image.png.04525d539f5843eb2db69f7e0bafe3de.png

StaticIO.Channel0.DIO0.value = !StaticIO.Channel0.DIO0.value;
StaticIO.Channel0.DIO1.value = !StaticIO.Channel0.DIO0.value;
StaticIO.config()

 

You could also use ROM logic.
Like here DIO 0 is controlled by StaticIO (or externally) and DIO 1 by the Patterns ROM logic based on DIO 0 value, with 70ns delay.

image.png.cc994bb443da4624326ea45c5f3a6eab.png

image.png.3986429b78200f52c661c4942bac1c4c.pngimage.png.5184a165f3585adfdf383127e53fc7ee.png

image.png.befca19ef85d31352ce65f0bd21dd7e3.png

Link to comment
Share on other sites

  • 0

Hi @attila

Thank you for the answer. I am trying to follow your suggestion with the ROM logic, but cannot get it to work. 

image.thumb.png.e1e31a310140c9cd7261326ea716ba4f.png

image.thumb.png.f93851ffaa7ed7802d8b9ac1969eebde.png

image.thumb.png.1b5071f45123075095fe931f96271b8f.png

My problem is that the DIO 1 always stays set to 1 and does not change when I change the DIO 0. What it could be that I am missing? I would appreciate your further feedback.

PS: Please also note that my ROM logic dialog looks a bit different than yours. This checkbox I am missing:

image.png.e51ff3c49838462adb2285de68767f50.png

EDIT: Ok, I think it does work, but the DIO 1 state change delay is like 8 seconds... What could be the issue?

Edited by bremenpl
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...