0
\$\begingroup\$

I‘m working on a project which has several switches and potentiometers that will be used to control parameters in software via (e.g.) MIDI and would like to know how to get the pots set up without using an Arduino.

The path I started down was to use a (following the MIDI example) 7-bit Flash ADC IC to convert to a digital signal, but am unsure how I could convert this to serial to be sent over USB. Is there some microcontroller which could be programmed to send out MIDI information based on the values received from the ADC?

I‘d like to cut out the Arduino to save space, be able to make a more customised device, and would also like to learn more about how this works. If there‘s a different path (such as using a different type of ADC other than Flash) I should look towards, please point me in the right direction.

\$\endgroup\$

closed as too broad by Voltage Spike, Elliot Alderson, Edgar Brown, RoyC, awjlogan Jan 17 at 12:50

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ There are plenty of MCU's with both ADCs and USB interfaces, and a lot of good long term reasons for moving away from the Arduino approach; however you might find it simplest to either use a small form factor Arduino or use something like a Teensy-LC which can be programmed in a similar manner. Even some of those ATtiny85 kludges might work, at least to the degree you trust their software USB. \$\endgroup\$ – Chris Stratton Jan 2 at 19:36
  • 1
    \$\begingroup\$ That's a weird criterion: without using an Arduino? What if you use an MCU that uses the same chip as an Arduino? What's so exclusive about an Arduino that you can't use something that isn't branded as an Arduino but behaves almost exactly the same? \$\endgroup\$ – KingDuken Jan 2 at 19:36
  • \$\begingroup\$ @KingDuken it‘s not necessarily that I have an issue with Arduino, but rather that I‘d like to know what the Arduino is doing to accomplish this. I‘m guessing I could just use one of the ATMega2560 chips, but how is it converting the information from the ADC to something which can be sent over USB? \$\endgroup\$ – som3oneMw Jan 2 at 19:55
  • \$\begingroup\$ In the arduino there is a microcontroller with a serial port, and a serial to USB translator chip. Microcontrollers which do have on-chip USB do not need a translator chip, but if you program them you have to be aware of USB which is a bit more complex than just Serial. \$\endgroup\$ – peufeu Jan 2 at 19:59
  • \$\begingroup\$ how small do you need? \$\endgroup\$ – Jasen Jan 3 at 1:00
0
\$\begingroup\$

The FTDI FT240X is a USB to 8-bit parallel FIFO IC, so you should be able to connect that directly to an 8-bit parallel ADC (other products are available, just search the web for USB GPIO).

This won't appear automatically as a MIDI device when you plug it in to a PC, you will have to do some programming at the PC end to read the data and do what you want to do with it. Also if you want to read multiple pots, you'll either need to add some sort of multiplexing circuit on the parallel side (and more software on the PC end to drive that) or to connect multiple USB-parallel devices using a USB hub (which defeats your object of small size, although you could implement the hub on your own board using a hub IC).

If you want to build something that will appear to the host PC as a MIDI controller then I don't think you can avoid using some sort of micro, and I would guess that the Arduino platform probably has more support than any other (try a web search for arduino USB MIDI). As mentioned in the comments on your question, if size is an issue then you can build your own circuit using an Arduino-compatible micro rather than having to use an existing Arduino board, although some of those are pretty small.

I'm sure that using one micro to implement the USB interface, and connecting that to multiple ADCs if necessary (if you can't just use built-in ADC pins) will be simpler than trying to interface multiple micros to one USB-serial interface. Note that while original Arduinos used a separate USB-serial chip, later designs use a microcontroller with built-in USB support.

\$\endgroup\$
0
\$\begingroup\$

A good place to look at are the Microchip microcontroller. You can go from the PIC18 to PIC25 or PIC32 range depending how many pots you need.

The PIC32MK can have up to 42, 12-bit ADC input, so you could connect 42 pots directly on a single 5-10$ chip.

Then they natively supports USB and Microchip have what they call the Harmony stack which makes it "simple" to configure the USB through a (bit buggy) visual configuration that generates the code for you.

Microchip provides the stack, have cheap programmer and are fairly easy to use, but you will find similar MCU in a lot of other manufacturer.

It's never easy to start from scratch though and be ready to scratch your head quite a bit to get it working, but once you pass the first wall it becomes very valuable knowledge.

You can use the USB Device mode, which is better than serial because you can directly bind the computer side software to the usb PID and VID, and not mess around with COM port settings that changes all the time.

I do not think USB supports natively MIDI format, so you would need to have a computer side software that takes the data from the USB device and transform them into MIDI and forward it where needed.

\$\endgroup\$
  • \$\begingroup\$ There is a USB MIDI device class. It's not clear whether the questioner needs their device to appear as a MIDI controller when connected to a computer though, or if they're OK with it being a serial port, which is probably less work on the microcontroller side. \$\endgroup\$ – nekomatic Jan 3 at 16:02
  • \$\begingroup\$ i‘m going to take a good look at this and probably at least end up experimenting with it, thank you \$\endgroup\$ – som3oneMw Jan 4 at 6:46
  • \$\begingroup\$ You can integrate the pic as MIDI if the class exist, but not sure it's directly supported by the framework and may need some coding. \$\endgroup\$ – Damien Jan 4 at 7:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.