Panda II and InterruptPort

Hello,

We need make a project for continuous and simultaneus read from 10 ports.

We write something like...

        static InterruptPort PulsosEje = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di30, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth);

        static InterruptPort PulsosCal = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di32, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth);

        // Fotocelulas vías
        static InterruptPort FotoVia1 = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di2, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

        static InterruptPort FotoVia2 = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di3, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

        static InterruptPort FotoVia3 = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di4, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

        static InterruptPort FotoVia4 = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di5, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

        // Fotocelulas Cross
        static InterruptPort FotoParadaMesa = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di6, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

        static InterruptPort FotoCross1 = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di7, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

        static InterruptPort FotoCross2 = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.Di11, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

But, we can`t read simultaneusly more than 3 o 4 signals.

have you some suggestions??

thanks in advance.

I am not sure why you are using an interrupt port for reading?

if you want to read multiple values at same time, you can read the hardware registers directly. put all the pins on the same hardware port, and then read the data register for the port. look at the Register class in the Hardware.Lowlevel name space of the GHI library.

you will need to reference the hardware manual and schematic to get the port and pin associations, and register address.

@ Mike -
thanks Mike for your fast response but, where I can found the registers of the IOs?

I found this link ( https://www.ghielectronics.com/downloads/man/Library_Documentation_v4.1/html/be700fb0-683f-e830-99f8-bc6dfad09569.htm )in which I can see the members of the Register class and this example in the documentation https://www.ghielectronics.com/docs/108/register-access but I don´t see in the nxp dfatasheet ( http://www.nxp.com/documents/data_sheet/LPC2387.pdf )the register of the IOs

responding to your first question, I want to read 10 interrupts pins but when I test the firmware, only I can use 2 interrupts at the same time, the rest of the interrupts failed, so I think that its better read directly the input port.

I think it’d help if you gave us an idea of what “continuously” means to your project, how many interrupts per second on each line, how much processing you expect to do on each interrupt, and what you’re trying to achieve. Perhaps your approach was not optimal, perhaps it’s too much to ask for one micro to do on it’s own, perhaps it’s something you’ll never achieve - give us more info and we can help.

for register details you probably want the user manual http://www.nxp.com/documents/user_manual/UM10211.pdf