-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hi, I'm trying to interface a multi coin acceptor with Espressobin. This coin acceptor emits pulses for every coin inserted. For example 1 peso coin (I'm in philippines) pulses 0 for 20ms and then pulses 1 for 100ms (using 'both' edge). It turns the GPIO input to 0 for 20ms and turns to 1 for 100ms. It does this one time for 1 peso coin and 5 times for 5 peso coin.
So if you print the value of 'both' edge every time an interrupt occurs, this is the output:
1 peso coin:
0
1 (after 20ms)
5 peso coin:
0
1 (after 20ms)
0 (after 100ms)
1 (after 20ms)
0 (after 100ms)
1 (after 20ms)
0 (after 100ms)
1 (after 20ms)
The problem is that sometimes, some of the interrupts are not detected by the epoll library when I'm no longer interacting with the coin acceptor after sometime. What happens is, for example inserting a 5 peso coin to the multi coin acceptor results to:
1 (after 20ms) - it skipped the first `falling edge` and/or
1 or 0 (after 120ms) - it skipped the falling/rising edge detection
0 (after 100ms)
1 (aftter 20ms)
0 (after 100ms)
1 (after 20ms)
0 (after 100ms)
1 (after 20ms)
I think the interrupt detection job is somewhat put to background or something that's why it can't properly detect the pulses when there is no activity for some time. In the next consecutive insertion of coins, it properly detects the coins again.
I can confirm that the problem is not the circuit or the coin acceptor because this doesn't happen when I use the same schematics on raspberry pi's GPIO and a python script.
I'd just like to know if you have any idea on top of your head what might be the cause of this issue.