Main Site Documentation

Cerberus Gadgeteer socket with 3 GPIO!


#1

I am trying to design a new gadgeteer module (!), and I have three sensors connected. I would need them to be able to call an interrupt, but I see no sockets with 3 interrupt capable pins. What is the recommended route for that problem?

EDIT: Snippet from module builders guide page 5 attached.


#2

So, what you are saying is that I might be able to find a socket on the Cerberus with 3 interrupt capable pins?

In that case, please guide me to the documentation to investigate closer.


#3

The gadgeteer specifications requires pin 3 to be interrupt capable but that does not mean the other pins are not.

This maybe a small issue if your module require more but you can always use an OR gate to put all interrupts on one pin.


#4

Great idea with the OR gate in hardware. Where do I look to find out if a given pin is actually interrupt capable in a given mainboard.


#5

Depending on the main board, the som or processor datasheet.


#6

@ njbuch - What kind of module are you making?


#7

I am having three hall sensors on the same Cerberus system, but needs more sockets, considering to use the Y socket type but needs the interrupts.

The hall sensor is very simple, and maybe I even want to combine it with 2-3 micro-swithces.
All in all 6 interrupt capable pins would be perfect…


#8

I tried looking at the STM datesheets and reference manual. Not comprehensible to my brain.

New method:

Ok consider the following code runs without exceptions:


Socket socket = Socket.GetSocket(socketNumber, true, this, null);

socket.EnsureTypeIsSupported(new char[] { 'Y' }, this);

// These calls will throw GT.Socket.InvalidSocketException if a pin conflict or error is encountered
input3 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Three, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
input4 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Four, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
input5 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Five, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
input6 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Six, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
input7 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Seven, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
input8 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Eight, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
input9 = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Nine, GTI.GlitchFilterMode.On, GTI.ResistorMode.Disabled, GTI.InterruptMode.RisingAndFallingEdge, this);
            input3.Interrupt += (_input_Interrupt);
            input4.Interrupt += (_input_Interrupt);
            input5.Interrupt += (_input_Interrupt);
            input6.Interrupt += (_input_Interrupt);
            input7.Interrupt += (_input_Interrupt);
            input8.Interrupt += (_input_Interrupt);
            input9.Interrupt += (_input_Interrupt);

Would it be fair to assume that the pins are interrupt capable, or do I need to test them with real hardware?


#9

Stm suites interrupts very weird! Not sure if will get an exception! All pins are interrupt capable but you can only use the individual ports. Did example, pins A3 and B4 will work but A3 and B3 will not! The pin numbers must be different even they are on different ports!


#10

Hmm, OK, new idea. I have a io60p16 module lying around. Would that beauty be able to support many interrupt capable pins for sure?


#11

Yes if you write the drivers. Our drivers doesn’t support interrupts.


#12

I think Ian’s driver does