News:

Forum may be experiencing issues.

Main Menu

MIDI foot controller project

Started by RobA, July 11, 2013, 03:45:54 PM

Previous topic - Next topic

Thomas_H

Quote from: RobA on July 12, 2013, 01:47:40 PM
Quote from: Thomas_H on July 12, 2013, 01:00:13 PM
I would be interested in this but I am not doing Ardunio as I think one of those buggers is enough but if you  are interested in PIC programming and development I can help out.
I don't understand what you mean by "one of those buggers is enough."

Sorry to have been so unclear. I just meant that learning to program the features of one microcontroller family is enough for me personally.

You are absolutely right in what you say about Ardunio beeing simple and easy to be used by eveyone but I am not a big fan of the shield technique and the costly boards when the only thing you need is a 2€ microcontoller With USART implemented and a few analog inputs to get done what you need.  its just too much overhead.

This is my personal opinion of course  ;)
DIY-PCBs and projects:

jkokura

For both of you guys, and I'm sorry to derail the actual thread...

I've debating getting into programming for about 2 years now. The problem has always been I have no idea where to start. I agree with Thomas in that I'd rather get into microcontrollers because I don't want to have to buy a new board every time I want to build something, but I think the process of getting into MC is harder than getting into Arduino.

So, long story short - how do I get into MC, or should I just go for Arduino? If so, I know I need some software (for my mac) and I need at least a board for attaching to the computer, and then I need to get some chips. THEN I need to learn how to use it all and make the MC do stuff I want it to do.

How does one dive into this stuff?

Jacob
JMK Pedals - Custom Pedal Creations
JMK PCBs *New Website*
pedal company - youtube - facebook - Used Pedals

Thomas_H

#17
Hi Jacob,

Some general stuff that is true for both controller families:
All microcontrollers feature an on-board programming interface meaning that there are a few I/O pins on the controller that can be used as an programming interface.

So what you do is that you put the controller of your choice on a cheap prototyping board like this: https://www.olimex.com/Products/PIC/Proto/PIC-P18-20MHz/

Then you need a programming adapter between your computer and the prototype board like this: https://www.olimex.com/Products/PIC/Programmers/PIC-KIT3/

This programming adapter is controlled by your favourite Development Software (in case of PIC this is MPLAB, a programming GUI based on Netbeans)

In this Software you code in Assembler or C what you wish the Controller to do. (reading the 300 pages data sheet of the controller in question is real fun :-( )

MPLAB IDE is also available for MAC, so that will work for you.


The major point in using PICs is that there are so many different ones available that picking the right one is quite a task. You need to know how many digital I/O ports you need, how many analog, how many PWM / Comperator ports, if you need a hardware USART for MIDI and so on.

Once you have that you need an idea about memory needed (that is programming memory (code) data memory, flash memory, eeprom memory for long time storage ...

Then you have an idea about speed and size of the target controller ...

Then you pick the right one and start programming.

Everytime I use a new feature (i.e analog ports)  I fall into the traps that open up and I need to learn how to avoid them.
Then I use the next feature(i/o interrups) and fall into the next one ...

Ardunio does not have so many different controllers out there, thats true, but where is the fun in it?

Finding the right 8 pin $0.45 controller and making a perfect circuit around it  is the real fun, isnt it?

Apart from having fun I also think that when it comes to size there is no way around using PICs.

Feel free to ask any specific question on this topic and I will try to answer it.

If your question was more focused on a real "get me started" I could send you the code for my ultimate switch so you can get an idea how such a chip is programmed.




DIY-PCBs and projects:

RobA

Quote from: Thomas_H on July 13, 2013, 06:00:08 PM
[...]
Sorry to have been so unclear. I just meant that learning to program the features of one microcontroller family is enough for me personally.

You are absolutely right in what you say about Ardunio beeing simple and easy to be used by eveyone but I am not a big fan of the shield technique and the costly boards when the only thing you need is a 2€ microcontoller With USART implemented and a few analog inputs to get done what you need.  its just too much overhead.

This is my personal opinion of course  ;)


I understand what you mean now and that makes sense to me. Just keeping straight all the options for one family can be a pain.

I agree about the shields too. There are little boards though that you can use pretty much as a DIP in a bigger circuit and those are what I had in mind. Also, you can program using Arduino libraries straight to one of the little ATTinys if you have a programmer. So, you don't have to use the Arduino boards at all if you don't want to.
Affiliations: Music Unfolding (musicunfolding.com), software based effects and Rock•it Frog (rock.it-frog.com), DIY effects (coming soon).

RobA

#19
Quote from: jkokura on July 13, 2013, 06:05:12 PM
For both of you guys, and I'm sorry to derail the actual thread...

I've debating getting into programming for about 2 years now. The problem has always been I have no idea where to start. I agree with Thomas in that I'd rather get into microcontrollers because I don't want to have to buy a new board every time I want to build something, but I think the process of getting into MC is harder than getting into Arduino.

So, long story short - how do I get into MC, or should I just go for Arduino? If so, I know I need some software (for my mac) and I need at least a board for attaching to the computer, and then I need to get some chips. THEN I need to learn how to use it all and make the MC do stuff I want it to do.

How does one dive into this stuff?

Jacob

The Arduino stuff provides a nice library to get you started and does simplify the programming at the start. But, it also has some limitations and doesn't really get you that much. If I were starting again, I'd skip the Arduino stage and go straight to programming the microcontrollers. You already have the circuit building skills needed to put together the microcontroller portion of the circuits any way. So, the Arduino isn't getting you anything there either.

I've gone through comparing the AVR's and PIC's pretty extensively. They both have advantages. The thing that made me go with AVR is the development environment support for open projects. The PIC environment is actually quite nice. But, they've crippled it by removing optimization levels from GCC in the free versions. The paid for versions are too expensive to ask everyone to pay for working on an open source project. In the end, I think this is the reason that Arduino is based on AVR as well. Atmel is much more supportive of open source projects. The free development environment from Atmel is Windows only, so that sucks. But, they fully support development with GCC and there are several OS X based development environments that are good and free. I do all of my development on OS X, so I can point you at the links for what I use if you decide to go that way.

The other option is ARM. If what you are really looking to do is digital audio processing, this is the way to go. If that's what you are looking for, I can give you pointers here too.
Affiliations: Music Unfolding (musicunfolding.com), software based effects and Rock•it Frog (rock.it-frog.com), DIY effects (coming soon).

kothoma

#20
I'd say, start with an Arduino Nano (around €8 from Hongkong) to get a quick start on this.

Direct MIDI out (5-pin DIN) is almost trivial. For easy MIDI over USB follow http://shiftmore.blogspot.de/2010/01/quick-and-dirty-arduino-midi-over-usb.html (add €4.50 for the interface).

If you need more i/o ports, look into multiplexing with CD4051s.

For coding you don't really need a MIDI library. Just open the serial port and write bytes there.

Later you can always switch to other microcontrollers.

RobA

Quote from: kothoma on July 14, 2013, 11:31:58 AM
...
For coding you don't really need a MIDI library. Just open the serial port and write bytes there.
...

True. But, the library is nice if you want to do things that involve stuff like SysEx and clock syncing. For just sending data out on a channel, you don't really need it though.
Affiliations: Music Unfolding (musicunfolding.com), software based effects and Rock•it Frog (rock.it-frog.com), DIY effects (coming soon).

RobA

I was looking around at resources for this idea yesterday. For anyone interested in doing this with straight AVR's and want to do USB based MIDI connections to your computer, here are a couple of links that give you just about everything you need,
http://www.obdev.at/products/vusb/index.html
http://cryptomys.de/horo/V-USB-MIDI/index.html

It looks very doable and pretty easy for that matter.
Affiliations: Music Unfolding (musicunfolding.com), software based effects and Rock•it Frog (rock.it-frog.com), DIY effects (coming soon).

kothoma

Quote from: RobA on July 11, 2013, 03:45:54 PM

  • Battery powered with Li-Po batteries and onboard 9V recharging input

Hm, what about phantom power (over midi cable)?

RobA

Quote from: kothoma on July 14, 2013, 12:15:39 PM
Quote from: RobA on July 11, 2013, 03:45:54 PM

  • Battery powered with Li-Po batteries and onboard 9V recharging input

Hm, what about phantom power (over midi cable)?
That's a great idea. Do you know relative numbers of how many MIDI devices source power? For my use, it's pretty much a perfect idea since I'm going to use it for a device I design on the other end too. I'm just wondering for a more general setting.

It could be done with using USB power too if the receiver side is a USB host for the USB over MIDI path.
Affiliations: Music Unfolding (musicunfolding.com), software based effects and Rock•it Frog (rock.it-frog.com), DIY effects (coming soon).

kothoma

Quote from: RobA on July 14, 2013, 12:36:58 PM
Quote from: kothoma on July 14, 2013, 12:15:39 PM
Quote from: RobA on July 11, 2013, 03:45:54 PM

  • Battery powered with Li-Po batteries and onboard 9V recharging input

Hm, what about phantom power (over midi cable)?
That's a great idea. Do you know relative numbers of how many MIDI devices source power? For my use, it's pretty much a perfect idea since I'm going to use it for a device I design on the other end too. I'm just wondering for a more general setting.

It could be done with using USB power too if the receiver side is a USB host for the USB over MIDI path.

You could always put a little box at the other end, that provides "midi through" and adds DC to one side.

RobA

Yeah, this would certainly simplify things. I guess I was just looking for an excuse to use some of these Li-Po battery packs that are coming out all over the place now ;D. They look like so much fun to play with. I guess I'll have to find some other excuse to buy one.
Affiliations: Music Unfolding (musicunfolding.com), software based effects and Rock•it Frog (rock.it-frog.com), DIY effects (coming soon).