Jump to content

Interrupt problem with the Industrial Digital In 4 Bricklet, ver 1r


Recommended Posts

Geschrieben

I'm using Industrial Digital In 4 Bricklet, the first hardware version and has made my program in Python. My problem is the interupt functionality.

 

To one of the inputs I have connected a micro switch. Because it act as a limit switch for a stepper motor movement, (the signal is also used for reference settings) I have connected as a Normal Closed. In other word, it means that we have signal at the input in normal case. When switch is actived, then the signal drops.

 

In my progam I have also a row with myInput.set_edge_count_config(0b1111, 2, 50), as I want interupts on both rising and falling signals.

 

Whats happens, (or not happens), in my program is that I don't got any responce on the first falling edge of "switch" input. On the second activation of the switch it works as normal.

 

If I first touch the switch before using the rest of functions in my program, then it works.

 

For the other inputs I use Normal Open switches, they work as normal directly from the beginning of the program.

 

So, for me, it seems that the functions, and maybe the firmware, has a problem to handles signals that "High" at start up.

 

If somebody has a solution for my problem, or could explain what I have missed, please tell me.

 

// Göran

 

Geschrieben

So, I have now tested the beta-firmware. The result is "Yes and No" ...

 

Yes

When I run my software the first time after power on of the Tinkerforge module stack, it function well with the interrupt for the microswitch, (with the Normal Closed contact).

 

No

If I stop my software and run it again, then is it as before, I need to touch the microswitch one time before I active my routin's.

Do I, for example, make the stack powerless and disconnect it from USB and then reconnect it, then it works directly the first time I run my software.

 

Another drawback I noticed was, (I downloaded the beta even in my second Digital Input card), for normal open contacts it didn't work well. On these I got the same behavour for a normal open contact as I had for the normal closed contacts. It needed to be tipped twice to get any reaktion, after that it was working more or less as usual..

 

Summary

I have tested these sequences a number of times, to see if I could repeat the problem. And so is it. The patter is the same.

Beta and Normal Closed contact - works the first program run. When restarting the program, I need to tip twice to get an interrupt.

 

Sorry for the test result ...

Geschrieben

I think i misunderstood your problem.

 

I changed something to make sure that the first edge in the edge count is always counted. That has nothing to do with interrupts, there is no edge count interrupt.

 

The normal "value changed interrupt" always uses both edges. Maybe it is a problem with the debounce time? What debounce time are you using?

Geschrieben

OK.

I will do as follows. At my little "machine" I will change the connection of the microswitch from Normal Closed to Normal Open, so it can be "operating".

 

At the weekend or under next week I try to built up an mini-enviroment so I more easy and properly could test my problem, and also better describe what's happens.

 

I will come back with more info.

Thanks anyway, so far ...

 

// Göran

Geschrieben

I have this evening made a simple test, just with two switches, one connected as NC, the other one as NO.

Funny, when I test like this, then it works perfect, for both inputs, both on rising and falling edge, directly in the beginning, No problem.

 

Anyhow, it means i have something funny in my normal program. I have to investigate more there..

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...