Interrupt Level triggered / edge triggered

  • Hello


    I have the problem that on my NETDCU8 my interupt on J5 Pin 2 is always level triggered, not edge triggered, doesn´t matter what registry configuration I use.
    I connected this pin 2 to 3.3V with a 4.7k resistor to have fixed voltage but I get interupts as long as i put low signal on that pin 2.


    My registry settings is as follows:


    Code
    1. reg open \drivers\builtin\digitalio
    2. reg set value port dword 0
    3. reg set value index dword 0
    4. reg set value datadir dword 0x000f1f
    5. reg set value datainit dword 0x000000
    6. reg set value useasio dword 0xffffff
    7. reg set value IRQCfg0 dword 0x000000E0
    8. reg set value IRQCfg1 dword 0x00000000
    9. reg set value IRQCfg2 dword 0x00000000


    The code is on principle:



    The strangest thing is that when I use

    Code
    1. reg set value IRQCfg0 dword 0x00000000


    what would mean that no interupts should be generated, even then the interupt are coming all the time when I connected ground to the pin.


    Does anyone have an idea what I do wrong?
    Any ideas are welcome, thanks.


    bye
    Andreas

  • Which kernel version do you use? Is there a differenece when you start the program the first time and any further times without rebooting the board in the meantime?


    I suspect the following: as there were problems with lost interrupts when they are edge triggered, we changed the behaviour in the newer kernels to emulate edge triggered interrupts with level triggered interrupts. This requires changing the internal interrupt configuration from edge to level which is done when you call InterruptInitialize(). However to make it possible to use the same interrupt another time, we have to reset the configuration back from level to edge again when the interrupt isn't used anymore, which is done in InterruptDisable(). However your code does not show that you ever call this function before ending the program. I guess this is the problem, because when you start the program the next time, InterruptInitialize() does not see an edge configuration anymore, as it was never changed back. Instead, it sees a level interrupt and that does not need any special handling. And this results in a true level interrupt.


    Changing these DIO settings in the registry requires restarting of the board to activate the new settings.


    Regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • There is no difference between using the program first time and thereafter with out rebooting. I always get these tons of interupt. What I did now was to use an ohter NETDCU8 with I had. It is one with kernel 27.5.07 with CF2. With this kernel it works as it should. So this is what you meant when you say that you changed the interrupt behaviour with newer kernels.


    Here is the startup when it is not working:



    Here it works(it the older another board):



    Does it make sense that I call every time when I get an interupt the function InterruptDisable() or will it not help? Ok I will try it anyway. If it hepls I will post it here.
    But could you look further in the meantime please?


    bye
    Andreas Heß

  • Quote from "andyinfsnet"

    Does it make sense that I call every time when I get an interupt the function InterruptDisable() or will it not help?


    No no no, just call InterruptDisable() once before you end your program. And probably you should also release the SysIntr with the appropriate DeviceIoControl() in this case.


    But while the program is running just wait for your event and then call InterruptDone() when you have done your work and are prepared for the next interrupt.


    Regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • As discussed with Mr Keller I tried now kernel NK82_CF2_080804.bin and it worked ok.
    So fs-net needs to create a new kernel for CF35 with these corrections.


    Bye the way, is it also possible to rising edge trigger interupt J5 pin1 (the predefined interupt pin)? There seems to be no registry setting for this pin like for the gen purpose IO pins.


    thanks
    Andreas