Grand Central M4: Neat board!!: i2c questions (continued)

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
owntheweb
 
Posts: 83
Joined: Fri Oct 24, 2014 4:03 pm

Grand Central M4: Neat board!!: i2c questions (continued)

Post by owntheweb »

I'm so excited!
custom-designed game controller
custom-designed game controller
CC60536E-37DA-4D35-B46B-919FA951596E.jpg (306.61 KiB) Viewed 157 times
i2c-connected flashy gizmos
i2c-connected flashy gizmos
28DFE4EC-9906-4939-BACD-E605D44BE628.JPEG (603.76 KiB) Viewed 157 times
I'm making very good progress on a custom game controller. It's a miracle all this stuff fits together, excited!

With this, I'm learning a lot about the Metro Grand Central M4. It's super cool I that can set most of the pins (a lotta pins!) to PWM mode, great for lighting effect plans.

I'm also learning that I might* be able to configure additional I2c pins for the board (interesting read)? Continuing from this post, this piqued my interest as I have an overload of i2c components, maybe more than most would use in a chain, that has become a bit less responsive for rapid-fire tasks (4-6 loops per second to read all the i2c things). I have other i2C devices I could add e.g. ADCs for the joysticks, now opting for direct reads via all those fancy Grand Central pins. Grand Central kinda rocks, just sayin'.

With the hardware I have currently, I'm thinking of ways to speed things up a little and also running into occasional i2c lock issues with all the wire involved I think.

Regarding errors: I bet I could prevent those more by connecting NeoKeys to one i2c set of pins, and the sliders to the other set of pins on the board. Both connect to the same pins internally, yes? That would reduce wire length (and possibly errors) to start.

Speed: Would having a newly configured port speed things up and is it possible on the Grand Central? I'm on the fence about it. Reading values from multiple i2c connections would still be part of the same synchronous loop and take about the same amount of time to collect all the reads (yeah?).

Alternately, I was thinking I could use some other hub capable of reading multiple values at once, syncing with Grand Central with one read... yet I'm tired and not that smart... Any ideas? The HT16K33 was mentioned in my previous post (super cool), however I'm not sure if it would apply directly with current hardware, yet. **brain shuts down

Thanks for letting get thoughts out there. Sometimes it helps just to write it out. I appreciate any thoughts you might have that will add to this! :D

User avatar
owntheweb
 
Posts: 83
Joined: Fri Oct 24, 2014 4:03 pm

Re: Grand Central M4: Neat board!!: i2c questions (continued)

Post by owntheweb »

I think I have a game plan now. Thanks for letting me think out loud! :D

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Grand Central M4: Neat board!!: i2c questions (continued)

Post by adafruit_support_mike »

Regarding I2C, the basic problem you're dealing with now is called the 'Von Neumann bottleneck': no matter what you use as a CPU, the fundamental limit on processing speed is your ability to get information from the rest of the world to that CPU, and results from that CPU back to the rest of the world.

In this case, having multiple I2C buses won't help because you can only use one at a time.

Having 10 I2C devices on 10 separate buses is fast if all 10 buses can operate simultaneously.. you'll get data from 10 devices in the same amount of time it takes to talk to a single device. It doesn't improve anything if buses 2-through-10 have to sit idle while you talk to the device on bus-1. Even if the I2C peripheral circuit takes some load of the microcontroller core (the part that runs your code), the core has to be involved in sending and reading messages, and can only do that for one I2C bus at a time.

You could theoretically improve things by connecting each I2C device to its own microcontroller so you could get that 'all 10 buses active at the same time' speedup, but then you'd need to get the information from those microcontrollers to your main/central one. With proper management of communication between the satellite microcontrollers (to keep as many of them as possible working simultaneously), you could get better speed than you would from having the main/central one talk to each external device in turn, but there would still be timing costs.

User avatar
owntheweb
 
Posts: 83
Joined: Fri Oct 24, 2014 4:03 pm

Re: Grand Central M4: Neat board!!: i2c questions (continued)

Post by owntheweb »

Yes! Thank you adafruit_support_mike for applying a label to it. That's exactly what's happening.

My way forward: I had one button I wasn't quite sure what to do with. I'm going to set as a "performance mode" toggle, greatly reducing reads to eight less-used keys when more flight control is needed. :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”