Axo I2C connectivity


#1

I'm currently trying to get a 2 Adafruit trellis modules connected to axoloti. It's interfaced using I2C and this should be my starting point, but the object for i2c does nothing more than a setup routine I think.

I tried the most generic I2C arduino code I could find. It's an I2C scanner, I tested it om a regular 5V arduino and on a 3.3V RFDuino (with some mods) and it works on both devices. It reports back that there is a I2C device.

includes is an axoloti i2ctester.axp (3.0 KB) patch that has the converted code for axoloti. However it does not compile at the moment.

two questions

  1. I included the needed libraries for compiling by doing:

ln -s /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/Wire.h
ln -s /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h
ln -s /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h
ln -s /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h
ln -s /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/
ln -s /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Printable.h

which is probably not the right way of including libraries, as well as I might be naive to believe this would just work? What is the right way and can this be done with arduinolibs?
2. is the logic level on the SDA/SCL lines defined by axoloti or by the device I connect? will I fry axoloti if I connect a device with a 5V logic level that is powered by 5V


Touch sensitive interface (MPR121)
#2

The I2C object indeed only does the setup.
These Arduino includes are not compatible.
Use this API:
http://chibios.sourceforge.net/html/group___i2_c.html
An I2C scanner would totally make sense in the object library, I'll add this when I find time.


#3

Can the trellis be used directly with axoloti Or is it adviseable to use an arduino aswel? Sorry if this is super dumb, I have no experience with i2c


#4

I'm sure it is possible, I had an I2C scanner demo detecting the trellis directly from the axoloti, but I found it much much easier to connect a 3.3V arduino comptible device (I used an RFduino) and have it send MIDI to GPIO-based midi port on the Axoloti.

It saves you the work of writing/translating a trellis library

--K


#5

This is how I'm using a Trellis. I have it connected to a Teensy which sends MidiCC to the Axo (header soldered behind the Midi Serial IN socket). I've then found I might as well continue using the Teensy for all other input as it keeps my controller logic and state in one device and reserves the Axo for it's pure audio functions.


#6

Having thought about all of this, i decided that using an arduino as a go between is probably the best idea.

I now have my Trellis and an Arduino Micro which is what i plan to use to deal with all the physical controls and possibly some 7 segment displays.

My axolotl board should arrive tomorrow. So that will be when all the ideas can start to come to life.
I guarantee that i will be back asking stupid questions within a few days. :smile:


#7

So I am back with the stupid questions. :wink:

I like the arduino dealing with all the UI bits but I have 2 issues with doing it like @mongrol

1) I don't want to sacrifice the midi in socket as I am looking to make a UI that can control many different patches and some of these I will want to play nice with other hardware (some of which has no USB midi)

2)I want to use some of these ( https://learn.adafruit.com/adafruit-led-backpack/0-54-alphanumeric ) to display parameter values which will mean I need 2 way communication.

Any ideas. I don't mind doing a bunch of reading, I just don't know where to start. Looking.


#8

I have my Teensy hooked up to a header at the back of the Midi-IN socket (I soldered on some a female header strip there) so I don't take up the socket. Of course, running Midi into the socket while pressing my buttons may give funny results but at least I leave the socket free and it will all stay internal to my enclosure.


#9

Ok that's cool. Didn't realise I could have both :smile_cat:
That's probably the way to go then.
Still need to work out sending info in the other direction to drive my alphanumerical displays tho.


#10

Well since I've got all my pots and switches going through the Teensy it makes sense to keep all the parameter states there too so I have no need for reading Axo's parameters. The setting in the Axo will be exactly what the Teensy tells it to be, and that's what I display on the oled.

This is all theory atm. I've proven all my code for the individual pieces (Trellis, Oled, pots etc) but I've yet to merge them all into one sketch (waiting on some parts coming).

I also found this https://github.com/laurb9/tiny_scope which hopefully I'll have enough memory for. :slight_smile:


#11

That makes a lot of sense. I think I am really trying to over complicate things for myself.

That little screen looks awesome. Might have to look into them myself (for future projects.)
I think for now I need to stop getting excited about so many things and focus on some serious learning.

Thank you for all the pointers too.
I plan to put everything I have learned and am doing in to some kind of guide for noobs as written by noobs once I have completed my project.