Welcome! Log In Create A New Profile

Advanced

BV4618 and interrupt line

Posted by Gilles BILLARD 
BV4618 and interrupt line
April 11, 2015 08:49AM
Hi,
I have an issue dealing with interrupt from pin9 of a 4618.
I try to have fun with the design of an acces control.
I use an Arudino UNO + BV kit with a 4618, a keypad, a 4 lines LCD and a RFID reader.
I wish I use inetrrupts lines to trigger the code; INT0 from BV4618, INT1 from tag reader.

Your doc says:
"When there is a value in the key buffer the nInt line will go low and remain low
until all of the keys have been read out."
BUT no trigger occurs unless I put something like:
if (di.keyint())
{
tmp = di.key();
}*
In the main loop.

If these 2 lines are in the main loop, the interrupt line goes down and I can treat the event but if they are put between quotes (commented) nothing happen.

Please, tell me my misunderstanding ?
++

( disregard my poor English, please)
Re: BV4618 and interrupt line
April 13, 2015 01:36PM
hello,
this is a specific Arduino issue and interrupt lines. I don't think that there will be enough knowledge about Arduino on this forum, it may be better placed on an Arduino forum.
Re: BV4618 and interrupt line
April 14, 2015 10:24AM
Okay, thanks,
I'll do that.
++
Re: BV4618 and interrupt line
April 19, 2015 09:02AM
Hi,
No answer on Arduino spécific forum... but:
To me, it is not an Arduino issue. I put a oscilloscope on the board to check the signals.
Probe 1 set on int line (pin9)
Probe 2 set on keyboard column 1
(i'd like to put screen shots, but I dont know how...)

If I dont read the buffer, I see no pulse on trigger pin; I can only see the scanning pulses of the rows on probe 2 when the key is hit.
If I read the buffer, an interrupt pulse occurs during a tenth of mS as soon as the scanning pulses occurs.

So, I do not understand your documentation. The int line does not go low when I hit a key. It goes low when I read the buffer.
I think this int line can be used to trigger a piece of code to activate a beeper (to confirm key hit) as an example but cannot be used to avoid scanning the buffer in the main loop.

++
Re: BV4618 and interrupt line
April 20, 2015 03:24PM
Gilles,
there must be some misunderstanding in either the line used or how the device works.

Just in case:
1) we are talking about the BV4618 (http://www.byvac.com/index.php/BV4618)
2) The device in serial mode will not respond to anything unless a Baud rate is established by sending 13(CR) first, this does not apply with I2C
3) The interrupt line is the one next to C3 marked Int on the PCB

It operates as follows: the Int line will be high when there are no characters in the input buffer for example at switch on. When a key is pressed (see 2 above) the line goes low and stays low until the last character is read from the buffer by using either the clear buffer command or the read key command. When there are no characters in the buffer the line will go high again.

If a beeper is connected to this line (assuming it can drive it) then the beeper will remain 'beeping' until the key buffer is empty. The only way it can be emptied is by a reset or one of the key emptying commands.

Jim
Re: BV4618 and interrupt line
April 25, 2015 05:09PM
Thanks Jim,

1) That's it !
2) The device is perfectly running on I2C mode
3) That is the very line I use.

Let's have a look on the screenshots:
Just after power on (no key hit), if I dont read the buffer, I see no pulse on trigger pin, it is low and stays low; I can only see the scanning pulses of the rows on probe 2 when a key is hit.


If I read the buffer, an interrupt pulse occurs during a tenth of mS as soon as the scanning pulses occurs.


Do I have a spécial piece of code (eg: emptying the buffer) to run just after power on to set high the interrupt line in order to use it as a regular interrupt line ?
Re: BV4618 and interrupt line
April 25, 2015 05:25PM
The command to clear the buffer (esc[c) is in the data sheet.
Re: BV4618 and interrupt line
April 26, 2015 07:27PM
Hi Jim,
I cleared the buffer during the setup and all's working perfectly now.
Many thanks for your help.

(Anyway, I'm still surprised the reset doesn't clear the buffer and set the interrupt line high)
++
Sorry, only registered users may post in this forum.

Click here to login