(More Issues) Cerb40 Pin Conflicts?

I’m using the following pins for buttons on the Cerb40:
PB6-PB9, PA4, PA5, PC6, PC7

[em]All[/em] of them work fine as interrupt ports on the board individually. However, if I try to use them all at once I start getting different InterruptPorts not being able to create. Which ones depends on which order you try and create them.

I’ve managed to get 6 of the 8 working at the same time (PC6 & PC7 are the “problem pins”). I can also get the OLED, uSD, and Piezo going at the same time, no problems there.

I’m also seeing issues making PA6 & PA7 interrupts for the Tilt Sensor when trying to use all the pins. If I create just those interrupts alone they work fine.

It’s a little head-bangy.

G.U.S. save me! Any clues on how to get all this pins going at the same time?

The STM32 has 16 external interrupt lines, and the different ports are multiplexed onto these interrupt lines, one for each pin. Therefore, PA6, PB6, and PC6 all share one interrupt line. Similarly, PA7, PB7, and PC7 share a different interrupt line.

It’s my belief (though I’m not certain) that there is a bug in the firmware that prevents more than one port using a given interrupt line. I don’t believe this is a hardware limitation, but I cannot confirm this.

See here for the previous discussion: http://www.tinyclr.com/forum/topic?id=10648

Hi Skewworks,

It is possible that the interrupt pin limitation may be having an effect. Here is a link to more information: http://wiki.tinyclr.com/index.php?title=Cerb-Family#STM32F4_Interrupt_Pin_Limitations

I had seen this prior to mapping but disregarded because I’m not using 16 interrupts, I’m only using 11.

Is this still an issue because there’s multiples on a single bank? Is there a per-bank limit as well as a total limit?

I can easily make the TiltSensor a polled operation but I’d hate to have to poll 2 buttons as well; though I will if needed.

GHI Specific Follow-up
Obviously this is for the new board I created. Right now I’m using the Cerb40, however in production I plan to replace this with the chip itself to gain access to more pins and facilitate board layout changes.

Since it will no longer carry the GHI stamp on it (not having the Cerb40 and all) but I still plan on using your firmware can you please provide me any notations I need to make on the board, documentation, etc to use your firmware? I also plan on having it report as an ArMF device instead of “Cerb-Family”.

That’s fine. You can use all 16 EXTI (EXTernal Interrupt) lines, if you want.

Bingo. The firmware (and maybe the hardware, I don’t know) limit you to one interrupt pin per EXTI line, which means that you can’t have PA6 and PB6 be an interrupt port (because they share an EXTI line) at the same time, regardless of how many total EXTI lines you’re using.

Well isn’t that just a pain in the arse.

OK so EXTI lines are shared by pin #? So A1, B1, C1 are all on the same EXTI?

That’s fine for production since I can just do 0 - n (since I’ll probably support more than 11 in production).

Thanks for your help; I’ll switch to polled operations for the affected pins


No problem. Now that I dig deeper, looking at 8.2.4 in the reference manual, I wonder whether it is actually a hardware limitation. Someone with more expertise than I have would need to say for sure.

I am not aware of any company who had taken our work on Cerb-family and built a new custom product. This should be exciting to see. Please do not forget to remove GHI/FEZ names from your product but attribute back to original work.

You got it!

I’ll post up vids when I get back from my short holiday

For attribute how’s “Based on Cerberus family of products for GHI Electronics, LLC” in the docs?

I hate to report but I ran my test program on the wonderful hardware I got in my hands today and I have continued issues.

Even running ALL the pins as InputPorts instead of InterruptPorts I get a hardware error :frowning:

Each pin works individually but not as a group. Is there nothing I can do for the prototype board?

We are not aware of any issues.

Gus, here’s a short sample code. Perhaps you guys can have a look? I can make this work for the KickStarter video by doing some behind the scenes stuff but it’d be great if I could have it fully functioning on the prototypes too. :slight_smile:

        // DPad
        private InputPort _btnLeft, _btnUp, _btnRight, _btnDown;

        // ABCD
        private InputPort _btnA, _btnB, _btnC, _btnD;

        // Tilt Sensor
        private InputPort _tilt1, _tilt2;

            // DPad
            _btnLeft = new InputPort((Cpu.Pin)22, true, Port.ResistorMode.PullUp);
            _btnRight = new InputPort((Cpu.Pin)23, true, Port.ResistorMode.PullUp);
            _btnUp = new InputPort((Cpu.Pin)24, true, Port.ResistorMode.PullUp);
            _btnDown = new InputPort((Cpu.Pin)25, true, Port.ResistorMode.PullUp);

            // ABCD
            _btnA = new InputPort((Cpu.Pin)4, true, Port.ResistorMode.PullUp);
            _btnB = new InputPort((Cpu.Pin)38, true, Port.ResistorMode.PullUp);
            _btnC = new InputPort((Cpu.Pin)39, true, Port.ResistorMode.PullUp);
            _btnD = new InputPort((Cpu.Pin)5, true, Port.ResistorMode.PullUp);

            // Tilt Sensor
            _tilt1 = new InputPort((Cpu.Pin)7, true, Port.ResistorMode.PullUp);
            _tilt2 = new InputPort((Cpu.Pin)6, true, Port.ResistorMode.PullUp);

Errors will occur on Buttons B & C as well as Tilt1 & 2

What kind of error?

As architect said, what kind of error?

An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll

At what line? the instantiation of the InputPort?

First error is on instancing button B. then again on C and both tilt pins

@ Skewworks - Can you check the hresult of the exception?


HResult: 4244635648

None of the different ResisterModes makes a difference

See if setting glitch filtering to false on each port goes through.