Teensy and Mux Through I2C


#1

Hi everyone!

I´m a new user of Axoloti, and I don´t have a big knowledge about programming, just a few basics on C programming.

I started getting familiar how to connect external potentiometers and pushbuttons to Axoloti and all the connections between objects. But as I saw in this forum many ways of getting more digital/analog inputs through external devices, I decided to use a Teensy LC combined with a couple of CD74HC4067.

Looking for information through the community I found the next post, which is almost what I need:


First of all I have to say that I have zero knowledge about Arduino or it´s code, but what I want is to get a big amount of digital/analog inputs (32 of each) and the communication protocol has to be I2C (requirements of the project).

As I saw this post, I thought that it´s almost what I need, but this one uses the Teensy through the MIDI-USB port and I need it to go through I2C. In this post I found a lot of information about this but for what I need I don´t know how to get through it and I have the next doubt

If I don´t connect the Teensy LC through USB, I will need to create an object that receives the value of the signals of the pots/pushbuttons, etc. connected to the Teensy with a couple of MUX. In this case, do I need to upload the code to the Teensy as in the post above? or just placing the code from the post in the object is enough or do i need to do something else.

I´m sorry for not having much idea about this stuff but I want to make it work but I don´t know where do i have to start.


#2

The project requires I2C?
This sounds like a school assignment.


#3

Not exactly, I´m part of a sound association of my university and we discovered Axoloti and some of us, with help from some of the teachers of the school, are trying to develop a project with Axoloti (with a big lack of knowledge in some areas but trying always to overcome all the troubles) and show it to all the people interested.

One of the teachers suggested us to increase the available number of GPIO in Axoloti and we thought about using I2C with Teensy and a couple of MUX, something a little bit different than other similar posts.


#4

If you want two microcontrollers (Teensy and Axoloti) to communicate using I2C, one of them must be the slave, which is unusual (normally I2C connects I/O chips to a microcontroller, so the microcontroller is the master). So you should check if there is a library or something for the Teensy to play I2C slave, or if ChibiOS (the OS behind the Axoloti firmware) supports I2C in slave mode. If that's not the case, you can look forward to a lot of detailed programming work.